Console command.
#1

Anny idea why doing so doesn't work?

pawn Код:
new
        Player, P2;
    CONSOLE("!setlevel")
    {
        if ( !sscanf( cmd, "dd", Player, P2 ) )
        {
            if ( IsPlayerConnected( Player ) )
            {
                P_DATA[ Player ][ Level ] = P2;
                printf(" >>> You made %s %s of the server! (Level: %d)", Name( Player ), LevelName( P2 ), Player );
            }else PrintError("Player not connected!");
        }else PrintError("Invalid Syntax");
        return 1;
    }
And the define for CONSOLE is
pawn Код:
#define CONSOLE(%0) \
    if ( !strcmp( cmd, (%0), true, .length = strlen( (%0) ) ) )
I mean, what I'm talking about is the sscanf! I can't get it working, even though the code looks alright.

Now, for your information:
I tried even "ud" and was the same result, BUT! When i use "{u}dd" works, any idea why?


For example, using the code above, when i type !setlevel 0 1 it gives me the Invalid Syntax error, when i do in sscanf like "{u}dd" works and gives the right values and all.

Why does it work only when i use quiet sections?


PS: Of course it goes under OnRconCommand
Reply


Messages In This Thread
Console command. - by Zh3r0 - 03.05.2011, 16:35
Re: Console command. - by MadeMan - 03.05.2011, 16:45
Re: Console command. - by Zh3r0 - 03.05.2011, 16:49
Re: Console command. - by MadeMan - 03.05.2011, 16:52
Re: Console command. - by Zh3r0 - 03.05.2011, 17:03

Forum Jump:


Users browsing this thread: 1 Guest(s)