SA-MP Forums Archive
sscanf warning: Format specifier does not match parameter count. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: sscanf warning: Format specifier does not match parameter count. (/showthread.php?tid=508702)



sscanf warning: Format specifier does not match parameter count. - bustern - 23.04.2014

How can i fix this ?Everytime i use my command this shows in server logs and the command is little bugged cause this
CMD:
PHP код:
if(sscanf(params"uis[64]"playerbslotcarsellingtoplayerprice)) return SendClientMessage(playeridCOLOR_WHITE"[Usage]: /sellmybusiness [playerid] [slot] [price]"); 
And everytime it gives random numbers for carsellingtoplayerprice


Re: sscanf warning: Format specifier does not match parameter count. - Konstantinos - 23.04.2014

Price should be integer and not a string.


Re: sscanf warning: Format specifier does not match parameter count. - AroseKhanNiazi - 23.04.2014

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Price should be integer and not a string.
as he said
PHP код:
if(sscanf(params"uii[64]"playerbslotcarsellingtoplayerprice)) return SendClientMessage(playeridCOLOR_WHITE"[Usage]: /sellmybusiness [playerid] [slot] [price]"); 



Re: sscanf warning: Format specifier does not match parameter count. - Konstantinos - 23.04.2014

Quote:
Originally Posted by AroseKhanNaizi
Посмотреть сообщение
as he said
PHP код:
if(sscanf(params"uii[64]"playerbslotcarsellingtoplayerprice)) return SendClientMessage(playeridCOLOR_WHITE"[Usage]: /sellmybusiness [playerid] [slot] [price]"); 
The lenght in brackets is for strings so you've to remove it.

pawn Код:
new playerb, slot, carsellingtoplayerprice;
if(sscanf(params, "uii", playerb, slot, carsellingtoplayerprice)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /sellmybusiness [playerid] [slot] [price]");



Re: sscanf warning: Format specifier does not match parameter count. - bustern - 23.04.2014

Thanks


Re: sscanf warning: Format specifier does not match parameter count. - AroseKhanNiazi - 23.04.2014

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
The lenght in brackets is for strings so you've to remove it.

pawn Код:
new playerb, slot, carsellingtoplayerprice;
if(sscanf(params, "uii", playerb, slot, carsellingtoplayerprice)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /sellmybusiness [playerid] [slot] [price]");
lol i did it once but when i remove the html code and changed it to php code for better colors forget to remove it