02.01.2011, 18:03
pawn Код:
stock SendTeamMessage(color,const string[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) == 1) if(PlayerTeam[i] == PlayerTeam[playerid]) SendClientMessage(i, color, string);
}
return 1;
}
stock SendTeamMessage(color,const string[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) == 1) if(PlayerTeam[i] == PlayerTeam[playerid]) SendClientMessage(i, color, string);
}
return 1;
}
stock SendTeamMessage(playerid,color,const string[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) == 1) if(PlayerTeam[i] == PlayerTeam[playerid]) SendClientMessage(i, color, string);
}
return 1;
}
|
Well it's simple, playerid is not defined in that scope. You need to either define it or else change it where ever you are using it.
I'm not sure what you're trying to achieve though, but at a guess, I guess you want to send a message to all players in the same team as playerid? Well then you should add a playerid parameter to the SendTeamMessage stock. Like so: pawn Код:
|
SendTeamMessage(?,COLOR_CYAN,team_string);
SendTeamMessage(playerid,COLOR_CYAN,team_string);
|
Well who do you want to send it to? Do you want to send it to the persons team when he connects?
pawn Код:
|
if (PlayerTeam[playerid] == TEAM_JAPFLEET)
{
new string[128], name[28];
GetPlayerName(playerid, name, sizeof(name));
format(string,sizeof(string),"INFO: %s has turned into a spy and now he has the same color and skin of enemies, %s is still a team mate !",name, name);
SendTeamMessage(COLOR_CYAN,string);
IsSpy[playerid] = 1;
SetPlayerColor(playerid,TEAM_AIRFORCEC);
SetPlayerSkin(playerid,285);
return 1;
}
else
{
new string[128], name[28];
GetPlayerName(playerid, name, sizeof(name));
format(string,sizeof(string),"INFO: %s has turned into a spy and now he has the same color and skin of enemies, %s is still a team mate !",name, name);
SendTeamMessage(COLOR_CYAN,string);
IsSpy[playerid] = 1;
SetPlayerColor(playerid,TEAM_JAPFLEETC);
SetPlayerSkin(playerid,287);
return 1;
}
SendTeamMessage(playerid,COLOR_CYAN,string);