error 017: undefined symbol "playerid" [rep+] - 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 017: undefined symbol "playerid" [rep+] (
/showthread.php?tid=327732)
error 017: undefined symbol "playerid" [rep+] -
Faisal_khan - 22.03.2012
Hi SA-MP Community,
The title says it all.
pawn Код:
public TakeOver()
{
foreach(Player, i) {
if(IsPlayerInCheckpoint(playerid, -385.3699, 1506.446, -256.9133, 1646.58) && gTeam[i] == TEAM_USA) {
if(CapturedBy != 1) {
if( IfCapture[0] == 1 ) return 1;
IfCapture[0] = 0;
dini_IntSet("/Variables/Variables.ini", "CapturedBy", 1);
uscore++;
// SetTimer("ScoreText", 5000, 0);
SetPlayerScore(i, GetPlayerScore(i) + 2);
CapturedBy = 1;
if(CapturedBy != 1) SendClientMessageToAll(COLOR_CON_GREEN, "NEWS: Team USA have captured the Big Ear!");
GangZoneHideForAll(Ear);
GangZoneShowForAll(EarU, COLOR_BLUE);
GangZoneHideForAll(EarG);
dini_IntSet("/Variables/Variables.ini", "uscore", uscore);
CheckForLevelUpdate(i);
}
}
else if(IsPlayerInCheckpoint(playerid, -385.3699, 1506.446, -256.9133, 1646.58) && gTeam[i] == TEAM_GERMANY) {
if(CapturedBy != 2) { {
if( IfCapture[0] == 1 ) return 1;
IfCapture[0] = 0;
dini_IntSet("/Variables/Variables.ini", "CapturedBy", 2);
gscore++;
// SetTimer("ScoreText", 5000, 0);
SetPlayerScore(i, GetPlayerScore(i) + 2);
CapturedBy = 2;
if(CapturedBy != 2) SendClientMessageToAll(COLOR_CON_GREEN, "NEWS: Team GERMANY have captured the Big Ear!");
GangZoneHideForAll(Ear);
GangZoneShowForAll(EarG, COLOR_RED);
GangZoneHideForAll(EarU);
dini_IntSet("/Variables/Variables.ini", "gscore", gscore);
CheckForLevelUpdate(i);
}
}
}
}
return 1;
}
Error:
pawn Код:
error 017: undefined symbol "playerid"
Error line:
pawn Код:
if(IsPlayerInCheckpoint(playerid, -385.3699, 1506.446, -256.9133, 1646.58) && gTeam[i] == TEAM_USA) {
Re: error 017: undefined symbol "playerid" [rep+] -
Twisted_Insane - 22.03.2012
pawn Код:
public TakeOver(playerid)
Do it for the forward aswell!
Re: error 017: undefined symbol "playerid" [rep+] -
aco_SRBIJA - 22.03.2012
or since your foreach'ing it, just replace with i.
Re: error 017: undefined symbol "playerid" [rep+] - T0pAz - 22.03.2012
pawn Код:
public TakeOver()
{
foreach(Player, i) {
if(IsPlayerInCheckpoint(i, -385.3699, 1506.446, -256.9133, 1646.58) && gTeam[i] == TEAM_USA) {
if(CapturedBy != 1) {
if( IfCapture[0] == 1 ) return 1;
IfCapture[0] = 0;
dini_IntSet("/Variables/Variables.ini", "CapturedBy", 1);
uscore++;
// SetTimer("ScoreText", 5000, 0);
SetPlayerScore(i, GetPlayerScore(i) + 2);
CapturedBy = 1;
if(CapturedBy != 1) SendClientMessageToAll(COLOR_CON_GREEN, "NEWS: Team USA have captured the Big Ear!");
GangZoneHideForAll(Ear);
GangZoneShowForAll(EarU, COLOR_BLUE);
GangZoneHideForAll(EarG);
dini_IntSet("/Variables/Variables.ini", "uscore", uscore);
CheckForLevelUpdate(i);
}
}
else if(IsPlayerInCheckpoint(i, -385.3699, 1506.446, -256.9133, 1646.58) && gTeam[i] == TEAM_GERMANY) {
if(CapturedBy != 2) { {
if( IfCapture[0] == 1 ) return 1;
IfCapture[0] = 0;
dini_IntSet("/Variables/Variables.ini", "CapturedBy", 2);
gscore++;
// SetTimer("ScoreText", 5000, 0);
SetPlayerScore(i, GetPlayerScore(i) + 2);
CapturedBy = 2;
if(CapturedBy != 2) SendClientMessageToAll(COLOR_CON_GREEN, "NEWS: Team GERMANY have captured the Big Ear!");
GangZoneHideForAll(Ear);
GangZoneShowForAll(EarG, COLOR_RED);
GangZoneHideForAll(EarU);
dini_IntSet("/Variables/Variables.ini", "gscore", gscore);
CheckForLevelUpdate(i);
}
}
}
}
return 1;
}