PHP код:
CMD:r(playerid, params[])
{
new
string[144];
format(string, sizeof(string), "%s: %s", GetPlayerName(playerid), params);
SendPlayerMessage(playerid, 20.0, string, 0xAFAFAFAA, 0xAFAFAFAA, 0xAFAFAFAA, 0xAFAFAFAA, 0xAFAFAFAA);
return 1;
}
SendPlayerMessage(playerid, Float:radius, const text[], color1, color2, color3, color4, color5)
{
foreach(new i : Player)
{
if(IsPlayerInAnyVehicle(i))
{
if(IsNearPlayer(i, playerid, radius / 16))
{
SendClientMessage(i, color1, text);
}
else if(IsNearPlayer(i, playerid, radius / 8))
{
SendClientMessage(i, color2, text);
}
else if(IsNearPlayer(i, playerid, radius / 4))
{
SendClientMessage(i, color3, text);
}
else if(IsNearPlayer(i, playerid, radius / 2))
{
SendClientMessage(i, color4, text);
}
else if(IsNearPlayer(i, playerid, radius))
{
SendClientMessage(i, color5, text);
}
}
}
}
IsNearPlayer(playerid, targetid, Float:radius)
{
new
Float:x,
Float:y,
Float:z;
GetPlayerPos(targetid, x, y, z);
if(IsPlayerInRangeOfPoint(playerid, radius, x, y, z) && GetPlayerInterior(playerid) == GetPlayerInterior(targetid) && GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(targetid))
{
return 1;
}
return 0;
}
Something like this, if im not wrong.