SA-MP Forums Archive
sscanf warning - 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: sscanf warning (/showthread.php?tid=649628)



sscanf warning - jasperschellekens - 12.02.2018

I have noticed the following warnings on the server log:


Код:
[17:27:36] Remon_Blom has changed Jasper_Corleone's warrant setting.
[17:27:39] Remon_Blom has changed Jasper_Corleone's FAD setting.
[17:27:56] sscanf warning: Format specifier does not match parameter count.
[17:31:55] [part] Remon_Blom has left the server (2:1)
[17:34:22] sscanf warning: Format specifier does not match parameter count.
[17:34:29] sscanf warning: Format specifier does not match parameter count.
[17:34:30] sscanf warning: Format specifier does not match parameter count.
What is causing this?


Re: sscanf warning - iKarim - 12.02.2018

This could be due to this:

PHP код:
sccanf(input"iii"var1var2); 
I specified 3 integers but I actually passed only 2 as arguments.


Re: sscanf warning - jasperschellekens - 12.02.2018

Quote:
Originally Posted by iKarim
Посмотреть сообщение
This could be due to this:

PHP код:
sccanf(input"iii"var1var2); 
I specified 3 integers but I actually passed only 2 as arguments.
Thanks for your response. The thing is, i dont use sscanf like that at the part where the warning occured.
The warning only occurs when you change someones FAD setting(firearmdangerous).

code:
PHP код:
new file[64], SearchOnPlayerMDC[50];
        
format(SearchOnPlayerMDCsizeof(SearchOnPlayerMDC), "%s"MDC[playerid][MDCPlayerSelected]);
        
format(filesizeof(file), "Accounts/%s.ini"SearchOnPlayerMDC);
        
MDCfad[playerid] = INI_Int(file"FAD");
        if(
MDCfad[playerid]==1)
        {
            
TextDrawHideForPlayer(playerid,PoliceComputerSPTD23);
            
TextDrawHideForPlayer(playerid,PoliceComputerSPTD24);
            
TextDrawHideForPlayer(playerid,PoliceComputerSPTD25);
            
MDCad[playerid] = 0;
        }
        else if(
MDCfad[playerid]==0)
        {
             
TextDrawShowForPlayer(playerid,PoliceComputerSPTD23);
            
TextDrawShowForPlayer(playerid,PoliceComputerSPTD24);
            
TextDrawShowForPlayer(playerid,PoliceComputerSPTD25);
           
MDCfad[playerid] = 1;
        }
        
INI_IntSet(file,"FAD"MDCfad[playerid]);
        
PlayerPlaySound(playerid,6400,0.0,0.0,0.0);
        
printf("%s has changed %s's FAD setting."GetName(playerid), MDC[playerid][MDCPlayerSelected]);
        return 
1
Is it related to changing FAD or is it elsewhere?


Re: sscanf warning - iKarim - 12.02.2018

It is from somewhere else, there's no sscanf calls on this code at all.


Re: sscanf warning - PepsiCola23 - 12.02.2018

maybe it`s from the cmd that changes the warrant setting?


Re: sscanf warning - Mugala - 12.02.2018

figure out when and which case is this problem is happening and than trace the code.


Re: sscanf warning - jasperschellekens - 12.02.2018

Quote:
Originally Posted by Mugala
Посмотреть сообщение
figure out when and which case is this problem is happening and than trace the code.
Quote:
Originally Posted by jasperschellekens
Посмотреть сообщение
The warning only occurs when you change someones FAD setting(firearmdangerous).
Quote:
Originally Posted by PepsiCola23
Посмотреть сообщение
maybe it`s from the cmd that changes the warrant setting?
The warrant setting is actually not a cmd but also a textdraw.

Really confused of this.


Re: sscanf warning - Sew_Sumi - 12.02.2018

Just because it's appearing there, doesn't necessarily mean it's actually that.

It is after 2 minutes of the person who changed the setting logging off... I'd say look at other things. Like, don't get tunnel vision, and add in more debug printfs and such.