SSCANF warnings
#1

well, can anyone tell how can I get rid of these warnings? :

Код:
[22:00:17] sscanf warning: Format specifier does not match parameter count.
[22:00:17] sscanf warning: Format specifier does not match parameter count.
[22:00:17] sscanf warning: Format specifier does not match parameter count.
[22:00:17] sscanf warning: Format specifier does not match parameter count.
[22:00:17] sscanf warning: Format specifier does not match parameter count.
[22:00:17] sscanf warning: Format specifier does not match parameter count.
[22:00:17] sscanf warning: Format specifier does not match parameter count.
[22:00:17] sscanf warning: Format specifier does not match parameter count.
[22:00:17] sscanf warning: Format specifier does not match parameter count.
[22:00:17]   Filterscript 'ObjectEditor_Bani.amx' loaded.
[22:00:22] [cmd] [Bani_Raheja] /objifno
[22:00:55] sscanf warning: Strings without a length are deprecated, please add a destination size.
[22:00:55] sscanf warning: No default value found.
[22:00:55] sscanf warning: No default value found.
[22:00:55] sscanf warning: Format specifier does not match parameter count.
[22:01:00] sscanf warning: Strings without a length are deprecated, please add a destination size.
[22:01:00] sscanf warning: No default value found.
[22:01:00] sscanf warning: Strings without a length are deprecated, please add a destination size.
[22:01:00] sscanf warning: No default value found.
[22:01:00] sscanf warning: Format specifier does not match parameter count.
[22:01:03] sscanf warning: Strings without a length are deprecated, please add a destination size.
[22:01:03] sscanf warning: No default value found.
[22:01:03] sscanf warning: No default value found.
[22:01:03] sscanf warning: Format specifier does not match parameter count.
[22:01:44] RCON (In-Game): Player [Bani_Raheja] sent command: reloadfs ObjectEditor_Bani
[22:01:44]   Filterscript 'ObjectEditor_Bani.amx' unloaded.
[22:01:44] 
--------------------------------------
[22:01:44]          <Object System™ (v. 1.0 )>           
[22:01:44]   		© Bani Raheja    
[22:01:44] --------------------------------------

[22:01:44]   Filterscript 'ObjectEditor_Bani.amx' loaded.
[22:01:47] [cmd] [Bani_Raheja] /tod 12
[22:01:51] sscanf warning: No default value found.
[22:01:51] sscanf warning: No default value found.
[22:01:51] sscanf warning: Unknown format specifier '[', skipping.
[22:01:51] sscanf warning: Unknown format specifier '6', skipping.
[22:01:51] sscanf warning: Unknown format specifier '4', skipping.
[22:01:51] sscanf warning: Unknown format specifier ']', skipping.
[22:01:51] sscanf warning: Format specifier does not match parameter count.
[22:01:55] sscanf warning: No default value found.
[22:01:55] sscanf warning: Unknown format specifier '[', skipping.
[22:01:55] sscanf warning: Unknown format specifier '6', skipping.
[22:01:55] sscanf warning: Unknown format specifier '4', skipping.
[22:01:55] sscanf warning: Unknown format specifier ']', skipping.
[22:01:55] sscanf warning: No default value found.
[22:01:55] sscanf warning: Unknown format specifier '[', skipping.
[22:01:55] sscanf warning: Unknown format specifier '6', skipping.
[22:01:55] sscanf warning: Unknown format specifier '4', skipping.
[22:01:55] sscanf warning: Unknown format specifier ']', skipping.
[22:01:55] sscanf warning: Format specifier does not match parameter count.
[22:02:16] sscanf warning: No default value found.
[22:02:16] sscanf warning: No default value found.
Here is the script code...

Код:
CMD:command(playerid, params[])
{
	if(Admin[playerid] >= 4 || Dev[playerid] > 0)
	{
		new model[64], model2[64],name2[24];
		new string[128], string2[128];
		if(sscanf(params, "s[128]S[64]S[64]",string, model, model2))
		{
			SendClientMessage(playerid, COLOR_WHITE, "USAGE: /objedit [name]");
			SendClientMessage(playerid, COLOR_GRAD1, "Available Names: ID, position, positionm, speed, range, vw, int, delete, model, newid, manual, password");
			return 1;
		}
		if(strcmp(string, "ID", true) == 0)
		{
			if(!model[0]) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /objedit ID [objectid]");
			if(ObjectInfo[strval(model)][gPosX] == 0.0 && ObjectInfo[strval(model)][gPosY] == 0.0 && ObjectInfo[strval(model)][gPosZ] == 0.0 && ObjectInfo[strval(model)][gModel] == 0) return SendClientMessage(playerid, COLOR_WHITE, " That object ID has not been created yet!");
			EditingObject[playerid] = strval(model);
			format(string2, sizeof(string2), " You are editing object ID %d now!", strval(model));
			SendClientMessage(playerid, COLOR_WHITE, string2);
			GetPlayerNameEx(playerid, name2, sizeof(name2));
			format(ObjectInfo[EditingObject[playerid]][gLastEdit], 24, name2);
			return 1;
		}
		else if(strcmp(string, "password", true) == 0)
		{
			if(strlen(model) > 32)
			{
				SendClientMessage(playerid, COLOR_GRAD2, " Password cannot be greater than 32 characters! ");
				return 1;
			}
			format(string, sizeof(string), "Object Password for object %d changed to %s", EditingObject[playerid], model);
			format(ObjectInfo[EditingObject[playerid]][gPass], 24, "%s", model);
			SendClientMessage(playerid, COLOR_GRAD2, string);
			GetPlayerNameEx(playerid, name2, sizeof(name2));
			format(ObjectInfo[EditingObject[playerid]][gLastEdit], 24, name2);
			SaveObjects();
			return 1;
		}
	}
}
Reply
#2

Anyone?
Reply
#3

You didn't specify a default value for your optional string parameters. Read the sscanf topic for how to add these!
Reply
#4

https://sampforum.blast.hk/showthread.php?tid=120356

All warnings are here.
Reply
#5

well, how to add it lol? how to add default value?
Reply
#6

Well, honestly, I cannot understand that why do I receive this warning
Код:
 [22:00:17] sscanf warning: Format specifier does not match parameter count.
from this code
Код:
if(sscanf(params, "s[32]S[32]S[32]",string, model, model2))
Reply
#7

Well, I used S with a purpose. I want it to be optional specifier
Reply
#8

Well, I already read it. I still cant understand that how to set default value for strings? I know that we have to use brackets, but where? After the string size or before it ?

just tell me how can I fix this?

Код:
if(sscanf(params, "s[32]S[32]S[32]",string, model, model2))
Reply
#9

Well, I already read it. I still cant understand that how to set default value for strings? I know that we have to use brackets, but where? After the string size or before it ?

just tell me how can I fix this?

Код:
if(sscanf(params, "s[32]S[32]S[32]",string, model, model2))
Reply
#10

Okay, I have fixed the problem, can you tell that the "Format Specifier does not match parameter count" is a bug? And if yes, then how to fix it?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)