sscanf warnings!
#1

I have these;
Код:
[17:24:00] sscanf warning: Format specifier does not match parameter count.
[17:24:00] sscanf warning: Format specifier does not match parameter count.
[17:24:00] sscanf warning: Format specifier does not match parameter count.
[17:24:00] sscanf warning: Format specifier does not match parameter count.
And I think its because I updated my sscanf to sscanf 2 or something and one of the CMD's thats causing one of these is:

Код:
CMD:givetokens(playerid, params[])
{
	new string[128], amount, giveplayerid;
	if(PlayerInfo[playerid][pAdmin] >= 4)
	{
 	if(sscanf(params, "ud", giveplayerid, amount)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givetokens [playerid] [amount]");

   	if(IsPlayerConnected(giveplayerid))
	{
		format(string, sizeof(string), "AdmCmd: %s has just given %s %i VIP Tokens.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), amount);
        ABroadCast(COLOR_LIGHTRED, string, 1);
		PlayerInfo[playerid][pVIPTokens] +=amount;
	}
	}
	else SendClientMessage(playerid, COLOR_WHITE, "You are not authorized to use this command!");
	return 1;
}
+rep if you can help ;/
Reply
#2

Your sscanf specifier is wrong
Reply
#3

and what is that?
Reply
#4

you sure it's that cmd causing the warning?

also: using latest include/plugin?
Reply
#5

Yes it is

and yes
Reply
#6

It is only a warning i think you may ignore it ? BTW... is the cmd working ? if yes, ignore warning if no, tell me
Reply
#7

Change :
pawn Код:
if(sscanf(params, "ud", giveplayerid, amount)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givetokens [playerid] [amount]");
into :

pawn Код:
if(sscanf(params, "us[60]", giveplayerid, amount))
    return SendClientMessage(playerid, COLOR_GREY, SYNTAX_MESSAGE"/givetokens[playerid] [amount]");
Reply
#8

Ah?? Amount = Numbers mate. d = Integer.

Edit: Here is the list.

Quote:

All specifiers

For quick reference, here is a list of ALL the specifiers and their use:


Code:
Format Use
L(true/false) Optional logical truthity
l Logical truthity
K<callback>(default text) Optional custom operator
k<callback> Custom operator
B(binary) Optional binary number
b Binary number
N(any format number) Optional number
n Number
C(character) Optional character
c Character
I(integer) Optional integer
i Integer
D(integer) Optional integer
d Integer
H(hex value) Optional hex number
h Hex number
O(octal value) Optional octal value
o Octal value
F(float) Optional floating point number
f Floating point number
G(float/INFINITY/-INFINITY/NAN/NAN_E) Optional float with IEEE definitions
g Float with IEEE definitions
{ Open quiet section
} Close quiet section
P<delimiter> Invalid delimiter change
p<delimiter> Delimiter change
Z(string)[length] Invalid optional string
z(string)[length] Deprecated optional string
S(string)[length] Optional string
s[length] String
U(name/id) Optional user (bot/player)
u User (bot/player)
Q(name/id) Optional bot (bot)
q Bot (bot)
R(name/id) Optional player (player)
r Player (player)
A<type>(default)[length] Optional array of given type
a<type>[length] Array of given type
E<specification>(default) Optional enumeration of given layout
e<specification> Enumeration of given layout
'string' Search string
% Deprecated optional specifier prefix

Taken from here
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)