Vehicle issue
#1

Alright so the problem is simple, the script is loading only some vehicles, not all of them, in most cases it loads like 5 cars
PHP код:
public OnVehicleLoad()
{
    new 
rowsfields;
    
cache_get_data(rowsfieldsmysql);
      for(new 
0rowsi++)
    {
        new 
vehicleid CreateVehicle(cache_get_field_content_int(i,"ModelID"), cache_get_field_content_float(i,"PosX"),cache_get_field_content_float(i,"PosY"),cache_get_field_content_float(i,"PosZ"),cache_get_field_content_float(i,"PosA"),cache_get_field_content_int(i,"Color1"),cache_get_field_content_int(i,"Color2"),0,0);
        
VehInfo[vehicleid][VehMasterID] = cache_get_field_content_int(i,"MasterID");
        
VehInfo[vehicleid][VID] = cache_get_field_content_int(i,"ID");
        
VehInfo[vehicleid][ModelID] = cache_get_field_content_int(i,"ModelID");
        
VehInfo[vehicleid][Color1] = cache_get_field_content_int(i,"Color1");
        
VehInfo[vehicleid][Color2] = cache_get_field_content_int(i,"Color2");
        
VehInfo[vehicleid][VehPosX] = cache_get_field_content_float(i,"PosX");
        
VehInfo[vehicleid][VehPosY] = cache_get_field_content_float(i,"PosY");
        
VehInfo[vehicleid][VehPosZ] = cache_get_field_content_float(i,"PosZ");
        
VehInfo[vehicleid][VehPosA] = cache_get_field_content_float(i,"PosA");
        
VehInfo[vehicleid][VRespawnTime] = cache_get_field_content_int(i,"RespawnTime");
        
VehInfo[vehicleid][VPrice] = cache_get_field_content_int(i,"Price");
        
VehInfo[vehicleid][DamageStatus] = cache_get_field_content_float(i,"Damage");
        
VehInfo[vehicleid][FuelStatus] = cache_get_field_content_int(i,"FuelStatus");
        
VehInfo[vehicleid][EngineStatus] = cache_get_field_content_int(i,"EngineStatus");
        
VehInfo[vehicleid][Kilometrage] = cache_get_field_content_float(i,"Kilometrage");
        
VehInfo[vehicleid][vSiren] = cache_get_field_content_int(i,"Siren");
        
VehInfo[vehicleid][vOwned] = cache_get_field_content_int(i,"Owned");
        
VehInfo[vehicleid][VehWorld] = cache_get_field_content_int(i,"VirtualWorld");
        
VehInfo[vehicleid][VehInterior] = cache_get_field_content_int(i,"Interior");
        
SetVehicleVirtualWorld(vehicleid,VehInfo[vehicleid][VehWorld]);
        
LinkVehicleToInterior(vehicleid,VehInfo[vehicleid][VehInterior]);
        
SetVehiclePos(vehicleid,VehInfo[vehicleid][VehPosX],VehInfo[vehicleid][VehPosY],VehInfo[vehicleid][VehPosZ]);
        
SetVehicleZAngle(vehicleidVehInfo[vehicleid][VehPosA]);
        
VehiclesLoaded++;
    }
    
printf("Total %i vehicles spawned",VehiclesLoaded);
    if(
VehiclesLoaded == 0)
    {
        
printf("No vehicles loaded.");
    }
}
SaveAllCars() { //saving all vehicles in SQL
    
new VehiclesSaved 0;
    for(new 
1<= MAX_VEHICLESx++) {
        if(
IsValidVehicle(x)) {
            new 
Float:tmpStatus,query[128];
            
GetVehicleHealth(x,tmpStatus);
            
mysql_format(mysqlquerysizeof(query), "UPDATE `vehicles` SET `Color1`=%i,`Color2`=%i,`Damage`=%f,`FuelStatus`=%i,`Kilometrage`=%f WHERE `ID`=%d",\
            
VehInfo[x][Color1],VehInfo[x][Color2],tmpStatus,VehInfo[x][FuelStatus],VehInfo[x][Kilometrage],VehInfo[x][VID]);
            
mysql_tquery(mysqlquery);
            
VehiclesSaved++;
        }
    }
    
printf("Total of %i vehicles saved",VehiclesSaved);
    return 
true;


Query
PHP код:
mysql_tquery(mysql"SELECT * FROM `vehicles`""OnVehicleLoad"""); 
The problem started occuring when I reached around 50-60 vehicles, they are all saved inside the SQL and everything but they arent being loaded + the printf isnt being displayed at all

PHP код:
printf("Total %i vehicles spawned",VehiclesLoaded);
    if(
VehiclesLoaded == 0)
    {
        
printf("No vehicles loaded.");
    } 
Reply


Messages In This Thread
Vehicle issue - by TwinkiDaBoss - 02.12.2015, 01:31
Re: Vehicle issue - by Golimad - 02.12.2015, 01:34
Re: Vehicle issue - by TwinkiDaBoss - 02.12.2015, 01:43
Re: Vehicle issue - by CmZxC - 02.12.2015, 01:49
Re: Vehicle issue - by TwinkiDaBoss - 02.12.2015, 01:54
Re: Vehicle issue - by PinkFloydLover - 02.12.2015, 02:02
Re: Vehicle issue - by TwinkiDaBoss - 02.12.2015, 02:03
Re: Vehicle issue - by PinkFloydLover - 02.12.2015, 02:13
Re: Vehicle issue - by TwinkiDaBoss - 02.12.2015, 02:16
Re: Vehicle issue - by CmZxC - 02.12.2015, 02:19

Forum Jump:


Users browsing this thread: 1 Guest(s)