03.05.2011, 16:35
Anny idea why doing so doesn't work?
And the define for CONSOLE is
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
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;
}
pawn Код:
#define CONSOLE(%0) \
if ( !strcmp( cmd, (%0), true, .length = strlen( (%0) ) ) )
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