PDA

View Full Version : Weird annoying error! HELP


Threshold
01/12/2012, 06:45 AM
Hello,
Im having this error in my server log. I cant find out whats causing it or where its coming from.
I get a code stack of these right here.

[00:44:51] sscanf warning: Format specifier does not match parameter count.

Please reply a way to fix this or something for me to do to find out whats causing it so i can fix it. Also the sscanf is uptodate.

[MM]RoXoR[FS]
01/12/2012, 06:59 AM
In any of the sscanf command you specified an extra or a less specifier that the other.

new a,b,c;
sscanf(string,"ss",a,b,c);//Here 2 specifiers and 3 parameters.. Hence the warning
sscanf(string,"sss",a,b);//3 specifier and 2 parameter also lead to warning

Threshold
01/12/2012, 07:07 AM
MD:pm(playerid, params[])
{
new str[256], str2[256], id, Name1[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME];
if(sscanf(params, "us[512]", id, str2))
{
SendClientMessage(playerid, 0xFF0000FF, "{FF0000}[USAGE]: {FFFFFF}/PM (PlayerID) (Message)");
return 1;
}
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFF0000FF, "{FF0000}[SERVER]: {FFFFFF}Player Is Not Connected!");
if(playerid == id) return SendClientMessage(playerid, 0xFF0000FF, "{FF0000}[USAGE]: {FFFFFF}You Cannot PM Yourself!");
{
GetPlayerName(playerid, Name1, sizeof(Name1));
GetPlayerName(id, Name2, sizeof(Name2));
format(str, sizeof(str), ">> PM To %s(ID %d): %s", Name2, id, str2);
SendClientMessage(playerid, 0xFF0000FF, str);
format(str, sizeof(str), ">> PM From %s(ID %d): %s", Name1, playerid, str2);
SendClientMessage(id, 0xFF0000FF, str);
}
return 1;
}

CMD:teleports(playerid, params[])
{
new string[1000];
strcat(string, "\n{00FFFF}======== -( Drifts )- ========\n{FFFF00}- /drifthill\n- /drift1-[53]\n- /prodrift\n- /circle1-[8]\n- /oceandrift\n{00FFFF}======== -( Cities )- ========\n{FFFF00}- /sf\n- /ls\n- /lv");
strcat(string, "\n{00FFFF}======== -( Airports )- ========\n{FFFF00}- /lsa\n- /lva\n- /sfa\n{00FFFF}======== -( Races )- ========\n{FFFF00}- /drag\n");
strcat(string, "{00FFFF}======== -( Parkour )- ========\n{FFFF00}- /nrgparkour\n{00FFFF}======== -( Stunts )- ========\n{FFFF00}- /stuntpark\n- /halfpipe\n{00FFFF}======== -( Tuning )- ========\n{FFFF00}- /arch\n- /fender\n- /loco");
ShowPlayerDialog(playerid, 27, DIALOG_STYLE_MSGBOX, "Server Teleports", string, "Okay", "");
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
return 1;
}

I dont see where your coming from, Heres one of my sscanf commands. If you can tell me whats wrong here .. Please.

P.S - Please bro, Please i beg u add me on skype i have some Scripting questions, Please. dario_keic

[MM]RoXoR[FS]
01/12/2012, 07:11 AM
in first one you gave 512 as size in specifier while size is 256 in parameter

MD:pm(playerid, params[])
{
new str[256], str2[256], id, Name1[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME];
if(sscanf(params, "us[256]", id, str2))//here
{
SendClientMessage(playerid, 0xFF0000FF, "{FF0000}[USAGE]: {FFFFFF}/PM (PlayerID) (Message)");
return 1;
}
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFF0000FF, "{FF0000}[SERVER]: {FFFFFF}Player Is Not Connected!");
if(playerid == id) return SendClientMessage(playerid, 0xFF0000FF, "{FF0000}[USAGE]: {FFFFFF}You Cannot PM Yourself!");
{
GetPlayerName(playerid, Name1, sizeof(Name1));
GetPlayerName(id, Name2, sizeof(Name2));
format(str, sizeof(str), ">> PM To %s(ID %d): %s", Name2, id, str2);
SendClientMessage(playerid, 0xFF0000FF, str);
format(str, sizeof(str), ">> PM From %s(ID %d): %s", Name1, playerid, str2);
SendClientMessage(id, 0xFF0000FF, str);
}
return 1;
}

Threshold
01/12/2012, 07:14 AM
Yeo, Please add me on skype. If you have one. I am kindly willing to pay for you to debug my script. If kindly possible. Add me dario_keic

[MM]RoXoR[FS]
01/12/2012, 07:19 AM
not possible now coz i dont have pc right now

Threshold
01/12/2012, 07:21 AM
Dang it! Also my friend told me this is correct for my /mytime command! Please check if its correct -

COMMAND:mytime(playerid, params[])
{
new time;
if(sscanf(params, "i[time]", time)) return SendClientMessage(playerid, -1, "{FF0000}[USAGE]: {FFFFFF}/mytime [Time]");
if(time > 24 || time < 0) return SendClientMessage(playerid, -1, "{FF0000}[SERVER]: {FFFFFF}Invalid Time! Choose Another!");
SetPlayerTime(playerid,time,0);
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
return 1;
}

[MM]RoXoR[FS]
01/12/2012, 07:27 AM
Wrong


COMMAND:mytime(playerid, params[])
{
new time;//Time is not an array.
if(sscanf(params, "i", time)) return SendClientMessage(playerid, -1, "{FF0000}[USAGE]: {FFFFFF}/mytime [Time]");
if(time > 24 || time < 0) return SendClientMessage(playerid, -1, "{FF0000}[SERVER]: {FFFFFF}Invalid Time! Choose Another!");
SetPlayerTime(playerid,time,0);
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
return 1;
}

Threshold
01/12/2012, 07:41 AM
I still get that error.

Threshold
01/12/2012, 07:48 AM
Can this warning crash my server? ....