SA-MP Forums Archive
Sccanf parameters... ssiifffs... - 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: Sccanf parameters... ssiifffs... (/showthread.php?tid=424838)



Sccanf parameters... ssiifffs... - Limbo - 23.03.2013

Код:
enum pEnumInfo
{
	pName[24],
	pPass[24],
	pMoney,
	pSkin,
	Float:pX,
	Float:pY,
	Float:pZ,
	lastConnection[100]
}
Код:
sscanf(savingstring,"p<|>e<-s[24]-s[24]iifff-s[100]>", PlayerInfo[playerid]);
name-string
pass-string
pmoney int
pskin int
px-float
py-float
pz-float
lastconnection-string


px,py,pz is loaded correctly.. but i cant grab pmoney or pskin...


Re: Sccanf parameters... ssiifffs... - Scenario - 23.03.2013

Why are you adding dashes in the parameters line...?

Try this:

pawn Код:
sscanf(savingstring,"p<|>e<s[24]s[24]iifffs[100]>", PlayerInfo[playerid]);



Re: Sccanf parameters... ssiifffs... - Limbo - 23.03.2013

the db looks like this:

name-string
pass-string
pmoney int
pskin int
px-float
py-float
pz-float
lastconnection-string

and my enums are like this now

enum pEnumInfo
{
pMoney,
pSkin,
FloatX,
FloatY,
FloatZ,
}
Код:
sscanf(savingstring,"p<|>e<-s[24]-s[24]iifff-s[100]>", PlayerInfo[playerid]);
i put dashes cause i wanted to skip reading the strings and heard i can use "-". I still cant read the pmoney and pskin tho D:


Re: Sccanf parameters... ssiifffs... - Vince - 23.03.2013

If you want to skip a parameter you need to use braces {} around that parameter. Better still is only selecting the stuff you need.