Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2014-08-15, 23:06


Michael1236







Wiek: 35
Na forum: 4378 dni
Posty: 8
Nick w MP: Michal69

Piwa: 13

Respekt: 50

Witam,kolega Rick napisa? mi skrypt lecz nie dzia?a mi on prosz? o pomoc.
ACL = {}
ACL[1] = "Rconi"
ACL[2] = "Administratorzy"
ACL[3] = "Moderatorzy"



function getOnlineModerators()
local t = {}
for k,v in ipairs ( getElementsByType("player") ) do
while true do
local acc = getPlayerAccount(v)
if not acc or isGuestAccount(acc) then break end
local accName = getAccountName(acc)
local isAdmin = isObjectInACLGroup("user."..accName,aclGetGroup(ACL[3]))
if isAdmin == true then
table.insert(t,v)
end
break
end
end
return t
end


function getOnlineRCONS()
local t = {}
for k,v in ipairs ( getElementsByType("player") ) do
while true do
local acc = getPlayerAccount(v)
if not acc or isGuestAccount(acc) then break end
local accName = getAccountName(acc)
local isAdmin = isObjectInACLGroup("user."..accName,aclGetGroup(ACL[1]))
if isAdmin == true then
table.insert(t,v)
end
break
end
end
return t
end



function getOnlineAdmins()
local t = {}
for k,v in ipairs ( getElementsByType("player") ) do
while true do
local acc = getPlayerAccount(v)
if not acc or isGuestAccount(acc) then break end
local accName = getAccountName(acc)
local isAdmin = isObjectInACLGroup("user."..accName,aclGetGroup(ACL[2]))
if isAdmin == true then
table.insert(t,v)
end
break
end
end
return t
end


addCommandHandler("admins",function(p)
local RCON = getOnlineRCONS()
local Admini = getOnlineAdmins()
local Moderators = getOnlineModerators()
if #RCON ~= 0 then
outputChatBox("RCONI:",p,150,0,0,true)
for k,v in ipairs ( RCON ) do -- loop the table
outputChatBox("- "..getPlayerName(v),p,150,0,0,true)
end
end

if #Admini ~= 0 then
outputChatBox("Administracja:",p,255,0,0,true)
for k,v in ipairs ( Admini ) do -- loop the table
outputChatBox("- "..getPlayerName(v),p,255,0,0,true)
end
end



if #Moderators ~= 0 then
outputChatBox("Moderatorzy:",p,0,0,150,true)
for k,v in ipairs ( Moderators ) do -- loop the table
outputChatBox("- "..getPlayerName(v),p,255,0,0,true)
end
end

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-08-15, 23:39


Dixers

No-Life






Wiek: 26
Na forum: 4313 dni
Posty: 549
Nick w MP: Dixers

Piwa: 412

Respekt: 56,8

Sprawd?, czy dzia?a:

ACL = {} 
ACL[1] = "Rconi" 
ACL[2] = "Administratorzy" 
ACL[3] = "Moderatorzy" 



function getOnlineModerators() 
local t = {} 
for k,v in ipairs getElementsByType("player") ) do 
while true do 
local acc getPlayerAccount(v) 
if not acc or isGuestAccount(accthen break end 
local accName getAccountName(acclocal isAdmin isObjectInACLGroup("user."..accName,aclGetGroup(ACL[3])) 
if isAdmin == true then 
table.insert(t,vend 
break 
end 
end 
return t 
end 


function getOnlineRCONS() 
local t = {} 
for k,v in ipairs getElementsByType("player") ) do 
while true do 
local acc getPlayerAccount(v) 
if not acc or isGuestAccount(accthen break end 
local accName getAccountName(acclocal isAdmin isObjectInACLGroup("user."..accName,aclGetGroup(ACL[1])) 
if isAdmin == true then 
table.insert(t,vend 
break 
end 
end 
return t 
end 



function getOnlineAdmins() 
local t = {} 
for k,v in ipairs getElementsByType("player") ) do 
while true do 
local acc getPlayerAccount(v) 
if not acc or isGuestAccount(accthen break end 
local accName getAccountName(acclocal isAdmin isObjectInACLGroup("user."..accName,aclGetGroup(ACL[2])) 
if isAdmin == true then 
table.insert(t,vend 
break 
end 
end 
return t 
end 


addCommandHandler("admins",function (p)
local RCON getOnlineRCONS() 
local Admini getOnlineAdmins() 
local Moderators getOnlineModerators() 
if #RCON ~= 0 then 
outputChatBox("RCONI:",p,150,0,0,true) 
for k,v in ipairs RCON ) do -- loop the table 
outputChatBox("- "..getPlayerName(v),p,150,0,0,trueend 
end

if #Admini ~= 0 then 
outputChatBox("Administracja:",p,255,0,0,true) 
for k,v in ipairs Admini ) do -- loop the table 
outputChatBox("- "..getPlayerName(v),p,255,0,0,trueend 
end 



if #Moderators ~= 0 then 
outputChatBox("Moderatorzy:",p,0,0,150,true) 
for k,v in ipairs Moderators ) do -- loop the table 
outputChatBox("- "..getPlayerName(v),p,255,0,0,trueend
end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-08-16, 17:41


Michael1236







Wiek: 35
Na forum: 4378 dni
Posty: 8
Nick w MP: Michal69

Piwa: 13

Respekt: 50

Nie dopisa?em w Mecie [ .lua ] rozwi?zane.LOCK

Podpis
Polski Serwer RP - http://play.xaa.pl/


Polski Serwer Role PlaY 70% www.play.xaa.pl

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-08-16, 17:58


Dixers

No-Life






Wiek: 26
Na forum: 4313 dni
Posty: 549
Nick w MP: Dixers

Piwa: 412

Respekt: 56,8

Michael1236, ale teraz u?y?e? tego kodu, kt?ry ja poprawi?em, czy tego wcze?niejszego. Bo my?l?, ?e jednak by? b??d w kodzie, poniewa? addCommandHandler nie zosta? zamkni?ty "endem"

[ Dodano: 2014-08-16, 17:59 ]
Oczywi?cie je?li w mecie nie mia?e? [.lua] to by? b??d.....

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-08-17, 15:56


luki123luki123

Place Game






Wiek: 28
Na forum: 5275 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

Dixers, Komendy si? nie zamyka End'em tylko Rozpoczecie funkcji(function) i if'y si? zamyka.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-08-17, 16:25


MeeShuffle

Programista/Grafik






Wiek: 32
Na forum: 4395 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

luki123luki123, p?tle r?wnie?. Wed?ug twojego twierdzenia to :


addCommandHandler "cos" [...]


Nie musi by? zamykane endem?

Podpis

https://shufflecode.pl
Static Codes and Graphics - Join our discord!
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-08-17, 18:39


Dixers

No-Life






Wiek: 26
Na forum: 4313 dni
Posty: 549
Nick w MP: Dixers

Piwa: 412

Respekt: 56,8

luki123luki123, PanMaszyna, ma racje, musi by? zamkni?te.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-08-17, 18:49


luki123luki123

Place Game






Wiek: 28
Na forum: 5275 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

PanMaszyna, ?alezy w jaki spos?b robimy kod ja robie w nastepuj?cy:
Function bla ()
end
addCommandHandler"bla"bla )

W tym przypadku nie zamykamy addCommandHandler tylko function

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-08-17, 19:15


Dixers

No-Life






Wiek: 26
Na forum: 4313 dni
Posty: 549
Nick w MP: Dixers

Piwa: 412

Respekt: 56,8

luki123luki123, ale przecie? widzisz, jaki wy?ej jest kod. Wi?c to co poprawi?em, poprawi?em dobrze....

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-08-18, 00:05


DajGryza







Wiek: 26
Na forum: 4309 dni
Posty: 9
Nick w MP: DajGryza

Piwa: 1

Respekt: 50

PanMaszyna, Prosi?bym o kontakt ze mn? na GG : 43819478 lub FaceBook : http://facebook.com/ddubielak
Prosz? o szybki kontakt, chodzi o zlecenie skryptu :)

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-08-18, 14:20


Dixers

No-Life






Wiek: 26
Na forum: 4313 dni
Posty: 549
Nick w MP: Dixers

Piwa: 412

Respekt: 56,8

DajGryza, co wnosi tw?j post w tym temacie? Je?li masz do niego spraw?, napisz mu na pw.

Postaw piwo autorowi tego posta
 

 
Tagi: skrypt
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Skrypt Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku