07.06.2016, 09:32
PHP код:
CMD:w(playerid, params[])
{
if(isnull(params)) return SendClientMessage(playerid, COLOR_SEAGREEN, "Usage: /w(hisper) [message]");
new string[150], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(string, sizeof string, "'%s whispers' %s %s", pName, string, params);
SendRangeMessage(playerid, -1, string, 20.0);
return 1;
}
PHP код:
stock SendRangeMessage(playerid, COLOR, const text[], Float:range)
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
for(new i = GetPlayerPoolSize()+1; --i!=-1;)
{
if(!IsPlayerConnected(i) || IsPlayerNPC(i) || !IsPlayerInRangeOfPoint(i, range, X, Y, Z)) continue;
SendClientMessage(i, COLOR, text);
}
return 1;
}