PDA

View Full Version : Undefined Symbol ( playerid )


MichaelProPlayer
08/05/2012, 01:25 PM
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 !! ");
}

Scripter12345
08/05/2012, 01:27 PM
if (GetPlayerColor(i) == COLOR_WHITE || GetPlayerColor(i) == COLOR_PINK)

TzAkS.
08/05/2012, 01:27 PM
Use "i" instead of playerid

MichaelProPlayer
08/05/2012, 01:30 PM
Wow man thanks for that quick answer .... Never heard about " i "

Anyway +1 rep for both of you :D :D

TzAkS.
08/05/2012, 01:33 PM
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.

MichaelProPlayer
08/05/2012, 01:36 PM
Okay ... tnx :)

MP2
08/05/2012, 01:41 PM
'i' is just a variable name. Is it often used in for loops as i = 'iteration' (I think!)

MichaelProPlayer
08/05/2012, 01:49 PM
'i' is just a variable name. Is it often used in for loops as i = 'iteration' (I think!)

Okay +1rep for you too ... !