09.07.2016, 09:46
When I use /w(hisper) it goes e.g [WHISPER]Testbot: hi, but when someone else uses it it will still do [WHISPER]Testbot: theremessage, it wont load there name, why?
PHP код:
CMD:whisper(playerid, params[])
{
new string[250];
if (sscanf(params, "s[250]", string))return SendClientMessage(playerid, COLOR_YELLOW, "[COMMAND] {FFFFFF}Usage: /w(hisper) [message]");
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
new string2[250];
new name[MAX_PLAYER_NAME];
new id;
GetPlayerName(id,name,sizeof(name));
format(string2, sizeof(string2), "{D526D9}[WHISPER] {FFFFFF}%s(%i): %s", name, playerid, string);
for(new i = 0; i <= MAX_PLAYERS; i++)
{
if(IsPlayerInRangeOfPoint(i, 15.0, x, y, z))
{
SendClientMessage(i, COLOR_WHITE, string2);
}
}
return 1;
}