Szerző Téma: lista  (Megtekintve 951 alkalommal)

lista
« Dátum: 2016. Szeptember 02. - 17:54:43 »
0 Show voters
Sziasztok az a kérdésem hogy ACL jogon belül van valami parancs ami ki listázza hogy mik azok a resourcek futnak jelenleg ?

lista
« Válasz #1 Dátum: 2016. Szeptember 02. - 18:57:01 »
0 Show voters
Asszem wikin van valami példa rá megnézem.
E:
function displayResources()
     outputConsole(\"List of resources:\")
     local resourceTable = getResources() -- get a table of resources
     for resourceKey, resourceValue in ipairs(resourceTable) do
          -- iterate through the table and output each resource\'s name
          local name = getResourceName(resourceValue)
          outputConsole(\" \" .. name)
     end
end
« Utoljára szerkesztve: 2016. Szeptember 02. - 19:08:05 írta thegergo02 »

lista
« Válasz #2 Dátum: 2016. Szeptember 02. - 19:18:32 »
0 Show voters
vagyis ha berakom akkor le listázza h mik azok mennek?

lista
« Válasz #3 Dátum: 2016. Szeptember 02. - 20:09:05 »
0 Show voters
Asszem hozzádobsz egy addCommandHandler-t (Pl.:
addCommandHandler(\"resourcelist\", fukcióneve) 

 
Ha beírod a fukcióneve helyére a function nevét akkor a resourcelist parancsal tudod megnézni.

lista
« Válasz #4 Dátum: 2016. Szeptember 02. - 20:27:50 »
0 Show voters
Rendben ki próbálom köszi

Dupla hozzászólás automatikusan összefûzve. ( 2016. Szeptember 02. - 20:43:22 )

na komplett lua Igy néz ki de semmit nem ad ki Ötlet?
 
 addCommandHandler(\"resourcelist\", fukcióneve) 
function displayResources()
     outputConsole(\"List of resources:\")
     local resourceTable = getResources() -- get a table of resources
     for resourceKey, resourceValue in ipairs(resourceTable) do
          -- iterate through the table and output each resource\'s name
          local name = getResourceName(resourceValue)
          outputConsole(\" \" .. name)
     end
end
« Utoljára szerkesztve: 2016. Szeptember 02. - 20:43:22 írta kisolasz »

lista
« Válasz #5 Dátum: 2016. Szeptember 02. - 22:50:28 »
0 Show voters
Idézetet írta: kisolasz date=1472831683\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"62951\" data-ipsquote-contentclass=\"forums_Topic
Sziasztok az a kérdésem hogy ACL jogon belül van valami parancs ami ki listázza hogy mik azok a resourcek futnak jelenleg ?
 

Rendben ki próbálom köszi

Dupla hozzászólás automatikusan összefûzve. ( [time]2016. szeptember 02. 20:43:22[/time] )

na komplett lua Igy néz ki de semmit nem ad ki Ötlet?
 
 addCommandHandler(\"resourcelist\", fukcióneve) 
function displayResources()
     outputConsole(\"List of resources:\")
     local resourceTable = getResources() -- get a table of resources
     for resourceKey, resourceValue in ipairs(resourceTable) do
          -- iterate through the table and output each resource\'s name
          local name = getResourceName(resourceValue)
          outputConsole(\" \" .. name)
     end
end

 

[/quote]
Ez az összes resource nevét kiírja, nem csak  a futókat. Írj hozzá egy elágazást:
if getResourceState(resourceValue) == \"running\" then

lista
« Válasz #6 Dátum: 2016. Szeptember 03. - 19:44:18 »
0 Show voters
addCommandHandler(\"resourcelist\", fukcióneve)

 
\"fukcióneve\" -> Át kéne írni a saját funkciódnak a nevére.. ( displayResources )

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal