/w command
#5

Why do you use sscanf line inside the loop? If you type "/w", then it will send the usage message many times (as many as MAX_PLAYERS is defined). You don't even need sscanf for it.

pawn Код:
CMD:w(playerid, params[])
{
    if (isnull(params)) return SendClientMessage(playerid, COLOR_ERROR, "USAGE: /w (Message)");
   
    new
        string[128],
        Float: px,
        Float: py,
        Float: pz;
     
    format(string, sizeof (string), "%s(%d) whispered : %s", GetName(playerid), playerid, params);
    GetPlayerPos(playerid, px, py, pz);
    for (new i; i != MAX_PLAYERS; ++i) // foreach(new i : Player)
    {
        if (IsPlayerInRangeOfPoint(i, 10.0, px, py, pz)) SendClientMessage(i, COLOR_PURPLE, string);
    }
    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: 1 Guest(s)