[help]vehicle health on all cars
#1

sorry i dont have a code to post im pretty tired i tried just about every code i seen here and on ****** and nothing seems to work

i want all vehicles to spawn with more health

help please
Reply
#2

pawn Код:
public OnVehicleSpawn(vehicleid)
{
    SetVehicleHealth(vehicleid, amount);
    return 1;
}
The default vehicles spawn with is 1000, so you want to give them more than that.

https://sampwiki.blast.hk/wiki/OnVehicleSpawn
https://sampwiki.blast.hk/wiki/SetVehicleHealth
Reply
#3

Except from OnVehicleSpawn callback CalvinC posted (which is whenever a vehicle re-spawns), it'd be better to make your own functions when a vehicle is created or even hook those functions so it'll set the health itself.
Reply
#4

LAST EDIT: i got it to work with

public OnVehicleStreamIn(vehicleid, forplayerid)
{

SetVehicleHealth(modelid, 5000);
return 1;
}

but i had to run it on a filterscript otherwise it wouldnt work it would compile i tried everything and i tried onvehiclestreamin already but it was my gamemode variables i guess


EDIT: lol just when i thought i got it all figured out walk in and out of a checkpoint and vehicle health is back up to 5000
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)