PDA

View Full Version : Bug SaveDynamicCars


DreyPT
08/03/2013, 10:45 PM
Hello, my gamemode when this callback is called it increases the CPU!


public
SaveDynamicCars ( )
{
new
File: file2 = fopen ( "Frag_Scriptfiles/Cars/carspawns.cfg" , io_write ) ,
coordsstring [ 512 ] ,
DynamicCarsIndex ,
idx
;

DynamicCarsIndex = sizeof ( DynamicCars ) ;

while (idx < DynamicCarsIndex )
{
format(

coordsstring, sizeof(coordsstring), "%d|%f|%f|%f|%f|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d |%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|% d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d| %d|%d|%f|%d|%d|%d|%d|%d|%d|%d|%d\n",
DynamicCars[idx][CarModel],
DynamicCars[idx][CarX],
DynamicCars[idx][CarY],
DynamicCars[idx][CarZ],
DynamicCars[idx][CarAngle],
DynamicCars[idx][CarColor1],
DynamicCars[idx][CarColor2],
DynamicCars[idx][FactionCar],
DynamicCars[idx][CarType],
DynamicCars[idx][CarPrice],
DynamicCars[idx][CarOwned],
DynamicCars[idx][cTrunkGun1],
DynamicCars[idx][cTrunkAmmo1],
DynamicCars[idx][cTrunkGun2],
DynamicCars[idx][cTrunkAmmo2],
DynamicCars[idx][cTrunkGun3],
DynamicCars[idx][cTrunkAmmo3],
DynamicCars[idx][cTrunkGun4],
DynamicCars[idx][cTrunkAmmo4],
DynamicCars[idx][cTrunkGun5],
DynamicCars[idx][cTrunkAmmo5],
DynamicCars[idx][cTrunkGun6],
DynamicCars[idx][cTrunkAmmo6],
DynamicCars[idx][Gasolina],
DynamicCars[idx][Gasoleo],
DynamicCars[idx][mod1],
DynamicCars[idx][mod2],
DynamicCars[idx][mod3],
DynamicCars[idx][mod4],
DynamicCars[idx][mod5],
DynamicCars[idx][mod6],
DynamicCars[idx][mod7],
DynamicCars[idx][mod8],
DynamicCars[idx][mod9],
DynamicCars[idx][mod10],
DynamicCars[idx][mod11],
DynamicCars[idx][mod12],
DynamicCars[idx][mod13],
DynamicCars[idx][mod14],
DynamicCars[idx][mod15],
DynamicCars[idx][mod16],
DynamicCars[idx][mod17],
DynamicCars[idx][paintjob],
DynamicCars[idx][CarroStand],
DynamicCars[idx][NeonRosa],
DynamicCars[idx][NeonAzul],
DynamicCars[idx][NeonBranco],
DynamicCars[idx][NeonAmarelo],
DynamicCars[idx][NeonVermelho],
DynamicCars[idx][NeonVerde],
DynamicCars[idx][NeonLigado],
DynamicCars[idx][Bateria],
DynamicCars[idx][Lataria],
DynamicCars[idx][Kilometros],
DynamicCars[idx][Metros],
DynamicCars[idx][Travado],
DynamicCars[idx][Policia],
DynamicCars[idx][Taxi],
DynamicCars[idx][Deposito],
DynamicCars[idx][Multas],
DynamicCars[idx][Multado]
) ;

fwrite(file2, coordsstring);
idx++;
}

fclose(file2);

return 1;
}

DreyPT
08/03/2013, 10:53 PM
Someone ?

Sebz
08/03/2013, 11:32 PM
Well. Spawning cars does boost the CPU up. That is supposed to happen. You could try and spawn them at a slower frequency to even out your CPU usage. That's what I do on my server at least, I had the same problem as you are having now when I first started.

DreyPT
09/03/2013, 08:58 AM
And how do I do that?

DreyPT
09/03/2013, 10:11 AM
?????