CMD:showcontrats(playerid, params[])
{
if(HitContract[playerid] < 1) return 1;
new name[MAX_PLAYER_NAME+1];
SendClientMessage(playerid, -1, "--------- List of the contracts -----------");
foreach(new i : Player) // line 801
{
if(Hitman[i]) GetPlayerName(i, name, sizeof(name)), SendClientMessage(playerid, -1, "- Target : %s || Amount : %i", name, GetPVarInt(i, "hitmanmoney"));
}
return 1;
}
C:\Users\Arty\Desktop\CesarLT\gamemodes\FCG.pwn(801) : error 017: undefined symbol "foreach"
C:\Users\Arty\Desktop\CesarLT\gamemodes\FCG.pwn(801) : error 029: invalid expression, assumed zero
C:\Users\Arty\Desktop\CesarLT\gamemodes\FCG.pwn(801) : error 017: undefined symbol "i"
C:\Users\Arty\Desktop\CesarLT\gamemodes\FCG.pwn(801) : 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.
CMD:showcontrats(playerid, params[])
{
if(HitContract[playerid] < 1) return 1;
new name[MAX_PLAYER_NAME+1];
SendClientMessage(playerid, -1, "--------- List of the contracts -----------");
foreach(Player,i)
{
if(Hitman[i]) GetPlayerName(i, name, sizeof(name)), SendClientMessage(playerid, -1, "- Target : %s || Amount : %i", name, GetPVarInt(i, "hitmanmoney"));
}
return 1;
}
You need include foreach.inc: http://pastebin.com/Seseuh2x
Second, you have incorrect foreach: pawn Код:
|
if(Hitman[i]) GetPlayerName(i, name, sizeof(name)), SendClientMessage(playerid, -1, "- Target : %s || Amount : %i", name, GetPVarInt(i, "hitmanmoney"));
if(Hitman[i]==1(or any other value according to your script)) GetPlayerName(i, name, sizeof(name)), SendClientMessage(playerid, -1, "- Target : %s || Amount : %i", name, GetPVarInt(i, "hitmanmoney"));
... SendClientMessage(playerid, -1, "- Target : %s || Amount : %i", name, GetPVarInt(i, "hitmanmoney"));
if(Hitman[i]==1) GetPlayerName(i, name, sizeof(name)), SendClientMessage(playerid, -1, "- Target : %s || Amount : %i", name, GetPVarInt(i, "hitmanmoney"));
C:\Users\Arty\Desktop\CesarLT\gamemodes\FCG.pwn(763) : warning 202: number of arguments does not match definition
C:\Users\Arty\Desktop\CesarLT\gamemodes\FCG.pwn(763) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
2 Warnings.
All the information in MacT's post is wrong. Your original code was correct - the format he posted hasn't been used for literally years! Check the foreach topic for more up-to-date versions of the include.
|
pawn Код:
|