sscanf problem
#6

Here's an example:
pawn Код:
CMD:gedit(playerid, params[])
{
    new option[128], gateid;
    if(sscanf(params, "s[128]i", option, gateid))
    {
        SendClientMessage(playerid, COLOR_WHITE, "USAGE: /gedit [option] [gateid]");
        SendClientMessage(playerid, COLOR_GREY, "OPTIONS: object | close | open | speed | password");
        return 1;
    }

    if(strcmp(option, "object", true) == 0)
    {
        // Code...
    }
    else if(strcmp(option, "close", true) == 0)
    {
        // Code...
    }
    else if(strcmp(option, "open", true) == 0)
    {
        // Code...
    }
    else if(strcmp(option, "speed", true) == 0)
    {
        // Code...
    }
    else if(strcmp(option, "password", true) == 0)
    {
        // Code...
    }
    else
    {
        SendClientMessage(playerid, COLOR_WHITE, "USAGE: /gedit [option] [gateid]");
        SendClientMessage(playerid, COLOR_GREY, "OPTIONS: object | close | open | speed | password");
    }
    return 1;
}
And I suggest that you leave the issue on the main post for future issues which are similar to yours.
Reply


Messages In This Thread
sscanf problem - by kepa333 - 23.03.2015, 18:52
Re: sscanf problem - by Ciarannn - 23.03.2015, 18:57
Re: sscanf problem - by kepa333 - 23.03.2015, 19:04
Re: sscanf problem - by Ciarannn - 23.03.2015, 19:06
Re: sscanf problem - by kepa333 - 23.03.2015, 19:35
Re: sscanf problem - by SickAttack - 23.03.2015, 22:50

Forum Jump:


Users browsing this thread: 2 Guest(s)