How can i do this?
#1

How can i use sscanf in this:

pawn Код:
CMD:test(playerid, params[])
{
if(strcmp(params, "test1", true) == 0)
{
return 1;
}
return SendClientMessage(playerid, COLOR_RED, "Usage: /test [option]");
}
I tried:

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]");
}
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?
Reply


Messages In This Thread
How can i do this? - by Torran - 01.05.2010, 14:32
Re: How can i do this? - by M4S7ERMIND - 01.05.2010, 14:45
Re: How can i do this? - by Torran - 01.05.2010, 14:48
Re: How can i do this? - by M4S7ERMIND - 01.05.2010, 15:24

Forum Jump:


Users browsing this thread: 1 Guest(s)