error 017: 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: error 017: undefined symbol "playerid" (
/showthread.php?tid=499203)
error 017: undefined symbol "playerid" -
Mriss - 07.03.2014
pawn Код:
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...
Re: error 017: undefined symbol "playerid" -
Hoborific - 07.03.2014
pawn Код:
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.
Re: error 017: undefined symbol "playerid" -
Mriss - 07.03.2014
umm, he said to edit it to our variables......
Re: error 017: undefined symbol "playerid" -
HK - 07.03.2014
pawn Код:
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
Re: error 017: undefined symbol "playerid" -
XK - 07.03.2014
It has to be i not playerid
pawn Код:
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;