Information on ssanf.
#1

Is there a way to use a space in ssanf without adding 2 strings?

Example:
pawn Код:
if(sscanf(params,"s", Name))return SendClientMessage(playerid, 0xFF0000AA, "Usage: /bla [name]");
That would just let me type /bla Tee (No space. 1 string) . Is there way to use a space in it like (/bla Tee Tee) instead of using 2 strings or 2 different commands?
Reply
#2

If you use it as you have it now, the second option will work because it is still a string. However, if you're using sscanf 2.0 you have to specify a string lenth in the option, like so:
pawn Код:
if(sscanf(params, "s[24]", Name)) return SendClientMessage(playerid, 0xFF0000AA, "Usage: /bla [name]");
Reply
#3

So you are saying that if i use sscanf 2.0 i can use the command and type /bla Tee Tee with 1 string.

If i use the command below and i type /bla Tee Tee i would get the return.

pawn Код:
if(sscanf(params,"s", Name))return SendClientMessage(playerid, 0xFF0000AA, "Usage: /bla [name]");
But if i use your command below, i will not get the return telling me i can just use 1 string?

pawn Код:
if(sscanf(params, "s[24]", Name)) return SendClientMessage(playerid, 0xFF0000AA, "Usage: /bla [name]");
Reply
#4

No matter which version of sscanf you're using it should still work.

If you're using sscanf 2.0 the first version will not work because you have to have the length, 24 characters in this case.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)