Getting error.. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Getting error.. (
/showthread.php?tid=350718)
Getting error.. -
Audi_Quattrix - 13.06.2012
Code:
pawn Код:
CMD:admins(playerid)
{
new string[128];
SendClientMessage(playerid,COLOR_GGREEN,"---------ONLINE ADMINS---------");
for(new i = 0; if < MAX_PLAYERS; i++)
{
if(PlayerInfo[i][pAdmin] > 0)
{
format(string,sizeof(string), "%s - Level %d admin", GetPlayerNameEx(i), PlayerInfo[i][pAdmin]);
SendClientMessageToAll(COLOR_GGREEN, string);
}
}
return 1;
}
Error:
pawn Код:
(825) : error 029: invalid expression, assumed zero
Line 825:
pawn Код:
for(new i = 0; if < MAX_PLAYERS; i++)
AW: Getting error.. -
Extremo - 13.06.2012
Quote:
Originally Posted by Audi_Quattrix
pawn Код:
for(new i = 0; if < MAX_PLAYERS; i++)
|
It has to be:
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
You actually create a variable i, so the condition must be based around that variable and not an if-clause.
Regards.
Re: Getting error.. -
Audi_Quattrix - 13.06.2012
Thanks