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



sscanf warning: No default value found. - Pokemon64 - 12.12.2016

Код:
if(sscanf(params,"Sds",player,timer,priezastis))



Re: sscanf warning: No default value found. - Hansrutger - 12.12.2016

S needs to have () after it. Inside the ()-markers you place a default value. If none, then nothing placed inside it.

Код:
if(sscanf(params,"S()ds",player,timer,priezastis))
Any specifier captalized means that they are optional and/or has a default value. Not sure if it's the smartest to have the first value as optional but your choice!


Re: sscanf warning: No default value found. - Pokemon64 - 12.12.2016

Now
sscanf warning: Strings without a length are deprecated, please add a destination size.


Re: sscanf warning: No default value found. - Hansrutger - 12.12.2016

Probably because you decided to use two strings without defining how long they will be in one param-string.
https://sampforum.blast.hk/showthread.php?tid=570927

Right now your first string reads the whole params-string as you didn't set any length on it, meaning "d" (timer) and "s" (priezastis) will not really be read. Just guessing though, I might be wrong (especially about the S() reading the "d" part).


Re: sscanf warning: No default value found. - SickAttack - 12.12.2016

if(sscanf(params,"s[128]ds[128]",player,timer,priezastis))


Re: sscanf warning: No default value found. - Pokemon64 - 12.12.2016

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
if(sscanf(params,"s[128]ds[128]",player,timer,priezastis))
Works fine. Thanks.