SA-MP Forums Archive
[Help] +1 rep sscanf warning: No default value found - 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: [Help] +1 rep sscanf warning: No default value found (/showthread.php?tid=452416)



[Help] +1 rep sscanf warning: No default value found - Dister_Robi - 21.07.2013

Код:
	if(sscanf(params, "s[32]dD", choice, doorid, amount))
	{
		SendClientMessageEx(playerid, COLOR_GREY, "SUDUNG: /ddedit [name] [doorid] [amount]");
		SendClientMessageEx(playerid, COLOR_GREY, "Available names: Exterior, Interior, CustomInterior, CustomExterior, VIP");
		SendClientMessageEx(playerid, COLOR_GREY, "Family, Faction, Wanted, Admin, VehicleAble, Color, PickupModel, Delete");
		return 1;
	}
When i use this command, the text show up
Код:
[14:28:03] sscanf warning: No default value found.



Re: [Help] +1 rep sscanf warning: No default value found - IstuntmanI - 21.07.2013

You have to give a default value to D, which will make "amount" optional, let's say we want "amount" to be 10 if not specified:
pawn Код:
if(sscanf(params, "s[32]dD", choice, doorid, amount))
to
pawn Код:
if(sscanf(params, "s[32]dD(10)", choice, doorid, amount))
Also, you need to have 50 posts to give reputation.


Re: [Help] +1 rep sscanf warning: No default value found - Dister_Robi - 21.07.2013

Thanks, it work.