mysql vehicles
#1

PHP код:
stock LoadVehicles() 
{
    new 
id;
    
mysql_format(sqldbquerysizeof(query), "SELECT * FROM vehicles");
    
mysql_query(sqldbquery);
    
mysql_store_result();
    
printf("Kocsik tцltйse..");
    while(
mysql_fetch_row("|"))
    {
        
id LoadedInfo[Vehicles];
        
sscanf(query"p<|>e<iis[30]s[30]iiiiffffii>"VehicleInfo[id]);
        
CreateVehicle(VehicleInfo[id][vModel],VehicleInfo[id][vX],VehicleInfo[id][vY],VehicleInfo[id][vZ],VehicleInfo[id][vR],VehicleInfo[id][vSzin1],VehicleInfo[id][vSzin2], 10);
        
SetVehicleNumberPlate(idVehicleInfo[id][vRendszam]);
        
LoadedInfo[Vehicles] = LoadedInfo[Vehicles] + 1;
    }

why dont spawn this the car? i call LoadVehicles(); in onplayerconnect

PHP код:
enum vInfo
{
    
vID,
    
vModel,
    
vRendszam[30],
    
vTulajdonos[30],
    vAr,
    
vUzemanyagTipus,
    
vUzemanyag,
    
vAllapot,
    
Float:vX,
    
Float:vY,
    
Float:vZ,
    
Float:vR,
    
vSzin1,
    
vSzin2

Reply
#2

anyone?
Reply
#3

First of all
pawn Код:
CreateVehicle(VehicleInfo[id][vModel],VehicleInfo[id][vX],VehicleInfo[id][vY],VehicleInfo[id][vZ],VehicleInfo[id][vR],VehicleInfo[id][vSzin1],VehicleInfo[id][vSzin2], 10);
That one is loaded as a string, and the coords aren't loaded at all?
Reply
#4

string? in a CreateVehicle? cord loaded az here: VehicleInfo[id][vX],VehicleInfo[id][vY],VehicleInfo[id][vZ]
Reply
#5

sscanf(query, "p<|>e<iis[30]s[30]iiiiffffii>", VehicleInfo[id]); see this?

You load the coords inside the CreateVehicle function and that function is loaded as a string, therefor you don't load any coords at all.
Reply
#6

uuhm, okey
Reply
#7

solved, thx
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)