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: Error (
/showthread.php?tid=488102)
Error -
Wayland - 16.01.2014
pawn Код:
CMD:donators(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 5)
{
SendClientMessage(playerid, COLOR_NEWS, "Donators Online:");
new
iCount,
szMessage[128];
foreach(new i : Player) //This line
{
if(PlayerInfo[i][pDonator] == 1)
{
format(szMessage, sizeof(szMessage), "(Ruby) ID: %d | Name: %s | Level: %d | Ping: %d", i, GetPlayerNameEx(i), PlayerInfo[i][pLevel], GetPlayerPing(i));
SendClientMessage(playerid, COLOR_WHITE, szMessage);
iCount++;
}
else if(PlayerInfo[i][pDonator] == 2)
{
format(szMessage, sizeof(szMessage), "(Sapphire) ID: %d | Name: %s | Level: %d | Ping: %d", i, GetPlayerNameEx(i), PlayerInfo[i][pLevel], GetPlayerPing(i));
SendClientMessage(playerid, COLOR_WHITE, szMessage);
iCount++;
}
else if(PlayerInfo[i][pDonator] == 3)
{
format(szMessage, sizeof(szMessage), "(Diamond) ID: %d | Name: %s | Level: %d | Ping: %d", i, GetPlayerNameEx(i), PlayerInfo[i][pLevel], GetPlayerPing(i));
SendClientMessage(playerid, COLOR_WHITE, szMessage);
iCount++;
}
}
if(iCount == 0)
return SendClientMessage(playerid, COLOR_GREY, "There aren't any donators online right now.");
}
return true;
}
PHP код:
C:\Ma Stuff is Here\FUCKU\gamemodes\LYL.pwn(11846) : error 017: undefined symbol "foreach"
C:\Ma Stuff is Here\FUCKU\gamemodes\LYL.pwn(11846) : error 029: invalid expression, assumed zero
C:\Ma Stuff is Here\FUCKU\gamemodes\LYL.pwn(11846) : error 017: undefined symbol "i"
C:\Ma Stuff is Here\FUCKU\gamemodes\LYL.pwn(11846) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.
Can someone fix it?
Re: Error -
Zamora - 16.01.2014
Change it to
pawn Код:
for (new i = 0; i != MAX_PLAYERS; ++i)
Re: Error -
[TMS]Legena - 16.01.2014
You could use this too for player names. Just to make command smaller.
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
and replace GetPlayerNameEx(i); with "name"
This will make your command to looks better
Re: Error -
Wayland - 17.01.2014
Nvm, Fixed it by myself