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



Undefined Symbol ( playerid ) - MichaelProPlayer - 08.05.2012

I am getting this error message ==> Undefined symbol playerid 2 times

This is my script :

Код:
public RobbingStores()
{
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if(IsPlayerSpawned(i))
		{   //Drugs
			if(RobDrugs[i] > 1)
			{
				if (GetPlayerColor(playerid) == COLOR_WHITE || GetPlayerColor(playerid) == COLOR_PINK)
				{
					new string[250], robber[MAX_PLAYER_NAME], robtime;
					GetPlayerName(i, robber, sizeof(robber));
					RobDrugs[i]--;
					robtime = (RobDrugs[i]);
					format(string, sizeof(string), "~w~STAY IN THE CHECKPOINT~n~~g~%d~w~ SECONDS REMAINING", robtime);
					GameTextForPlayer(i, string, 3000, 3);
				}
				else SendClientMessage(playerid,COLOR_ERROR,"You cannot rob !! ");
			}



Re: Undefined Symbol ( playerid ) - Scripter12345 - 08.05.2012

pawn Код:
if (GetPlayerColor(i) == COLOR_WHITE || GetPlayerColor(i) == COLOR_PINK)



Re: Undefined Symbol ( playerid ) - TzAkS. - 08.05.2012

Use "i" instead of playerid


Re: Undefined Symbol ( playerid ) - MichaelProPlayer - 08.05.2012

Wow man thanks for that quick answer .... Never heard about " i "

Anyway +1 rep for both of you


Re: Undefined Symbol ( playerid ) - TzAkS. - 08.05.2012

You have these
Код:
for(new i = 0; i < MAX_PLAYERS; i++)
If you had with playerid instead of i or
Код:
public RobbingStores(playerid)
it wos something else.


Re: Undefined Symbol ( playerid ) - MichaelProPlayer - 08.05.2012

Okay ... tnx


Re: Undefined Symbol ( playerid ) - MP2 - 08.05.2012

'i' is just a variable name. Is it often used in for loops as i = 'iteration' (I think!)


MP2 - MichaelProPlayer - 08.05.2012

Quote:
Originally Posted by MP2
Посмотреть сообщение
'i' is just a variable name. Is it often used in for loops as i = 'iteration' (I think!)
Okay +1rep for you too ... !