Question about a command
#2

If you use sscanf, this is how it should be.

pawn Код:
CMD:setlevel(playerid,params[])
{
    new userid, level;
   
    if(sscanf(params, "ui", userid, level))
        return SendClientMessage(playerid, -1, "/setlevel [playerid/partofname] [level]");
       
    if(!IsPlayerConnected(userid))
        return SendClientMessage(playerid, -1, "The user is offline.");
       
    SetPlayerScore(userid, GetPlayerScore(userid)+level);
    SendClientMessage(playerid, COLOR_RED, "The level has been set.");
    return 1;
}
Reply


Messages In This Thread
Question about a command - by K9IsGodly - 02.01.2014, 17:40
Re: Question about a command - by GiamPy. - 02.01.2014, 17:46
Re: Question about a command - by Hansrutger - 02.01.2014, 17:47
Re: Question about a command - by K9IsGodly - 02.01.2014, 17:48
Re: Question about a command - by Hansrutger - 02.01.2014, 17:52
Re: Question about a command - by GiamPy. - 02.01.2014, 17:55
Re: Question about a command - by K9IsGodly - 02.01.2014, 17:55
Re: Question about a command - by GiamPy. - 02.01.2014, 17:59
Re: Question about a command - by K9IsGodly - 02.01.2014, 18:11

Forum Jump:


Users browsing this thread: 6 Guest(s)