12.02.2018, 11:55
I have a radio system which uses something similar to what you want.
The person who executes the code will see a blue radio message, and the persons next to him will see it in a orange rp message.
I hope this helped you:
Note: This will not completely work for you. edit it.
The person who executes the code will see a blue radio message, and the persons next to him will see it in a orange rp message.
I hope this helped you:
PHP код:
for(new a=0;a<MAX_PLAYERS;a++)
if(PlayerInfo[a][LawDuty]>=1) // This means if players are on law enforcement duty. you got to change this.
{
SendClientMessage(a,BLUE,str); // send message to the player who executes the script.
}
new Float:x, Float:y, Float:z, string[100]; // self explenary
GetPlayerPos(playerid, x, y, z); // same as above
for(new i=0; i<GetMaxPlayers(); i++) // loop trough players
{
if(IsPlayerInRangeOfPoint(i, 20.00, x, y, z)) // ifplayer is in range of the person who executed the script.
{
format(string,sizeof(string),"%s(%i) (radio): %s",PlayerName(playerid),playerid,text);
if(PlayerInfo[i][LawDuty]==0) // when the person is not on Law Enforcement duty, he will get a orange rp message
{
SendClientMessage(i, ORANGE, string);
}
}
}