Vechicle system
#6

Go back over and re-read the post, it tells you how the data is selected through the function and assigned by the SSCANF 'e' enum parameter.

This is what you're looking for back in the post, this is how the data is selected and assigned.
PHP код:
stock LoadVehicles() // You might want to make this an public so you could call it on an timer.
{
    new 
Query[255], id;
    
format(Querysizeof(Query), "SELECT * FROM vehicles"); // Formats the query for "mysql_query"
    
mysql_query(Query); // Querys the "Query" Variable.
    
mysql_store_result(); // Stores the result from Query
    
while(mysql_fetch_row(Query,"|")) // Splits the row
    
{
        
id LoadedInfo[Vehicles];
        
sscanf(Query"p<|>e<is[25]iiffff>"VehicleInfo[id]); // Pretty neat ehh? [ ID, OWNER, MODEL, PRICE, POS X, POS Y, POS Z, POS A ]
        
new Color1 random(126); new Color2 random(126);
        
CreateVehicle(VehicleInfo[id][Model],VehicleInfo[id][Pos][X],VehicleInfo[id][Pos][Y],VehicleInfo[id][Pos][Z],VehicleInfo[id][Pos][R],Color1,Color260*10000);
        
LoadedInfo[Vehicles] = LoadedInfo[Vehicles] + 1;
    }

- Firewire
Reply


Messages In This Thread
Vechicle system - by cristip - 29.06.2013, 20:39
Re: Vechicle system - by Vince - 29.06.2013, 20:46
Re: Vechicle system - by cristip - 29.06.2013, 21:30
Re: Vechicle system - by Firewire - 29.06.2013, 21:35
Re: Vechicle system - by cristip - 29.06.2013, 21:41
Re: Vechicle system - by Firewire - 29.06.2013, 21:52
Re: Vechicle system - by cristip - 29.06.2013, 22:14
Re: Vechicle system - by Firewire - 29.06.2013, 22:33
Re: Vechicle system - by cristip - 29.06.2013, 22:47

Forum Jump:


Users browsing this thread: 2 Guest(s)