Params keep showing without working [sscanf]
#2

Actually a 'a' must be there when you use arrays.
From the sscanf tut
Код:
new
    arr[5];
sscanf("1 2 3 4 5", "a<s>[5]", arr);
Or remove that [32] and it will work and btw MAX_PLAYER_NAME is defined as 24.So instead of 32 you can use 24 and save some bytes.

Or this is even better and must be the best.

There is one more sscanf specifier "u" it will detect a playerid or a name(It finds out if it is a id or a name string) and return the id(better than strings).

From the sscanf tutorial by ******
Quote:
Originally Posted by ******
Specifier(s) Name Example values
i, d Integer 1, 42, -10
c Character a, o, *
l Logical true, false
b Binary 01001, 0b1100
h, x Hex 1A, 0x23
o Octal 045 12
n Number 42, 0b010, 0xAC, 045
f Float 0.7, -99.5
g IEEE Float 0.7, -99.5, INFINITY, -INFINITY, NAN, NAN_E
u User name/id (bots and players) ******, 0
q Bot name/id ShopBot, 27
r Player name/id ******, 42
Reply


Messages In This Thread
Params keep showing without working [sscanf] - by Black Axe - 02.05.2013, 14:49
Re: Params keep showing without working [sscanf] - by Yashas - 02.05.2013, 14:52
Re: Params keep showing without working [sscanf] - by Pottus - 02.05.2013, 14:57
Re: Params keep showing without working [sscanf] - by Black Axe - 02.05.2013, 15:06

Forum Jump:


Users browsing this thread: 3 Guest(s)