[HELP] SSCANF 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] SSCANF problem (
/showthread.php?tid=212048)
[HELP] SSCANF problem -
viKKmaN - 16.01.2011
Hy, i am trying to retrieve multiple info from a string with sscanf.
Here's my code:
Код:
printf("%s", string);
sscanf(string, "i", id);
sscanf(string, "{i}s[32]iiis[16]", HouseInfo[id][hDescription], HouseInfo[id][hPrice], HouseInfo[id][hMoney], HouseInfo[id][hRent], HouseInfo[id][hOwner]);
printf("%s %d %d %d %s", HouseInfo[id][hDescription], HouseInfo[id][hPrice], HouseInfo[id][hMoney], HouseInfo[id][hRent], HouseInfo[id][hOwner]);
And this is what i get in console:
EX1:
Код:
1 8 Room Luxury 625000 0 0 The State
8 0 0 0 0 0 0 0 0
EX2:
Код:
2 3 Room Luxury 250000 0 0 The State
3 0 0 0 0 0 0 0 0
How can i fix this?
Re: [HELP] SSCANF problem -
viKKmaN - 16.01.2011
Fixed.