PDA

View Full Version : error 017: undefined symbol "playerid"


Mriss
07/03/2014, 05:42 AM
forward SendMessageToCops(color, const string[]);
public SendMessageToCops(color,const string[]) //create the callback, including color and string
{
for(new i = 0; i < MAX_PLAYERS; i++) //set a for-loop and loop through all the cops
{
if(IsPlayerConnected(i) == 1) //the cop gotta be connected
if(gTeam[playerid] == TEAM_CIVILIAN) // You need to change this to whatever the cop var is
SendClientMessage(i, COLOR_GREEN, string); //send this message now to every cop online, with color + string!
}
return 1;
}
Title explains...

Hoborific
07/03/2014, 05:57 AM
forward SendMessageToCops(color, const string[]);
public SendMessageToCops(color,const string[]) //create the callback, including color and string
{
for(new i = 0; i < MAX_PLAYERS; i++) //set a for-loop and loop through all the cops
{
if(IsPlayerConnected(i) == 1) //the cop gotta be connected
if(gTeam[i] == TEAM_CIVILIAN) // You need to change this to whatever the cop var is
SendClientMessage(i, COLOR_GREEN, string); //send this message now to every cop online, with color + string!
}
return 1;
}


i is the variable emulating the playerid, if you can't fix this problem, I don't think you should be editing other peoples code.

Mriss
07/03/2014, 06:02 AM
umm, he said to edit it to our variables......

HK
07/03/2014, 06:10 AM
forward SendMessageToCops(playerid,color, const string[]);
public SendMessageToCops(playerid,color,const string[]) //create the callback, including color and string
{
for(new i = 0; i < MAX_PLAYERS; i++) //set a for-loop and loop through all the cops
{
if(IsPlayerConnected(i) == 1) //the cop gotta be connected
if(gTeam[i] == TEAM_CIVILIAN) // You need to change this to whatever the cop var is
SendClientMessage(i, COLOR_GREEN, string); //send this message now to every cop online, with color + string!
}
return 1;
}

try this pal

XK
07/03/2014, 06:17 AM
It has to be i not playerid

forward SendMessageToCops(playerid,color, const string[]);
public SendMessageToCops(playerid,color,const string[]) //create the callback, including color and string
{
for(new i = 0; i < MAX_PLAYERS; i++) //set a for-loop and loop through all the cops
{
if(IsPlayerConnected(i) == 1) //the cop gotta be connected
if(gTeam[i] == TEAM_CIVILIAN) // You need to change this to whatever the cop var is
SendClientMessage(i, COLOR_GREEN, string); //send this message now to every cop online, with color + string!
}
return 1;