Quote:
Originally Posted by Dayrion
Or... this ?
PHP код:
public OnGameModeExit()
{
for(new i = GetVehiclePoolSize(); i > 0; i--)
{
SetVehicleToRespawn(i);
}
return 1;
}
PHP код:
public OnVehicleSpawn(vehicleid)
{
switch(GetVehicleModel(vehicleid))
{
case 520, 425: SetVehicleHealth(vehicleid, 2500);
case 528, 427: SetVehicleHealth(vehicleid, 5000);
case 432: SetVehicleHealth(vehicleid, 10000);
}
return 1;
}
I don't if this way is working.
|
There is absolutely no need to loop through all the vehicles and respawn them just to call the OnVehicleSpawn callback. What if he is loading server vehicles from a database or files?
What Konstantinos posted above works absolutely fine and makes it easier to do what he's looking for. I also have a custom function to create vehicles and I do the same to set the vehicle health.