sscanf format specifier
#1

Hello, I get this error when I open my server. What can I do to fix?


Reply
#2

Quote:
Originally Posted by fuem1907
Посмотреть сообщение
Hello, I get this error when I open my server. What can I do to fix?


Show your OnGameModeInit public, please
Reply
#3

this is what you need?

Reply
#4

"Format specifier does not match parameter count" means that you have more or less parameters than specified.

This code will cause the same error:
Код:
sscanf(string, "ii", integer1, integer2, integer3);
Because there are more parameters (3 in total) than there are specifiers ("ii" are the specifiers, there are only two of them).
Reply
#5

Thing is there are bunch of sscanf parameters. Anyway to find it quickly?

Example: I got these

if(sscanf(params, "iI(-1)I(-1)", iVehicle, iColors[0], iColors[1]))




sscanf(szFileStr, "p<|>iis[8]s[24]ffffffiiiiiffd",
BusinessInfo[iIndex][bOwned],
BusinessInfo[iIndex][bLevel],
BusinessInfo[iIndex][bDescription],
BusinessInfo[iIndex][bOwner],
BusinessInfo[iIndex][bExteriorX],
BusinessInfo[iIndex][bExteriorY],
BusinessInfo[iIndex][bExteriorZ],
BusinessInfo[iIndex][bInteriorX],
BusinessInfo[iIndex][bInteriorY],
BusinessInfo[iIndex][bInteriorZ],
BusinessInfo[iIndex][bLock],
BusinessInfo[iIndex][bPrice],
BusinessInfo[iIndex][bPickupID],
BusinessInfo[iIndex][bCustomInterior],
BusinessInfo[iIndex][bCustomExterior],
BusinessInfo[iIndex][bExteriorA],
BusinessInfo[iIndex][bInteriorA],
BusinessInfo[iIndex][bInt]


is that wrong?
Reply
#6

I don't think that's the wrong one. Try posting all of the sscanf functions used near the server launch (OnGameModeInit, OnFilterScriptInit etc..), maybe we can find the one which is causing this trouble.
Reply
#7

What about the error that is shown in the picture? Could not connect to YSI update server thing? And what happens If I run my server like this? with those errors?
Reply
#8

On server launch, YSI tries to connect to ******' website to check for updates. If it could connect, it'll report if an update is released. If it couldn't connect, it'll report this. It doesn't have any effect on your server, it just reports if there are any updates. Don't worry about it.
Reply
#9

Lol thanks, finally, about the parameter warnings, does it effects how my server works or anything?
Reply
#10

It might affect the scripts where the problem-causing sscanf is located. Other sscanf-functions will still work fine, but the error-reporting one might not get the information properly saved into the variables. My suggestion is to debug every sscanf with 'print' and/or 'printf' to find the one which is causing these errors.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)