SA-MP Forums Archive
My Server Problem - 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: My Server Problem (/showthread.php?tid=675682)



SSCANF Warning: Format specifier does not match parameter Count. - RainW - 18.05.2020

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"


Re: My Server Problem - Adamoneoone - 18.05.2020

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://sampforum.blast.hk/showthread.php?tid=574725


Re: My Server Problem - jasperschellekens - 18.05.2020

I'm sorry sir, my glass ball which I use to magically look into people's code has broken the other day.


Re: My Server Problem - RainW - 18.05.2020

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://sampforum.blast.hk/showthread.php?tid=574725
Sorted <3


Re: My Server Problem - GameOvr - 18.05.2020

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


Re: My Server Problem - RainW - 18.05.2020

seems , I'm using

[/code]#include <sscanf>[/code]
I will replace all sscanf to sscanf2 ?


Re: My Server Problem - RainW - 18.05.2020

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);
}



Re: My Server Problem - XStormiest - 18.05.2020

It should be, yes. But the thing is, you forgot to set 'arrayIndex' to 0.
Also, the sscanf part seems to be okay.


Re: My Server Problem - RainW - 19.05.2020

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;
	}
?


Re: My Server Problem - RainW - 19.05.2020

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 ?