vehicle health
#1

Hello can some1 help my with this i made timer for 1 sec that count vehicle health but it still not working properly and i dont thing i could do something about it , so now i have this code :

Код:
public carcheck()
{
    for(new i=0; i<MAX_PLAYERS; i++)
    {
           new vehicle, Float:health;
           vehicle = GetPlayerVehicleID(i);
           GetVehicleHealth(vehicle, health);
           if(health <= 250)
           {
           		RemovePlayerFromVehicle(i);
           		health += 75;
                SetVehicleHealth(vehicle, health);
   
           }
     }
     return 1;
}
its a timer everything on this code , the prolem is like i cant get right value of health to add cuz is blows even with +80 and sometimes with +75 not its depend on how hard u hit and lose health so , i need some alternative code that helps my to increase vehicle burning time
Reply
#2

Hello there!

The problem is, vehicle already blows once it reaches like ~350 health, I am not so sure about that, you might want to increase the minimum health.

Edit: Do it something like this;

pawn Код:
public carcheck()
{
    for(new i=0; i<MAX_PLAYERS; i++)
    {
           new vehicle, Float:health;
           vehicle = GetPlayerVehicleID(i);
           GetVehicleHealth(vehicle, health);
           if(health <= 480)
           {
                RemovePlayerFromVehicle(i);
                health += 75;
                SetVehicleHealth(vehicle, health);
   
           }
     }
     return 1;
}
Edit 2; About your second question regarding increasing burning time, it isn't possible as far as I know, so I can't help about that.
Reply
#3

you know car starts burning at 250 or less if i set 450 its goes just smoke
Reply
#4

Then make it lower for your needs, but 250 burns it, even 350 does.
Reply
#5

will try to use flame object instead and just set a new timer that will bow a car after some time
Reply
#6

Quote:
Originally Posted by Rufio
Посмотреть сообщение
but 250 burns it, even 350 does.
Not true. A vehicle is only put on fire when it's health is lower than 250.
Reply
#7

Quote:
Originally Posted by Rufio
Посмотреть сообщение
Hello there!

The problem is, vehicle already blows once it reaches like ~350 health, I am not so sure about that, you might want to increase the minimum health.

Edit: Do it something like this;

pawn Код:
public carcheck()
{
    for(new i=0; i<MAX_PLAYERS; i++)
    {
           new vehicle, Float:health;
           vehicle = GetPlayerVehicleID(i);
           GetVehicleHealth(vehicle, health);
           if(health <= 480)
           {
                RemovePlayerFromVehicle(i);
                health += 75;
                SetVehicleHealth(vehicle, health);
   
           }
     }
     return 1;
}
Edit 2; About your second question regarding increasing burning time, it isn't possible as far as I know, so I can't help about that.
Thanks for warning, tho'.
Reply
#8

yes its get on fire only if its less 250 https://sampwiki.blast.hk/wiki/VehicleHealth
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)