Split() problem
#4

Quote:
Originally Posted by baske007
Посмотреть сообщение
-Bumpie-
Use Sscanf.
pawn Код:
enum vInfo
{
     Id,
     Float:x,Float:y,Float:z,Float:a,
} // Make sure the database is structured like this too. ID ( Auto inc. ) - x - y - z -a. otherwise it won't work.
new VehicleInfo[MAX_VEHICLE][vInfo];

forward LoadVehicles();
public LoadVehicles()
{
    for(new i; i < MAX_VEHICLES; i++)
    {
        new FetchLine[200];
        mysql_query("SELECT * FROM vehicles WHERE id = %d");
        mysql_store_result();
        if(mysql_fetch_row(FetchLine,"|"))
        {
            printf("%s", FetchLine); // Debugging......
            sscanf(FetchLine, "p<|>e<iffff>", VehicleInfo[i]);
            printf("%s", FetchLine); // Debugging......
        }
    }
}
Reply


Messages In This Thread
Split() problem - by baske007 - 27.10.2010, 18:28
Re: Split() problem - by baske007 - 27.10.2010, 18:52
Re: Split() problem - by baske007 - 28.10.2010, 07:39
Re: Split() problem - by Cameltoe - 28.10.2010, 08:08

Forum Jump:


Users browsing this thread: 1 Guest(s)