It would be high appreciated
#2

I invite you to have a look at the tutorial section, look for commands + sscanf tutorials.

I'll give you an example:
pawn Code:
CMD:setcolor(playerid, params[])
{
    new id, colour;
   
    if (IsPlayerAdmin(playerid))
        SendClientMessage(playerid, -1, "SERVER: Unknown command.");
       
    else if (sscanf(params, "ud", id, colour))
        SendClientMessage(playerid, -1, "USAGE: /setcolor [ player id ] [ colour ]");
       
    else if (id == INVALID_PLAYER_ID)
        SendClientMessage(playerid, -1, "Requested player was not found!");
       
    else
    {
        SetPlayerColor(id, colour);
        SendClientMessage(playerid, COLOR_GREEN, "You succesfully changed the player's colour.");
    }
    return 1;
}
Reply


Messages In This Thread
It would be high appreciated - by saffierr - 16.07.2014, 00:50
Re: It would be high appreciated - by Miguel - 16.07.2014, 01:27
Re: It would be high appreciated - by BlackSirrah239 - 16.07.2014, 01:30
Re: It would be high appreciated - by saffierr - 16.07.2014, 02:33
Re: It would be high appreciated - by amirab - 16.07.2014, 02:43
Re: It would be high appreciated - by Miguel - 16.07.2014, 02:50

Forum Jump:


Users browsing this thread: 1 Guest(s)