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

Wysłany: 2017-11-14, 22:24


EvilXmik







Wiek: 28
Na forum: 3620 dni
Posty: 148
Nick w MP: EvilXmik

Piwa: 399

Respekt: 50

Tak jak w temacie
B??d wyskakuje mi w 11 linijce

https://imgur.com/a/LhU6v

Kod:


addCommandHandler ( "admins", function ( plr, cmd )
Root = {}
Administrator = {}
Moderator = {}
for _,v in ipairs ( getElementsByType ( "player" ) ) do
if getElementData(plr, "duty") == 3 then
nick = "#ffff00Root#ffffff| "..getPlayerName ( v )..""
table.insert ( Root, nick )
end
end
outputChatBox ( "RCONi: ", plr, 128,0,0 )
outputChatBox ( " ", plr, 255, 255, 0 )
if #Root > 0 then
c = table.concat ( Root, ", " )
outputChatBox ( c, plr, 255, 255, 255, true )
else
outputChatBox ( "Brak", plr )
end
for _,v in ipairs ( getElementsByType ( "player" ) ) do
if getElementData(plr, "duty") == 2 then
nick = "#ff9900Administrator#ffffff| "..getPlayerName ( v )..""
table.insert ( Administrator, nick )
end
end
outputChatBox ( "#ff9900Administratorzy: ", plr, 255,0,0, true )
outputChatBox ( " ", plr, 0, 255, 255, true )
if #Administrator > 0 then
c = table.concat ( Administrator, ", " )
outputChatBox ( c, plr, 255, 255, 255, true )
else
outputChatBox ( "Brak", plr )
end
for _,v in ipairs ( getElementsByType ( "player" ) ) do
if getElementData(plr, "duty") == 1 then
nick = "#0EC711Moderator#ffffff:"..getPlayerName ( v ).." "
table.insert ( Moderator, nick )
end
end
outputChatBox ( "#0EC711Moderatorzy: ", plr, 0, 255, 255, true )
outputChatBox ( " ", plr, 0, 255, 255, true )
if #Moderator > 0 then
c = table.concat ( Moderator, ", " )
outputChatBox ( c, plr, 255, 255, 255, true )
else
outputChatBox ( "Brak", plr )
end
end)


[ Dodano: 2017-11-14, 22:29 ]
Przepraszam pomyli?em si?

[ Dodano: 2017-11-14, 22:29 ]
Chodzi o ten skrypt :P
Kod:


addCommandHandler ( "admins", function ( plr, cmd )
admini = {}
support = {}
super = {}
for _,v in ipairs ( getElementsByType ( "player" ) ) do
if isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(v)), aclGetGroup ( "Admin" ) ) then
nick = "[#ffff00RCON#ffffff] "..getPlayerName ( v ).." ( "..getElementData ( v, "playerid" ).." )"
table.insert ( admini, nick )
end
end
outputChatBox ( "________", plr, 0, 255, 255, true )
outputChatBox ( "RCON-i :", plr, 255, 255, 0 )
--outputChatBox ( " ", plr, 255, 255, 0 )
if #admini > 0 then
c = table.concat ( admini, ", " )
outputChatBox ( c, plr, 255, 255, 255, true )
else
outputChatBox ( "Brak administracji online", plr )
end
for _,v in ipairs ( getElementsByType ( "player" ) ) do
if isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(v)), aclGetGroup ( "Support" ) ) then
nick = "[#ff9900Support#ffffff] "..getPlayerName ( v ).." ( "..getElementData ( v, "playerid" ).." )"
table.insert ( support, nick )
end
end
outputChatBox ( "________", plr, 0, 255, 255, true )
outputChatBox ( "#ff9900Support :", plr, 0, 255, 255, true )
--outputChatBox ( " ", plr, 0, 255, 255, true )
if #support > 0 then
c = table.concat ( support, ", " )
outputChatBox ( c, plr, 255, 255, 255, true )
else
outputChatBox ( "Brak support online", plr )
end
for _,v in ipairs ( getElementsByType ( "player" ) ) do
if isObjectInACLGroup ( "user."..getAccountName(getPlayerAccount(v)), aclGetGroup ( "SSupport" ) ) then
nick = "[#0EC711Super Support#ffffff] "..getPlayerName ( v ).." ( "..getElementData ( v, "playerid" ).." )"
table.insert ( super, nick )
end
end
outputChatBox ( "________", plr, 0, 255, 255, true )
outputChatBox ( "#0EC711Super Support :", plr, 0, 255, 255, true )
--outputChatBox ( " ", plr, 0, 255, 255, true )
if #super > 0 then
c = table.concat ( super, ", " )
outputChatBox ( c, plr, 255, 255, 255, true )
else
outputChatBox ( "Brak Super Support online", plr )
end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-11-14, 22:31


Pevo

Jabłko






Wiek: 23
Na forum: 3590 dni
Posty: 356
Nick w MP: Pevo

Piwa: 1571

Respekt: 355,8
Respekt: 355,8Respekt: 355,8Respekt: 355,8Respekt: 355,8

Mo?e powiesz, kt?ra to 11. linijka? B?dzie szybciej.

Podpis
Jabłko
Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
EvilXmik
Wysłany: 2017-11-14, 22:36


EvilXmik







Wiek: 28
Na forum: 3620 dni
Posty: 148
Nick w MP: EvilXmik

Piwa: 399

Respekt: 50

nick = "[#ffff00RCON#ffffff] "..getPlayerName ( v ).." ( "..getElementData ( v, "playerid" ).." )"

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-11-14, 22:47


Pevo

Jabłko






Wiek: 23
Na forum: 3590 dni
Posty: 356
Nick w MP: Pevo

Piwa: 1571

Respekt: 355,8
Respekt: 355,8Respekt: 355,8Respekt: 355,8Respekt: 355,8

To napewno ten skrypt? Na oko, to tu jest wszystko dobrze...

[ Dodano: 2017-11-14, 22:48 ]
I tego si? nie robi p?tl?, po prostu instrukcj? warunkow?. Np. if rcon then co?tam elseif admin then co?tam elseif support then co?tam end

Podpis
Jabłko
Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
EvilXmik
Wysłany: 2017-11-14, 22:53


EvilXmik







Wiek: 28
Na forum: 3620 dni
Posty: 148
Nick w MP: EvilXmik

Piwa: 399

Respekt: 50

To jak to ma wygl?da? ?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-11-14, 23:04


amited







Wiek: 26
Na forum: 3714 dni
Posty: 1233
Nick w MP: Amited

Piwa: 512

Respekt: 466
Respekt: 466

przemek1835, jak ty chcesz wzi?? ifem wszystkich graczy?

Podpis
"amited" napisał/a:
Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
EvilXmik
Wysłany: 2017-11-14, 23:06


EvilXmik







Wiek: 28
Na forum: 3620 dni
Posty: 148
Nick w MP: EvilXmik

Piwa: 399

Respekt: 50

nie tylko pod ACL ?eby by?o

[ Dodano: 2017-11-14, 23:06 ]
a skrypt nie jest m?j
tak na marginesie

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-11-14, 23:07


amited







Wiek: 26
Na forum: 3714 dni
Posty: 1233
Nick w MP: Amited

Piwa: 512

Respekt: 466
Respekt: 466

EvilXmik, nie ma nic po tym boolean value?

Podpis
"amited" napisał/a:
Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
EvilXmik
Wysłany: 2017-11-14, 23:11


Pevo

Jabłko






Wiek: 23
Na forum: 3590 dni
Posty: 356
Nick w MP: Pevo

Piwa: 1571

Respekt: 355,8
Respekt: 355,8Respekt: 355,8Respekt: 355,8Respekt: 355,8

"amited" napisał/a:

przemek1835, jak ty chcesz wzi?? ifem wszystkich graczy?


heh, ?le powiedzia?em. Jestem troch? zaspany i zauwa?y?em 2 p?tle.


addCommandHandler("admins",function(plr,cmd)
  rcon={}
  admin={}
  support={}
  for i,v in pairs(getElementsBytType("player")) do
    if isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(plr)),aclGetGroup("rcon")) then
      table.insert(rcon,getPlayerName(v))
    elseif isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(plr)),aclGetGroup("admin")) then
      table.insert(admin,getPlayerName(v))
    elseif isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(plr)),aclGetGroup("support")) then
      table.insert(support,getPlayerName(v))
    end
  end

end)


i dalej wystarczy da? output do rcon admin i support.

Podpis
Jabłko
Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
EvilXmik
Wysłany: 2017-11-14, 23:22


EvilXmik







Wiek: 28
Na forum: 3620 dni
Posty: 148
Nick w MP: EvilXmik

Piwa: 399

Respekt: 50

emm jako? mi to nie wychodzi :/

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-11-14, 23:25


Pevo

Jabłko






Wiek: 23
Na forum: 3590 dni
Posty: 356
Nick w MP: Pevo

Piwa: 1571

Respekt: 355,8
Respekt: 355,8Respekt: 355,8Respekt: 355,8Respekt: 355,8

"EvilXmik" napisał/a:

emm jako? mi to nie wychodzi :/


Jak to nie? Na pewno masz serwer pod ACL i czy robisz po stronie serwera?

Podpis
Jabłko
Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
EvilXmik
Wysłany: 2017-11-14, 23:29


EvilXmik







Wiek: 28
Na forum: 3620 dni
Posty: 148
Nick w MP: EvilXmik

Piwa: 399

Respekt: 50

Kod:

addCommandHandler("admins",function(plr,cmd)
rcon={}
admin={}
support={}
for i,v in pairs(getElementsBytType("player")) do
if isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(plr)),aclGetGroup("rcon")) then
table.insert(rcon,getPlayerName(v))
outputChatBox ( "________", plr, 0, 255, 255, true )
outputChatBox ( "RCON-i :", plr, 255, 255, 0 )
--outputChatBox ( " ", plr, 255, 255, 0 )
if #rcon > 0 then
c = table.concat ( rcon, ", " )
outputChatBox ( c, plr, 255, 255, 255, true )
else
outputChatBox ( "Brak administracji online", plr )
end
elseif isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(plr)),aclGetGroup("admin")) then
table.insert(admin,getPlayerName(v))
outputChatBox ( "________", plr, 0, 255, 255, true )
outputChatBox ( "#ff9900Support :", plr, 0, 255, 255, true )
--outputChatBox ( " ", plr, 0, 255, 255, true )
if #admin > 0 then
c = table.concat ( admin, ", " )
outputChatBox ( c, plr, 255, 255, 255, true )
else
outputChatBox ( "Brak admin online", plr )
elseif isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(plr)),aclGetGroup("support")) then
table.insert(support,getPlayerName(v))
outputChatBox ( "________", plr, 0, 255, 255, true )
outputChatBox ( "#0EC711Super Support :", plr, 0, 255, 255, true )
--outputChatBox ( " ", plr, 0, 255, 255, true )
if #support > 0 then
c = table.concat ( support, ", " )
outputChatBox ( c, plr, 255, 255, 255, true )
else
outputChatBox ( "Brak support Support online", plr )
end
end

end)


emm chyba zwali?em :/ serio te? ju? dzi? nie ogarniam zaspany :C

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-11-15, 18:23


Pevo

Jabłko






Wiek: 23
Na forum: 3590 dni
Posty: 356
Nick w MP: Pevo

Piwa: 1571

Respekt: 355,8
Respekt: 355,8Respekt: 355,8Respekt: 355,8Respekt: 355,8


addCommandHandler("admins",function(plr,cmd)
  rcon={}
  admin={}
  support={}
  for i,v in pairs(getElementsBytType("player")) do
    if isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(plr)),aclGetGroup("rcon")) then
      table.insert(rcon,getPlayerName(v))
    elseif isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(plr)),aclGetGroup("admin")) then
      table.insert(admin,getPlayerName(v))
    elseif isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(plr)),aclGetGroup("support")) then
      table.insert(support,getPlayerName(v))
    end
  end

  outputChatBox("Rconi:",plr)
  for i,v in pairs(rcon) do
    outputChatBox("  "..v,true)
  end

end)


i tak dalej, zrobi?em, ?e pokazuje samych rcon?w. Na tej podstawie mo?esz zrobi? pokazywanie admin?w i support?w.

Podpis
Jabłko
Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
EvilXmik
Wysłany: 2017-11-15, 20:59


EvilXmik







Wiek: 28
Na forum: 3620 dni
Posty: 148
Nick w MP: EvilXmik

Piwa: 399

Respekt: 50

Czyli co ma to tak wygl?da? ?
Kod:


addCommandHandler("admins",function(plr,cmd)
rcon={}
admin={}
support={}
for i,v in pairs(getElementsBytType("player")) do
if isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(plr)),aclGetGroup("rcon")) then
table.insert(rcon,getPlayerName(v))
elseif isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(plr)),aclGetGroup("admin")) then
table.insert(admin,getPlayerName(v))
elseif isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(plr)),aclGetGroup("support")) then
table.insert(support,getPlayerName(v))
end
end

outputChatBox("rcon:",plr)
for i,v in pairs(admin) do
outputChatBox(" "..v,true)
end

outputChatBox("admin:",plr)
for i,v in pairs(rcon) do
outputChatBox(" "..v,true)
end

outputChatBox("support:",plr)
for i,v in pairs(rcon) do
outputChatBox(" "..v,true)
end

end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-11-15, 21:05


Pevo

Jabłko






Wiek: 23
Na forum: 3590 dni
Posty: 356
Nick w MP: Pevo

Piwa: 1571

Respekt: 355,8
Respekt: 355,8Respekt: 355,8Respekt: 355,8Respekt: 355,8

Tak, tylko sp?jrz, ?e pomiesza?e? to, gdzie ma by? rcon, admin i support

Podpis
Jabłko
Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
EvilXmik
Tagi: dodaje :: kogoś :: kogo :: nie :: powinno
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA 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