[Help]Player damage when vehicle damage
#1

Hi,

I'm making a Destruction Derby GM and i want the player health be equal at the vehicle health (i want : PlayerHealth == VehicleHealth).

i've made this easy with 5 lines but it's not works :

pawn Code:
public OnVehicleDamageStatusUpdate(vehicleid, playerid)///when a vehicle is damage
{
    new Float:vehHealth;// we crate a new var (type Float value 0.0)
    GetVehicleHealth(vehicleid, vehHealth);//we get the vehicle damaged health and store the returned value in vehHealth(value returned e.g: 95.2)
    SetPlayerHealth(playerid, vehHealth);// we set the playerhealth at the value of vehHealth(value of VehHealth after passed in this function e.g : 95)
 /*
 NB: SetPlayerHealth() automaticaly transform vehHealth (Float) in an integer value
 */

}
When the vehicle get damage ,the player health come always at ~5HP .
When the vehicle get damage second , the player donsn't loose HP.

i've try this :

pawn Code:
public OnVehicleDamageStatusUpdate(vehicleid, playerid)///when a vehicle is damage
{
    new Float:vehHealth;// we crate a new var (type Float value 0.0)
    vehHealth = GetVehicleHealth(vehicleid, vehHealth);//we get the vehicle damaged health and store the returned value  in vehHealth(value returned e.g: 95.2)
    SetPlayerHealth(playerid, vehHealth);// we set the playerhealth at the value of vehHealth(value of VehHealth after passed in this function e.g : 95)
 /*
 NB: SetPlayerHealth() automaticaly transform vehHealth (Float) in an integer value
 */

}
and :

pawn Code:
public OnVehicleDamageStatusUpdate(vehicleid, playerid)///when a vehicle is damage
{
      new Float:vehHealth;
    new Float:vehHealth;// we crate a new var (type Float value 0.0)
    vehHealth = GetVehicleHealth(vehicleid, vehHealth);//we get the vehicle damaged health and store the returned value in vehHealth(value returned e.g: 95.2)
    SetPlayerHealth(playerid, vehHealth1);// we set the playerhealth at the value of vehHealth(value of VehHealth after passed in this function e.g : 95)
 /*
 NB: SetPlayerHealth() automaticaly transform vehHealth (Float) in an integer value
 */

}
but it's not work too , so i think the bug come of my SetPlayerHealth() calling.

Help me , please
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)