Mutliple Strings in Commands
#3

Quote:
Originally Posted by Kindred
Посмотреть сообщение
Just an example:

pawn Код:
CMD:duty(playerid, params[])
{
    new option[24];
    if(sscanf(params, "s[24]", option)) return SendClientMessage(playerid, -1, "Usage: /duty [job/faction]");
    if(!strcmp(option, "cop", true)) //If they  typed cop for the option
    {
        //Do something
    }
    else if(!strcmp(option, "taxi", true)) //If they  typed taxi for the option
    {
        //Do something
    }
    else return SendClientMessage(playerid, -1, "Incorrect option!");
    return 1;
}
Thanks for that, it was just what I was looking for!
Reply


Messages In This Thread
Mutliple Strings in Commands - by aintaro - 17.08.2012, 20:58
Re: Mutliple Strings in Commands - by Kindred - 17.08.2012, 21:03
Re: Mutliple Strings in Commands - by aintaro - 17.08.2012, 21:19

Forum Jump:


Users browsing this thread: 2 Guest(s)