SA-MP Forums Archive
Undefined Symbol complicated problem - 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: Undefined Symbol complicated problem (/showthread.php?tid=566575)



Undefined Symbol complicated problem - NinjahZ - 07.03.2015

Okay, so my script is throwing this back at me.....
Код:
error 017: undefined symbol "playerid"
This is pointed at SendClientMessage
Код:
SendClientMessage(playerid,COLOR_WHITE,"===========Payslip===========");
Which is inside.....
pawn Код:
public Payday()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(PlayerInfo[i][pLevel] == 1)
            {
                SendClientMessage(playerid,COLOR_WHITE,"===========Payslip===========");
                SendClientMessage(playerid,COLOR_WHITE,"Initial Payslip $2,000-------");
                SendClientMessage(playerid,COLOR_WHITE,"Car Petrol Cost $300($1,700)-");
                SendClientMessage(Playerid,COLOR_WHITE,"Car Repair Bill-$450($1,250)-");
                SendClientMessage(playerid,COLOR_WHITE,"Doctor's Bill---$250($1,000)-");
                SendClientMessage(playerid,COLOR_WHITE,"After Tax and Bills $1,000---");
                SendClientMessage(playerid,COLOR_WHITE,"=============================");
                new nxtlevel;
                nxtlevel = PlayerInfo[i][pLevel]+1;
                new string[128];
                format(string, sizeof(string), "~y~PayDay~n~~w~Paycheck");
                GameTextForPlayer(i, string, 1000, 1);
                new payday = nxtlevel*1000;
                GivePlayerCash(i,payday);
                PlayerInfo[i][pExp]++;
            }
        }
    }
    return 1;
}
Only problem is I can not declare
Код:
public Payday()
as
Код:
public Payday(playerid)
FIXED THANKS ANYONE THAT POSTED BUT IT WAS SIMPLE, Change"playerid" to "i".


Re: Undefined Symbol complicated problem - Misiur - 07.03.2015

Quite simple: your loop variable is "i" not "playerid". Just replace "playerid" with "i".


Re: Undefined Symbol complicated problem - NinjahZ - 07.03.2015

Yeah I just figured that and was changing it before I refreshed sorry for un-needed post, wow sorry I am still halve asleep

EDIT: Literally rolling on the floor laughing at myself *facepalm*