error 017: undefined symbol "playerid" [rep+]
#1

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) {
Reply
#2

pawn Код:
public TakeOver(playerid)
Do it for the forward aswell!
Reply
#3

or since your foreach'ing it, just replace with i.
Reply
#4

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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)