29.03.2014, 22:04
okay so i made my first whisper command
and when i use it, it sends the message to all players and not those who are near them
here is my code
and when i use it, it sends the message to all players and not those who are near them
here is my code
pawn Код:
CMD:w(playerid,params[])
{
new string[128];
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(sscanf(params,"s[128]",params))
{
SendClientMessage(playerid,COLOR_ERROR,"USAGE: /w (Message)");
return 1;
}
if(PlayerToPlayer(playerid, i, 10))
{
format(string,sizeof(string),"%s(%d) whispered : %s",GetName(playerid),playerid,params);
SendClientMessageToAll(COLOR_PURPLE,string);
return 1;
}
}
return 1;
}