sscanf ignore
#1

When i load stuff from tables, i use this:

pawn Код:
sscanf(query, "e<p<|>s[24]s[129]s[16]iii>", PlayerInfo[playerid]);
That gets the rows in that order from MySQL and puts them in PlayerInfo[playerid].
Well, i want to load only specific rows. Is there anyway to do this with sscanf?
Other ways i try seem to crash, what i basically want to do is make it ignore some things, e.g.:

"e<p<|>s[24]s[129]iffff>"

I'd want it to save the 2 strings, the floats, but ignore the integer and not save it.
Any way to do this?
Reply
#2

It depends on the plugin you are using, some mysql plugins have functions like "mysql_fetch_field", which allows you to "fetch" only specefic fields.

Strickenkid's plugin:
https://sampforum.blast.hk/showthread.php?tid=122983
Reply
#3

I think that if you wrap the integer in the "silent mode" (using {i}) it might work. Sscanf will still verify the data integrity, but will not store it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)