SA-MP Forums Archive
Problem with sscanf - 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: Problem with sscanf (/showthread.php?tid=349641)



Problem with sscanf - simon92922 - 09.06.2012

This is an example result string which is returned from mysql.

Would someone help me write my sscanf query please?

Result from MySQL:
Testing_Username|test|9999|10430|1|131.941955|-67.295921|1.578125|1204|1308|948|744

9999 = Money
10430 = Bank
1 = Level
131.941955 = X
-67.295921 = Y
1.578125 = Z
1204 = CarID1
1308 = CarID2
948 = HouseID
744 = GarageID

I need to adapt this to read all information from my database

The string below returns the Username, Password and Money perfectly but I'm unsure about how to code the others.

Код:
    sscanf(Query, "e<p<|>s[24]s[23]i>", PInfo[playerid]);
this is my PInfo stuff:

Код:
enum PlayerInfo
{
    Username[23],
    Password[24],
    Money,
    Bank,
    Level,
    Float:PosX,
    Float:PosY,
    Float:PosZ,
    CarID1,
    CarID2,
    HouseID,
    GarageID
}
new PInfo[MAX_PLAYERS][PlayerInfo];



Re: Problem with sscanf - CoaPsyFactor - 09.06.2012

sscanf(Query, "e<p<|>s[24]s[23]dddfffdddd>", PInfo[playerid]);
try this