Problem with sscanf
#1

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];
Reply
#2

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


Forum Jump:


Users browsing this thread: 1 Guest(s)