Quote:
Originally Posted by iKarim
I'll have a look again, but it should work either way:
PHP код:
if(g_DriftFlags & DAMAGE_CHECK_ENABLED && g_DriftPlayers[playerid][playerFlags] & DAMAGE_CHECK_ENABLED)
{
new Float: vehicleHealth;
GetVehicleHealth(vehicleID, vehicleHealth);
if(vehicleHealth < g_DriftPlayers[playerid][vHealth])
{
GetPlayerPos(playerid, vX, vY, vZ);
g_DriftPlayers[playerid][driftState] = DRIFT_STATE_NONE;
g_DriftPlayers[playerid][timeoutTicks] = 0;
#if defined OnPlayerDriftEnd
new Float: distance;
distance = GetPlayerDistanceFromPoint(playerid, g_DriftPlayers[playerid][startPosX], g_DriftPlayers[playerid][startPosY], g_DriftPlayers[playerid][startPosZ]);
OnPlayerDriftEnd(playerid, DRIFT_END_REASON_DAMAGED, distance, GetTickCount() - g_DriftPlayers[playerid][startTimestamp]);
#endif
}
}
|
I looked at your code but it's too bad to not hook setvehiclehealth the way i told you but good job overall with the tips i provided it would be pretty cool and i would use it for my own, i might fork it on github to help out with the vehicle health damage check thing, good luck.