12.01.2013, 21:59
(
Последний раз редактировалось mrtms; 12.01.2013 в 22:42.
)
Try this
PHP код:
new Float: CarHealth[MAX_PLAYERS];
GetVehicleSpeed(v)
{
new Float: vehiclesVelocity[3];
GetVehicleVelocity(v, vehiclesVelocity[0], vehiclesVelocity[1], vehiclesVelocity[2]);
return floatround(floatsqroot((vehiclesVelocity[0]*vehiclesVelocity[0]+vehiclesVelocity[1]*vehiclesVelocity[1]))*100.0*1.6);
}
if(IsPlayerInAnyVehicle(playerid))
{
new Float: vehHealth, v = GetPlayerVehicleID(playerid);
GetVehicleHealth(GetPlayerVehicleID(playerid), vehHealth);
if(vehHealth > 250)
{
new Float: dif = CarHealth[playerid] - vehHealth;
if(dif > 150)
{
new Float: curHealth;
GetPlayerHealth(playerid, curHealth);
}
CarHealth[playerid] = vehHealth;
}
}