sscanf warning: Format specifier does not match parameter count.
#1

help me please
Код:
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;
}
Reply
#2

Код:
if(sscanf(params, "dddd", moneys, time))
You have 4 specifiers. Only two defined.
Reply
#3

Quote:
Originally Posted by Arthur Kane
Посмотреть сообщение
Код:
if(sscanf(params, "dddd", moneys, time))
You have 4 specifiers. Only two defined.
How do I fix it?
Reply
#4

Remove two of them
Код:
if(sscanf(params, "dd", moneys, time))
Reply
#5

try this

Код:
if(sscanf(params, "dd", moneys, time))
Reply
#6

Thanks for the forum I love forum.sa-mp.com
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)