Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.
GTAONLINE.PL
Tematy otagowane jako: powinno
1. Dodaje mi kogoś kogo nie powinno
Tak jak w temacie
B??d wyskakuje mi w 11 linijce

https://imgur.com/a/LhU6v

[code]
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...
2. [DM] CMD /Kick 3 sobek kickuje nie tego gracza co powinno
Witam m?j problem polega na tym ,?e gdy wpisuj? np /kick 5 sobek to kickuje gracza z id 0 dlaczego?

kod:

Kod:

CMD:kick(playerid,cmdtext[]){//Na Dole Mapy!

if(!Administrator[playerid]) return SendClientMessage(playerid,COLOR_RED2," (b??d) Nie jeste? administratorem!");

new gracz,powod[64];
if(sscanf(cmdtext,"us[64]",gracz,powod)){
SendClientMessage(playerid, COLOR_RED, " (b??d) Wpisz: /kick [id gracza] [pow?d]");
return 1;
}

if(gracz < 0 || gracz >= MAX_GRACZY) return SendClientMessage(playerid, COLOR_RED, " (b??d) Z?e ID gracza");
if(!IsPlayerConnected(gracz)) return SendClientMessage(playerid, COLOR_RED, " (b??d) Nie ma takiego gracza");

new playername[MAX_PLAYER_NAME];
new kickname[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
GetPlayerName(gracz, kickname, sizeof(kickname));
new tmp[128];
format(tmp, sizeof(tmp), " {808080}» {FF0000}%s (id %d) zosta?(a) wyrzucony(a) przez admina: %s. Pow?d: %s.", kickname, gracz, playername, powod);
printf(tmp);
SendClientMessageToAll(COLOR_RED2, tmp);
SendPlayerWarning(gracz,3000,"Zostales(as) wyrzucony(a) z serwera!");
Kick(gracz);
kicks ++;

return 1;
}


Prosz? o poprawienie kodu.