[Help]Player damage when vehicle damage
#7

Quote:
Originally Posted by jujuv
View Post
pawn Code:
public OnPlayerUpdate(playerid)
{
    if(GetPlayerState(playerid) == 2)
    {
        new Float:vehHealth;// we crate a new var (type Float value 0.0)
        new Float:playerArmour;
        new curentVeh = GetPlayerVehicleID(playerid);
        GetVehicleHealth(curentVeh, vehHealth);//we get the vehicle damaged health and store the returned value in vehHealth(value returned e.g: 95.2)
        vehHealth = vehHealth/10;
        SetPlayerHealth(playerid, vehHealth);// we set the playerhealth at the value of vehHealth(value of VehHealth after passed in this function e.g : 95)
        if(GetPlayerArmour(playerid,playerArmour) != 0)
        {
        SetPlayerArmour(playerid,0);
        SetPlayerHealth(playerid, vehHealth);
        }
    }

}
It's works but i think it use more bandwich :/
That's probably because you call it whenever the player updates, which is like several times a second depending on what the player is doing. I guess he's driving a vehicle out from the information you gave us. Make a callback and a timer or something.
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)