20.03.2019, 20:03
PHP Code:
public OnPlayerText(playerid, text[])
{
new string[128], nomej[MAX_PLAYER_NAME];
GetPlayerName(playerid, nomej, sizeof(nomej));
switch(Profissao[playerid])
{
case 0: format(string, sizeof(string),"[Civil] %s [%d] diz: %s", nomej, playerid, text);
case 1 .. 2: format(string, sizeof(string),"[PolicialMilitar] %s [%d] diz: %s", nomej, playerid, text);
case 3 .. 4: format(string, sizeof(string),"[ComandoVermelho] %s [%d] diz: %s", nomej, playerid, text);
case 5 .. 6: format(string, sizeof(string),"[PCC] %s [%d] diz: %s", nomej, playerid, text);
case 7 .. 8: format(string, sizeof(string),"[ADMIN] %s [%d] diz: %s", nomej, playerid, text);
case 9 .. 10: format(string, sizeof(string),"[GrooveStreet] %s [%d] diz: %s", nomej, playerid, text);
}
for(new i; i < MAX_PLAYERS; i++) if(IsPlayerInRangeOfPoint(i, 10.0, Pos[0], Pos[1], Pos[2])) SendClientMessage(i, 0x00FF00AA, string);
// Foreach й melhor, caso use a include, substitua o
// for(new i; i < MAX_PLAYERS; i++)
// por: foreach(Player, i)
return 0;
}