Vehicle loading problem
#2

Well, you have a loop in a loop, but I won't bother too much with that.

Anyway, try this.
PHP код:
public OnVehicleLoad()
{
    new 
rowsfields;
    
cache_get_data(rowsfieldsmysql);
    if(
rows)
    {
        for(new 
0rows && MAX_VEHICLESi++){
            for(new 
0MAX_LOADED_CARS;x++) {
                if(
VehInfo[i][vCreated][x]) continue;
                
VehInfo[i][VehMasterID] = cache_get_field_content_int(i,"MasterID");
                
VehInfo[i][VID] = cache_get_field_content_int(i,"ID");
                
VehInfo[i][ModelID] = cache_get_field_content_int(i,"ModelID");
                
VehInfo[i][Color1] = cache_get_field_content_int(i,"Color1");
                
VehInfo[i][Color2] = cache_get_field_content_int(i,"Color2");
                
VehInfo[i][VehPosX] = cache_get_field_content_float(i,"PosX");
                
VehInfo[i][VehPosY] = cache_get_field_content_float(i,"PosY");
                
VehInfo[i][VehPosZ] = cache_get_field_content_float(i,"PosZ");
                
VehInfo[i][VehPosA] = cache_get_field_content_float(i,"PosA");
                
VehInfo[i][VRespawnTime] = cache_get_field_content_int(i,"RespawnTime");
                
VehInfo[i][VPrice] = cache_get_field_content_int(i,"Price");
                
VehInfo[i][DamageStatus] = cache_get_field_content_float(i,"Damage");
                
VehInfo[i][FuelStatus] = cache_get_field_content_int(i,"FuelStatus");
                
VehInfo[i][EngineStatus] = cache_get_field_content_int(i,"EngineStatus");
                
VehInfo[i][Kilometrage] = cache_get_field_content_float(i,"Kilometrage");
                
VehInfo[i][vSiren] = cache_get_field_content_int(i,"Siren");
                
VehInfo[i][vOwned] = cache_get_field_content_int(i,"Owned");
                
VehInfo[i][VehWorld] = cache_get_field_content_int(i,"VirtualWorld");
                
VehInfo[i][VehInterior] = cache_get_field_content_int(i,"Interior");
                
VehInfo[i][vCreated][x] = CreateServerVehicle(VehInfo[i][ModelID],VehInfo[i][VehPosX],VehInfo[i][VehPosY],VehInfo[i][VehPosZ],VehInfo[i][VehPosA],VehInfo[i][Color1],VehInfo[i][Color2],VehInfo[i][VRespawnTime],VehInfo[i][vSiren]);
                
SetVehicleVirtualWorld(VehInfo[i][vCreated][x],VehInfo[i][VehWorld]);
                
LinkVehicleToInterior(VehInfo[i][vCreated][x],VehInfo[i][VehInterior]);
                
SetVehiclePos(VehInfo[i][vCreated][x],VehInfo[i][VehPosX],VehInfo[i][VehPosY],VehInfo[i][VehPosZ]);
                
SetVehicleZAngle(VehInfo[i][vCreated][x],VehInfo[i][VehPosA]);
                
VehiclesLoaded++;
            }
        }
        
printf("Total %i vehicles spawned",VehiclesLoaded);
    }
    else print(
"No vehicles to be loaded..");
    return 
true;

Reply


Messages In This Thread
Vehicle loading problem - by TwinkiDaBoss - 25.11.2015, 20:23
Re: Vehicle loading problem - by CmZxC - 25.11.2015, 20:39
Re: Vehicle loading problem - by TwinkiDaBoss - 25.11.2015, 20:47
Re: Vehicle loading problem - by CmZxC - 25.11.2015, 20:54
Re: Vehicle loading problem - by TwinkiDaBoss - 25.11.2015, 20:58
Re: Vehicle loading problem - by Dokins - 26.11.2015, 11:16
Re: Vehicle loading problem - by TwinkiDaBoss - 26.11.2015, 14:25
Re: Vehicle loading problem - by CmZxC - 26.11.2015, 14:47
Re: Vehicle loading problem - by TwinkiDaBoss - 26.11.2015, 14:50
Re: Vehicle loading problem - by CmZxC - 26.11.2015, 14:51

Forum Jump:


Users browsing this thread: 1 Guest(s)