cmd /id error , I need Solution
#2

If you're not yet using sscanf by ******, then I suggest you start using it. There's a specifier for usernames or player IDs which is "u", for example:

pawn Код:
command(id, playerid, params[])
{
    if(IsPlayerConnected(playerid))
    {
        new id;
       
        if(sscanf(params, "u", id))
            return SendClientMessage(playerid, -1, "SYNTAX: /id [playerid/PartOfName]");
           
        if(IsPlayerConnected(id))
        {
            SendClientMessage(playerid, -1, "Player is online");
        }
        else SendClientMessage(playerid, -1, "Player is not connected!");
    }
    return 1;
}
From the example, I used ZCMD and as you can see the specifier "u" detects either the player's partial name or id.
Reply


Messages In This Thread
cmd /id error , I need Solution - by Ivander - 31.08.2013, 02:12
Re: cmd /id error , I need Solution - by Skribblez - 31.08.2013, 02:37
Re: cmd /id error , I need Solution - by Emmet_ - 31.08.2013, 04:18
Re: cmd /id error , I need Solution - by Ivander - 31.08.2013, 04:31
Re: cmd /id error , I need Solution - by Ivander - 31.08.2013, 04:34
Re: cmd /id error , I need Solution - by Skribblez - 31.08.2013, 04:58
Re: cmd /id error , I need Solution - by mahardika - 31.08.2013, 04:58
Re: cmd /id error , I need Solution - by Ivander - 31.08.2013, 05:19
Re: cmd /id error , I need Solution - by mahardika - 31.08.2013, 05:22
Re: cmd /id error , I need Solution - by viveka27 - 31.08.2013, 05:40

Forum Jump:


Users browsing this thread: 2 Guest(s)