sscanf warnings
#1

Hello everyone,
I've encountered those sscanf warnings on my server log and I have no idea how to fix it.
It happens when I use this command in game, can you please tell me how to solve this problem?

Thanks

Код:
CMD:adjust(playerid, params[])
{
	if(PlayerInfo[playerid][pFMember] == INVALID_FAMILY_ID)
	{
		SendClientMessageEx(playerid, COLOR_GREY, "You aren't in a family.");
		return 1;
	}
	new family = PlayerInfo[playerid][pFMember];
	new string[128], file[32], month, day, year;
	getdate(year,month,day);
	if(PlayerInfo[playerid][pRank] >= 5)
	{
		new choice[32], opstring[100];
		if(sscanf(params, "s[32]S[100]", choice, opstring))
		{
			SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /adjust [name]");
			SendClientMessageEx(playerid, COLOR_WHITE, "Available Names: Name, Safe");
			return 1;
		}

		if(strcmp(choice,"name",true) == 0)
		{
			if(PlayerInfo[playerid][pRank] == 6)
			{
				if(!opstring[0])
				{
					SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /adjust name [family name]");
					return 1;
				}
				if(strfind(opstring, "|", true) != -1)
				{
					SendClientMessageEx(playerid, COLOR_GRAD2,  "You can't use '|' in a family name.");
					return 1;
				}
				if(strlen(opstring) >= 40 )
				{
					SendClientMessageEx( playerid, COLOR_GRAD1, "That family name is too long, please refrain from using more than 40 characters." );
					return 1;
				}
				strmid(FamilyInfo[family][FamilyName], opstring, 0, strlen(opstring), 100);
				SaveFamilies();
				SendClientMessageEx(playerid, COLOR_WHITE, "You've adjusted your family's name.");
				format(string, sizeof(string), "%s adjusted %s's name to %s", GetPlayerNameEx(playerid), FamilyInfo[family][FamilyName], opstring);
				format(file, sizeof(file), "family_logs/%d/%d-%02d-%02d.log", family, year, month, day);
				Log(file, string);
			}
		}
		else if(strcmp(choice,"safe",true) == 0)
		{
			if(PlayerInfo[playerid][pRank] == 6)
			{
				SendClientMessageEx(playerid, COLOR_GRAD1, "Adjusting your Family Safe will reset all your safe stats.");
				SendClientMessageEx(playerid, COLOR_GRAD1, "If you want to adjust your safe, type /adjust confirm.");
				SendClientMessageEx(playerid, COLOR_GRAD1, "Upgrading your family safe will cost $50,000.");
				return 1;
			}
		}
		else if(strcmp(choice,"confirm",true) == 0)
		{
			if(PlayerInfo[playerid][pRank] == 6)
			{
				if(GetPlayerCash(playerid) < 50000)
				{
					SendClientMessageEx(playerid, COLOR_GRAD1, "You don't have $50,000 to upgrade your family safe.");
					return 1;
				}
				GivePlayerCash(playerid, -50000);
				GetPlayerPos(playerid, FamilyInfo[family][FamilySafe][0], FamilyInfo[family][FamilySafe][1], FamilyInfo[family][FamilySafe][2]);
				FamilyInfo[family][FamilySafeVW] = GetPlayerVirtualWorld(playerid);
				FamilyInfo[family][FamilySafeInt] = GetPlayerInterior(playerid);
				FamilyInfo[family][FamilyCash] = 0;
				FamilyInfo[family][FamilyMats] = 0;
				FamilyInfo[family][FamilyPot] = 0;
				FamilyInfo[family][FamilyCrack] = 0;
				if(FamilyInfo[family][FamilyUSafe]) DestroyDynamicPickup(FamilyInfo[family][FamilyPickup]);
				FamilyInfo[family][FamilyUSafe] = 1;
				FamilyInfo[family][FamilyPickup] = CreateDynamicPickup(1239, 23, FamilyInfo[family][FamilySafe][0], FamilyInfo[family][FamilySafe][1], FamilyInfo[family][FamilySafe][2], .worldid = FamilyInfo[family][FamilySafeVW], .interiorid = FamilyInfo[family][FamilySafeInt]);
				SaveFamilies();
				SendClientMessageEx(playerid, COLOR_WHITE, "You've adjusted your family's Safe.");
				format(string, sizeof(string), "%s adjusted %s's safe", GetPlayerNameEx(playerid), FamilyInfo[family][FamilyName]);
				format(file, sizeof(file), "family_logs/%d/%d-%02d-%02d.log", family, year, month, day);
				Log(file, string);
			}
		}
	}
	else
	{
		SendClientMessageEx(playerid, COLOR_GREY, "   You do not have a high enough rank to use this command!");
		return 1;
	}
	return 1;
Код:
sscanf warning: No default value found.
sscanf warning: Unknown format specifier '[', skipping.
sscanf warning: Unknown format specifier '1', skipping.
sscanf warning: Unknown format specifier '0', skipping.
sscanf warning: Unknown format specifier '0', skipping.
sscanf warning: Unknown format specifier ']', skipping.
sscanf warning: Format specifier does not match parameter count.
Reply


Messages In This Thread
sscanf warnings - by roncohen7 - 25.07.2017, 09:18
Re: sscanf warnings - by Kane - 25.07.2017, 09:31
Re: sscanf warnings - by iLearner - 25.07.2017, 09:46
Re: sscanf warnings - by roncohen7 - 25.07.2017, 09:50
Re: sscanf warnings - by iLearner - 25.07.2017, 09:51
Re: sscanf warnings - by jlalt - 25.07.2017, 09:56
Re: sscanf warnings - by roncohen7 - 27.07.2017, 09:47

Forum Jump:


Users browsing this thread: 4 Guest(s)