15.02.2018, 15:42
Quote:
It won't work at all for me, i kept banging the car against walls it wouldn't end for damage reason, try it now, it only ends if someone shoots the car? shouldn't be whenever the car is damaged?
|
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
}
}