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),SendClientMessageToAll(-1, string);}
case 1 .. 2:{format(string, sizeof(string),"[PolicialMilitar] %s [%d] diz: %s", nomej, playerid, text),SendClientMessageToAll(0x00FFFFAA, string);}
case 3 .. 4:{format(string, sizeof(string),"[ComandoVermelho] %s [%d] diz: %s", nomej, playerid, text),SendClientMessageToAll(0xFF0000AA, string);}
}
return 0;
}
PHP Code:
public OnPlayerText(playerid, text[])
{
new string[128], nomej[MAX_PLAYER_NAME];
GetPlayerName(playerid, nomej, sizeof(nomej));
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x,y,z);
switch(Profissao[playerid])
{
foreach(Player, i)
{
if(IsPlayerInRangeOfPoint(i, 20, x,y,z))
{
case 0:{format(string, sizeof(string),"[Civil] %s [%d] diz: %s", nomej, playerid, text),SendClientMessageToAll(-1, string);}
case 1 .. 2:{format(string, sizeof(string),"[PolicialMilitar] %s [%d] diz: %s", nomej, playerid, text),SendClientMessageToAll(0x00FFFFAA, string);}
case 3 .. 4:{format(string, sizeof(string),"[ComandoVermelho] %s [%d] diz: %s", nomej, playerid, text),SendClientMessageToAll(0xFF0000AA, string);}
}
}
}
return 0;
}