Undefined Symbol ( playerid )
#1

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 !! ");
			}
Reply
#2

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

Use "i" instead of playerid
Reply
#4

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

Anyway +1 rep for both of you
Reply
#5

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.
Reply
#6

Okay ... tnx
Reply
#7

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

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 ... !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)