Loading SQL Vehicles (how to?)
#1

Basically, I got it so it saves the vehicles... But I'm not sure how to make it load them.
Its in the table vehicles and it has ID ( Auto Incromment ), model, col1, col2, x, y, z, angle.

Thanks!
Reply
#2

Do something similar to this:
[PAWN]
//Top of script
#define MAX_CAR_FROM_DB 300
new carids[MAX_CAR_FROM_DB];

pawn Код:
mysql_query("SELECT * FROM vehicles");
mysql_store_result();
new row[500], id;
while(mysql_retrieve_row())
{
        mysql_fetch_row(row);
        id++;
        sscanf(row, "....", ....);
        carids[id] = AddStaticVehicle(...);  
}
mysql_free_result();
Use that as a template.
Reply
#3

Quote:
Originally Posted by [HiC]TheKiller
Посмотреть сообщение
Do something similar to this:
[PAWN]
//Top of script
#define MAX_CAR_FROM_DB 300
new carids[MAX_CAR_FROM_DB];

pawn Код:
mysql_query("SELECT * FROM vehicles");
mysql_store_result();
new row[500], id;
while(mysql_retrieve_row())
{
        mysql_fetch_row(row);
        id++;
        sscanf(row, "....", ....);
        carids[id] = AddStaticVehicle(...);  
}
mysql_free_result();
Use that as a template.
How do I make it fetch all the positions and such?
What do you do with the sscanf?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)