SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 13/08/2017, 06:50 AM   #1
skiplovebra
Huge Clucker
 
Join Date: Sep 2015
Posts: 230
Reputation: 0
Default sscanf warning: Format specifier does not match parameter count.

help me please
Code:
CMD:batgiam(playerid, params[])
{
	if(!IsACop(playerid)) SendClientMessageEx(playerid, COLOR_GREY, "Ban khong phai la LEO faction. ");
	else if(!IsAtArrestPoint(playerid, 2)) SendClientMessageEx(playerid, COLOR_GREY, "Ban khong o diem bat giu tai DOC." );

	else
	{
   		new
     		moneys,
       		time,
			string[256];

        new suspect = GetClosestPlayer(playerid);
  		if(sscanf(params, "dddd", moneys, time)) SendClientMessageEx(playerid, COLOR_GREY, "SU DUNG: /batgiam [fine] [minutes]");
		else if(!(1 <= moneys <= 250000)) SendClientMessageEx(playerid, COLOR_GREY, "Phat tien ngoi tu khong duoi $1 va tren $250,000.");
		else if(!(1 <= time <= 70)) SendClientMessageEx(playerid, COLOR_GREY, "Thoi gian ngoi tu khong duoi 1 va tren 70 phut - co the dua nguoi do toi tu de co them thoi gian giam giu.");
		else if(!IsPlayerConnected(suspect)) SendClientMessageEx(playerid, COLOR_GREY, "nguoi choi khong hop le.");
		else if(!ProxDetectorS(5.0, playerid, suspect)) SendClientMessageEx(playerid, COLOR_GREY, "Ban phai o gan nghi pham.");
		else if(PlayerInfo[suspect][pWantedLevel] < 1 && PlayerInfo[playerid][pMember] != 12) SendClientMessageEx(playerid, COLOR_GREY, "Nguoi do phai co it nhat 1 cap do truy na");
		else {
			SetPVarInt(playerid, "Arrest_Price", moneys);
			SetPVarInt(playerid, "Arrest_Time", time);
			SetPVarInt(playerid, "Arrest_Suspect", suspect);
			SetPVarInt(playerid, "Arrest_Type", 2);
			format(string, sizeof(string), "Hay viet mot bao cao ngan gon ve viec bat giu %s va nhung hanh dong do.\n\nBao cao phai co it nhat 30 ki tu va nhieu nhat la 128 ki tu.", GetPlayerNameEx(suspect));
			ShowPlayerDialog(playerid, DIALOG_ARRESTREPORT, DIALOG_STYLE_INPUT, "Bao cao bat giu", string, "Gui di", "");
	    }
	}
	return 1;
}
skiplovebra is offline   Reply With Quote
Old 13/08/2017, 06:59 AM   #2
Arthur Kane
Gangsta
 
Join Date: Sep 2012
Location: Los Angeles
Posts: 680
Reputation: 93
Default Re: sscanf warning: Format specifier does not match parameter count.

Code:
if(sscanf(params, "dddd", moneys, time))
You have 4 specifiers. Only two defined.
Arthur Kane is online now   Reply With Quote
Old 13/08/2017, 07:13 AM   #3
skiplovebra
Huge Clucker
 
Join Date: Sep 2015
Posts: 230
Reputation: 0
Default Re: sscanf warning: Format specifier does not match parameter count.

Quote:
Originally Posted by Arthur Kane View Post
Code:
if(sscanf(params, "dddd", moneys, time))
You have 4 specifiers. Only two defined.

How do I fix it?
skiplovebra is offline   Reply With Quote
Old 13/08/2017, 07:27 AM   #4
FailerZ
Huge Clucker
 
FailerZ's Avatar
 
Join Date: Oct 2013
Location: 33.5138 N, 36.2765 E
Posts: 225
Reputation: 22
Default Re: sscanf warning: Format specifier does not match parameter count.

Remove two of them
Code:
if(sscanf(params, "dd", moneys, time))
__________________
[FilterScript]Digital Health & Armour [DHA]
[FilterScript]Labels Creator [LC]
[FilterScript]Debug Mode [D-Mode]
[FilterScript]Advance Fish System [AFS]
FailerZ is offline   Reply With Quote
Old 13/08/2017, 07:29 AM   #5
NewFreeroamStunt
Big Clucker
 
NewFreeroamStunt's Avatar
 
Join Date: May 2017
Location: Indonesia
Posts: 82
Reputation: 2
Default Re: sscanf warning: Format specifier does not match parameter count.

try this

Code:
if(sscanf(params, "dd", moneys, time))
__________________


45.32.107.45:7777

NewFreeroamStunt is offline   Reply With Quote
Old 13/08/2017, 07:30 AM   #6
skiplovebra
Huge Clucker
 
Join Date: Sep 2015
Posts: 230
Reputation: 0
Default Re: sscanf warning: Format specifier does not match parameter count.

Thanks for the forum I love forum.sa-mp.com
skiplovebra is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
sscanf warning: Format specifier does not match parameter count. DavidSparks Scripting Help 22 20/01/2015 10:25 PM
sscanf warning: Format specifier does not match parameter count. UserName31 Scripting Help 11 18/01/2015 01:19 PM
sscanf warning: Format specifier does not match parameter count. Greaper Scripting Help 2 18/05/2014 06:55 PM
sscanf warning format specifier does not match parameter count ZBits Scripting Help 2 24/01/2013 07:45 AM
sscanf warning: Format specifier does not match parameter count. Guitar Scripting Help 9 22/08/2012 08:40 PM


All times are GMT. The time now is 12:16 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.