Saving damaged vehicles
#1

Hello,

Is there a way to spawn a vehicle which is damaged like this: http://prikachi.com/images/735/8885735f.png and when I respawn the vehicles to be again damaged?

Thanks!
Reply
#2

I't would be something like
PHP код:
new engine[MAX_VEHICLES], lights[MAX_VEHICLES], alarm[MAX_VEHICLES], doors[MAX_VEHICLES], bonnet[MAX_VEHICLES], boot[MAX_VEHICLES], objective[MAX_VEHICLES]; 
PHP код:
public OnVehicleSpawn(vehicleid)
{
    
SetVehicleParamsEx(vehicleidengine[vehicleid], lights[vehicleid], alarm[vehicleid], doors[vehiceid], bonnet[vehicleid], boot[vehicleid], objective[vehicleid]);

Reply
#3

Quote:
Originally Posted by Shinja
Посмотреть сообщение
Код:
SetVehicleParamsEx(vehicleid, engine[vehicleid], lights[vehicleid], alarm[vehicleid], doors[vehiceid], bonnet[vehicleid], boot[vehicleid], objective[vehicleid]);
SetVehicleParamsEx doesn't really control damage, it controls the open/closed state of the vehicle(ex: if the doors are locked, doors will be 1). You should use GetVehicleDamageStatus, along with UpdateVehicleDamageStatus to get and control vehicle damage.

Refer to:
https://sampwiki.blast.hk/wiki/GetVehicleDamageStatus
https://sampwiki.blast.hk/wiki/UpdateVehicleDamageStatus
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)