01.05.2010, 14:32
How can i use sscanf in this:
I tried:
When i type /test test1
It shows that usage
But when i type /test test1 5
It shows the Usage: /test [option]
How would i do it properly?
pawn Код:
CMD:test(playerid, params[])
{
if(strcmp(params, "test1", true) == 0)
{
return 1;
}
return SendClientMessage(playerid, COLOR_RED, "Usage: /test [option]");
}
pawn Код:
CMD:test(playerid, params[])
{
if(strcmp(params, "test1", true) == 0)
{
if(sscanf(params, "i", test) return SendClientMessage(playerid, COLOR_RED, "Usage: /test test1 [seconds]");
return 1;
}
return SendClientMessage(playerid, COLOR_RED, "Usage: /test [option]");
}
It shows that usage
But when i type /test test1 5
It shows the Usage: /test [option]
How would i do it properly?