Stop a player dying
#1

I have a problem that is really bugging me, and ****** doesn't seem to have answers.

I want to prevent a player dying when they are in a rhino (tank), because if you shoot a HS missile at the tank, it will kill the player, despite them being in the vehicle. I have "OnPlayerTakeDamage" set up so that when a player takes damage, and they are inside a rhino, their health will be restored to what it was.

pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
{
    print("damage taken");
    new vehicleid = GetPlayerVehicleID(playerid);
    if(vehicleid != INVALID_VEHICLE_ID){
        new modelid = GetVehicleModel(vehicleid);
        if(modelid == 432){
            print("in vehicle");
            new Float: health;
            GetPlayerHealth(playerid, health);
            SetPlayerHealth(playerid, (health + amount));
        }
    }

    return 1;
}
However, if the HS missile is well aimed, it will take all of the players health in one go, and the player will die before their health is restored, despite the fact that the rhino may not have blown up.

Effectively, what I wan't to do is make it such that when a player is in a rhino, they are untouchable until either they exit it, or someone blows the rhino.

This problem is really bugging me, and I will rep++ anyone who can help me find a decent solution.
Reply


Messages In This Thread
Stop a player dying - by EnforcerDon - 27.09.2014, 02:01
Re: Stop a player dying - by Raefal - 27.09.2014, 02:31
Re: Stop a player dying - by [CG]Milito - 27.09.2014, 03:05
Re: Stop a player dying - by Pottus - 27.09.2014, 03:06
Re: Stop a player dying - by biker122 - 27.09.2014, 04:57
Re: Stop a player dying - by EnforcerDon - 28.09.2014, 23:14

Forum Jump:


Users browsing this thread: 1 Guest(s)