sscanf warning: No default value found.
#1

Hello guys, i get this warning in server_log

Код:
sscanf warning: No default value found.
I don't know how to solve this problem, because when this message appears the server crash.
Reply
#2

you have a code like "I" not "i" or "I(7)".
Reply
#3

Quote:
Originally Posted by OneDay
Посмотреть сообщение
you have a code like "I" not "i" or "I(7)".
hmm. yea, you right, i have this command with S[128]
Код:
CMD:runmute(playerid, params[]) {
	if(!gPlayerLogged[playerid]) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to log in first.");
	if(IsPlayerConnected(playerid))
	{
		new id, reason[128];
		if(sscanf(params, "uS[128]", id, reason)) return SCM(playerid, COLOR_USAGE, "Usage:{FFFFFF} /runmute [playerid] [reason]");
		if(id != INVALID_PLAYER_ID) {

			if(PlayerInfo[id][pReportMuted] < 5) return SCM(playerid, -1, "This player doesn't have mute on /report.");

			PlayerInfo[id][pReportMuted] = 3;
			Update(id, pReportMutedx);

			SCMF(playerid, -1, "You have unmuted %s on /report, reason: %s", GetName(id), reason);

			format(gString, sizeof(gString), "AdmCmd: %s has unmuted %s on /report, reason: %s", GetName(playerid), GetName(id), reason);
			ABroadCast(COLOR_ADMCOMMANDS, gString, 1);

			SCMF(id, COLOR_LIGHTRED, "You have been unmuted on /report by Admin %s, reason: %s", GetName(playerid), reason);
		}
		else return SCM(playerid, COLOR_GREY, "Invalid player id.");
	}
	return 1;
}
but i have another command like this with U and D
Код:
if(sscanf(params, "s[64]U(-1)D(10)", list,id,lines))
and this work perfectly, what's wrong with first command?

or
Код:
if(sscanf(params, "uS(being solved)[128]", id, reason)) return SCM(playerid, -1, "Usage: /re [playerid] [reason]");
Reply
#4

The last code snipped you posted raises the same warning? It is in fact the correct syntax for optional string
Reply
#5

Quote:
Originally Posted by Misiur
Посмотреть сообщение
The last code snipped you posted raises the same warning? It is in fact the correct syntax for optional string
Nope, just the first code.

Thanks, i solve the problem with your help guys, thanks a lot.

I have another small question, about the same thing

When i use S with round brackets like S(default text)[64] or s(default text)[64] both are correct or only the first?
Reply
#6

Upper-case character means optional value for which you must provide default value in round brackets. Lowercase means required value, which does not accept default value.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)