GetVehicleHealth....How?
#1

I would make a script:

IF Vehicle health = 400, SetVehicleHealth 500

But where to add? and how to make?

(It basically don't make explode the car...)
Reply
#2

pawn Код:
if(strcmp(cmdtext, "/repair", true) == 0)
{
    new Float:health;
    new veh;
    veh = GetPlayerVehicleID(playerid);
    GetVehicleHealth(veh, health);
    if(health >400) return SendClientMessage(playerid,COLOR_RED,"Doesn't need repairing!");
    SetVehicleHealth(veh,500);
    SendClientMessage(playerid,COLOR_GREEN,"Repaired!");
}
Reply
#3

I won't a command I would like include this "automatically" when a car has 300HP..
Reply
#4

pawn Код:
public OnPlayerUpdate(playerid)
{
    if(IsPlayerInAnyVehicle(playerid))
    {
        new Float:hp,vehicleid = GetPlayerVehicleID(playerid);
        GetVehicleHealth(vehicleid,hp);
        if(hp < 400) SetVehicleHealth(vehicleid,500);
    }
    return 1;
}
Reply
#5

https://sampwiki.blast.hk/wiki/OnVehicleDamageStatusUpdate

I'm guessing?
Reply
#6

Quote:
Originally Posted by DBan
Посмотреть сообщение
On that page:


Note: This does not include vehicle health changes


Lol.
Reply
#7

Quote:
Originally Posted by [LoF]Zak
Посмотреть сообщение
On that page:


Note: This does not include vehicle health changes


Lol.
xD Didn't see that
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)