28.04.2012, 03:29
Replace your whole OnPlayerText with this:
and make sure you have the foreach plugin by ****** and have
at the top of your script.
pawn Код:
public OnPlayerText(playerid, text[])
{
if(GetPlayerWantedLevel(playerid) > 0)
{
new string[128], playersName[MAX_PLAYER_NAME];
GetPlayerName(playerid, playersName, sizeof(playersName));
foreach(new i: Player)
{
if(gTeam[playerid] == Team_Civi)
{
format(string, sizeof(string), "%s{FFFFFF}: %s", playersName, text);
}
else if(gTeam[playerid] == Team_Cop)
{
format(string, sizeof(string), "[WANTED] %s{FFFFFF}: %s", playersName, text);
}
SendClientMessage(i, GetPlayerColor(playerid), string);
}
return 0;
}
else
{
return 1;
}
}
pawn Код:
#include <foreach>