SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 18/05/2020, 01:49 PM   #1
RainW
Little Clucker
 
RainW's Avatar
 
Join Date: Aug 2019
Posts: 38
Reputation: 0
Default SSCANF Warning: Format specifier does not match parameter Count.

https://imgur.com/a/YFzmEHC

Please Help me.

Code:
SSCANF Warning: Format specifier does not match parameter Count.
Code:
ERROR: Could not connect to YSI
Update server (response was 301).
"I'm using sscanf2"
RainW is offline   Reply With Quote
Old 18/05/2020, 01:56 PM   #2
Adamoneoone
Huge Clucker
 
Join Date: Sep 2014
Posts: 496
Reputation: 37
Default Re: My Server Problem

Honestly do you think a bunch of errors will magically help us fix your code?
Did you ever try to fix errors without anything shown? Maybe you have some powers which allows you to guess other people's code, but I don't think this is the case with most people here.
https://forum.sa-mp.com/showthread.php?t=574725
__________________
If you want to have your own custom script, or even want to have one of our already released scripts, join our SCRIPTING SERVICES DISCORD, or send me a private message!
Adamoneoone is offline   Reply With Quote
Old 18/05/2020, 01:57 PM   #3
jasperschellekens
High-roller
 
jasperschellekens's Avatar
 
Join Date: Dec 2016
Location: Holland
Posts: 1,070
Reputation: 106
Default Re: My Server Problem

I'm sorry sir, my glass ball which I use to magically look into people's code has broken the other day.
__________________
If you want to have your own custom script, or even want to have one of our already released scripts, join our SCRIPTING SERVICES DISCORD, or send me a private message!


Undead Wasteland Roleplay - The year is 1996. San Andreas is a wasteland ruled by the undead. the once so glorius landscape of San Andreas, is now a shattered decayed place that is only a vague memory of the world as we used to know it.
Discord - Website
jasperschellekens is offline   Reply With Quote
Old 18/05/2020, 02:07 PM   #4
RainW
Little Clucker
 
RainW's Avatar
 
Join Date: Aug 2019
Posts: 38
Reputation: 0
Default Re: My Server Problem

Quote:
Originally Posted by Adamoneoone View Post
Honestly do you think a bunch of errors will magically help us fix your code?
Did you ever try to fix errors without anything shown? Maybe you have some powers which allows you to guess other people's code, but I don't think this is the case with most people here.
https://forum.sa-mp.com/showthread.php?t=574725
Sorted <3
RainW is offline   Reply With Quote
Old 18/05/2020, 02:15 PM   #5
GameOvr
Huge Clucker
 
GameOvr's Avatar
 
Join Date: Jun 2018
Posts: 298
Reputation: 9
Default Re: My Server Problem

Error says it all, at some places where you have used sscanf like sscanf(... , ... , ...);
The parameter count doesnt match with specifier.

For example,
pawn Code:
sscanf(str, "ii", val);
//or
sscanf(str, "i", val, val_2);
You can clearly see what's wrong no. of specifiers inside quotes does not match with the parameter count(val ... )

Look for smth like that in your code
__________________
GameOvr is online now   Reply With Quote
Old 18/05/2020, 02:49 PM   #6
RainW
Little Clucker
 
RainW's Avatar
 
Join Date: Aug 2019
Posts: 38
Reputation: 0
Default Re: My Server Problem

seems , I'm using

[/code]#include <sscanf>[/code]
I will replace all sscanf to sscanf2 ?
RainW is offline   Reply With Quote
Old 18/05/2020, 02:57 PM   #7
RainW
Little Clucker
 
RainW's Avatar
 
Join Date: Aug 2019
Posts: 38
Reputation: 0
Default Re: My Server Problem

is this correct?

Code:
LoadThePay()
{

	new sz_FacPayStr[128], File: i_FileHandle, arrayIndex;

	#define PAY_FILE "factionpay.cfg"

	if(!fexist(PAY_FILE)) return 1; // Why create a file when you're trying to load?

	i_FileHandle = fopen(PAY_FILE, io_read);
	while (arrayIndex < sizeof(FactionPay))
	{
		fread(i_FileHandle, sz_FacPayStr);
		sscanf(sz_FacPayStr, "p<|>iiiiiii",
			FactionPay[arrayIndex][0],
			FactionPay[arrayIndex][1],
			FactionPay[arrayIndex][2],
			FactionPay[arrayIndex][3],
			FactionPay[arrayIndex][4],
			FactionPay[arrayIndex][5],
			FactionPay[arrayIndex][6]);
		arrayIndex++;
	}
	return fclose(i_FileHandle);
}
RainW is offline   Reply With Quote
Old 18/05/2020, 05:52 PM   #8
XStormiest
Gangsta
 
Join Date: Jun 2012
Location: Continent: Europe, Country: Romania, City: Buzau
Posts: 558
Reputation: 46
Default Re: My Server Problem

It should be, yes. But the thing is, you forgot to set 'arrayIndex' to 0.
Also, the sscanf part seems to be okay.
__________________
XStormiest is offline   Reply With Quote
Old 19/05/2020, 07:44 AM   #9
RainW
Little Clucker
 
RainW's Avatar
 
Join Date: Aug 2019
Posts: 38
Reputation: 0
Default Re: My Server Problem

Quote:
Originally Posted by XStormiest View Post
It should be, yes. But the thing is, you forgot to set 'arrayIndex' to 0.
Also, the sscanf part seems to be okay.
Like This ?

Code:
{
		fread(i_FileHandle, sz_FacPayStr);
		sscanf(sz_FacPayStr, "p<|>iiiiiii",
			FactionPay[arrayIndex][0],
			FactionPay[arrayIndex][1],
			FactionPay[arrayIndex][2],
			FactionPay[arrayIndex][3],
			FactionPay[arrayIndex][4],
			FactionPay[arrayIndex][5],
			FactionPay[arrayIndex][6]);
		arrayIndex, 0;
	}
?
RainW is offline   Reply With Quote
Old 19/05/2020, 07:46 AM   #10
RainW
Little Clucker
 
RainW's Avatar
 
Join Date: Aug 2019
Posts: 38
Reputation: 0
Default Re: My Server Problem

Quote:
Originally Posted by XStormiest View Post
It should be, yes. But the thing is, you forgot to set 'arrayIndex' to 0.
Also, the sscanf part seems to be okay.
Can you give me Example ?
RainW is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't start the server, mysql problem ? [Windows hosted server] Kelzano Server Support 3 19/05/2017 01:10 AM
Problem opening a SA:MP server on Windows Server 2012 R2 GodLight Server Support 6 26/10/2016 02:52 PM
Problem on joining the server on samp server. Player985 Client Support 9 09/01/2014 12:56 AM
Problem with my server. Bought the server on hrvatski-hosting.com dynetictrinity Server Support 1 29/10/2012 09:55 PM
[SOLVED] Server Problem. Server not visible for friends. Juanxz Server Support 0 26/01/2010 08:34 AM


All times are GMT. The time now is 04:53 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.