Vehicle Health
#1

Hello Guys,
as u may know the vehicles on sa (in my opinion...) havnt got much hp.

so ive tried to make having about 15000 hp instead of 1000 hp but ist not going to work so, anyhelp be nice?
or even if u found some script u may can post them up?

Heres my code
PHP код:
public OnVehicleSpawn(vehicleid)
{
    if(
GetVehicleModel(vehicleid) < 611)
    {
        
SetVehicleHealth(vehicleid15000.0);
        return 
1;
    }
    return 
1;

Reply
#2

This works. OnVehicleSpawn is called only when a vehicle RE-SPAWN. Not when it gets created with CreateVehicle or AddStaticVehicle.
Reply
#3

uhh damn, thanks :/
Reply
#4

so OnGameModeInit ye?
Reply
#5

Create vehicle re-spawner using timer.
Then you can but this works too.
Reply
#6

Quote:
Originally Posted by Pepino960
Посмотреть сообщение
uhh damn, thanks :/
You may respawn it right after it gets created, or use SetVehicleHealth.

You can also create a function that automatically Add vehicles, then set their health.

pawn Код:
stock AddReinforcedCar(modelid,Float:spawn_x,Float:spawn_y,Float:spawn_z,Float:angle,color1,color2,respawn_delay = 0,Float:health = 100.0);
{
    new carid = AddStaticVehicleEx(modelid,spawn_x,spawn_y,spawn_z,angle,color1,color2,respawn_delay);
    SetVehicleHealth(carid,health);
    return carid;
}
Now just use:

pawn Код:
AddReinforcedCar(modelid,Float:spawn_x,Float:spawn_y,Float:spawn_z,Float:angle,color1,color2,respawn_delay,Float:health); // Where health are optional.
Reply
#7

got it, done by timer

/CLOSE
Reply
#8

Quote:
Originally Posted by Pepino960
Посмотреть сообщение
got it, done by timer

/CLOSE
Oh yeah Good.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)