27.12.2010, 10:39
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 :
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 :
and :
but it's not work too , so i think the bug come of my SetPlayerHealth() calling.
Help me , please
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 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
*/
}
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
*/
}
Help me , please