/w command
#1

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
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;
}
Reply


Messages In This Thread
/w command - by DarkLored - 29.03.2014, 22:04
Re: /w command - by Matess - 29.03.2014, 22:32
Re: /w command - by Brandon_More - 29.03.2014, 22:33
Re: /w command - by Calgon - 29.03.2014, 22:42
Re: /w command - by Konstantinos - 29.03.2014, 22:47

Forum Jump:


Users browsing this thread: 2 Guest(s)