[Help]Player damage when vehicle damage
#6

pawn Code:
public OnPlayerUpdate(playerid)// This is a part of a very simply script made by Jujuv
{
    if(GetPlayerState(playerid) == 2)
    {
        new Float:vehHealth;// we crate a new var (type Float value 0.0)
        new Float:playerArmour;//we create a new var (type floatvalue 0.0)
        new curentVeh = GetPlayerVehicleID(playerid);//Get the vehicle (id) of the player (and store it in curentVeh)
        GetVehicleHealth(curentVeh, vehHealth);//Get the vehicle health and store it in vehHealth(value returned e.g: 2500.2)
        vehHealth = vehHealth/10;// we divide the value of vehHealth per 10
        SetPlayerHealth(playerid, vehHealth);//Set the health of the vehicle at the health of the player(value e.g : 250)
        if(GetPlayerArmour(playerid,playerArmour) != 0)// if the armour of the playerArmour is not equal at 0 (player have armour)
        {
        SetPlayerArmour(playerid,0);//Set the armour ofthe player at 0 ("delete his armour")
        SetPlayerHealth(playerid, vehHealth);//Set the health of the vehicle at the health of the player
        }
    }

}
It's works but i think it use more bandwich :/
Reply


Messages In This Thread
[Help]Player damage when vehicle damage - by jujuv - 27.12.2010, 10:39
Re: [Help]Player damage when vehicle damage - by Sascha - 27.12.2010, 10:57
Re: [Help]Player damage when vehicle damage - by Hiddos - 27.12.2010, 11:07
Re : [Help]Player damage when vehicle damage - by jujuv - 27.12.2010, 11:14
Re: [Help]Player damage when vehicle damage - by jameskmonger - 27.12.2010, 11:23
Re : [Help]Player damage when vehicle damage - by jujuv - 28.12.2010, 00:20
Re: Re : [Help]Player damage when vehicle damage - by _rAped - 28.12.2010, 00:25

Forum Jump:


Users browsing this thread: 1 Guest(s)