How can i create command like this.
#4

Use sscanf.

Example:
pawn Код:
CMD:sethealth(playerid,params[])
{
    if(pInfo[playerid][Admin] < 2) return error
    new user,health;
    if(sscanf(params,"ud",user,health)) return SendClientMessage(playerid,COLOR_LIGHTBLUE,"SYNTAX:/sethealth [playerid] [health]");
    if(user == INVALID_PLAYER_ID) return invalid
    SetPlayerHealth(user,health);
    return 1;
}
If you need any help, pm me.
Reply


Messages In This Thread
How can i create command like this. - by Gangster-rocks - 28.08.2012, 10:59
Re: How can i create command like this. - by Smokkr - 28.08.2012, 11:01
Re: How can i create command like this. - by Gangster-rocks - 28.08.2012, 11:03
Re: How can i create command like this. - by C00K13M0N$73R - 28.08.2012, 11:04
Re: How can i create command like this. - by Benzke - 28.08.2012, 11:04
Re: How can i create command like this. - by Gangster-rocks - 28.08.2012, 11:08
Re: How can i create command like this. - by Gangster-rocks - 28.08.2012, 11:16
Re: How can i create command like this. - by Lordzy - 28.08.2012, 11:30

Forum Jump:


Users browsing this thread: 2 Guest(s)