SA-MP Forums Archive
Stock error - 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: Stock error (/showthread.php?tid=549829)



Stock error - CoR3 - 09.12.2014

Hey Whats up !, Well i was trying created a new stock for my new roleplay server, but i have these alerts.

Quote:

error 017: undefined symbol "PWantedLevel"
warning 215: expression has no effect
error 001: expected token: ";", but found "]"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line

My stock is this:

Quote:

stock GivePlayerPWantedLevel(playerid, wantedlevel)
{
PWantedLevel[playerid] = wantedlevel;
SetPlayerWantedLevel(playerid,PWantedLevel[playerid]);
return 1;
}

What's my mistake?... thank guys.


Re: Stock error - Abagail - 09.12.2014

You need to make sure something like this near the top of your script:
new PWantedLevel[MAX_PLAYERS] = 0;

And make sure the variables get reset properly on connect / disconnect.


Respuesta: Stock error - CoR3 - 09.12.2014

Yeah, thats right... Some day i will +rep you