SA-MP Forums Archive
error 017: undefined symbol "playerid".. - 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".. (/showthread.php?tid=549186)



error 017: undefined symbol "playerid".. - dundolina - 05.12.2014

Give me this error here.. :

Код:
public payday()
{
    for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i))
    {
        GameTextForPlayer(i, "PAYDAY + 10 0000$ and + 10 score", 1000, 1);
        SetPlayerScore(playerid,GetPlayerScore(playerid)+10);
        GivePlayerMoney(i, 10000); // You can change the ammount of money.
    }
    return 1;
}



Re: error 017: undefined symbol "playerid".. - osman2571 - 05.12.2014

public payday()
{
for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i))
{
GameTextForPlayer(i, "PAYDAY + 10 0000$ and + 10 score", 1000, 1);
SetPlayerScore(i,GetPlayerScore(playerid)+10);
GivePlayerMoney(i, 10000); // You can change the ammount of money.
}
return 1;
}

Try that or just define new playerid; if you want i don't know what you' making


Re: error 017: undefined symbol "playerid".. - OsteeN - 05.12.2014

It's because playerid isn't set anywhere within the function. Change it to 'i' instead, like osman2571 showed by the "SetPlayerScore".


Re: error 017: undefined symbol "playerid".. - JaKe Elite - 05.12.2014

Quote:
Originally Posted by osman2571
Посмотреть сообщение
on other way she can just put forward payday(playerid) and also make public payday(playerid)
Basically that is a bad idea, The SetTimer is meant to be called without the parameters, What do you think?


Re: error 017: undefined symbol "playerid".. - OsteeN - 05.12.2014

Quote:
Originally Posted by osman2571
Посмотреть сообщение
on other way she can just put forward payday(playerid) and also make public payday(playerid)
Well since he's using a for loop inside of the paycheck function; there's no reason to send a playerid.


Re: error 017: undefined symbol "playerid".. - Beckett - 05.12.2014

pawn Код:
public payday()
{
    for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i))
    {
        GameTextForPlayer(i, "PAYDAY + 10 0000$ and + 10 score", 1000, 1);
        SetPlayerScore(playerid,GetPlayerScore(i)+10);
        GivePlayerMoney(i, 10000); // You can change the ammount of money.
    }
    return 1;
}



Re: error 017: undefined symbol "playerid".. - PowerPC603 - 05.12.2014

pawn Код:
public payday()
{
    for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i))
    {
        GameTextForPlayer(i, "PAYDAY + 10 0000$ and + 10 score", 1000, 1);
        SetPlayerScore(i,GetPlayerScore(i)+10);
        GivePlayerMoney(i, 10000); // You can change the ammount of money.
    }
    return 1;
}