22.06.2017, 01:26
Your system is flawed. I imagine it doesn't work either with melee weapons OR fists?
Unless you've got it setup under take/give dmg for other weapons.
Anyway, just use OnPlayerTakeDamage. There's no plausible way of doing it with OnPlayerWeaponShot FOR players in a vehicle.
BULLET_HIT_TYPE_PLAYER doesn't work if a player is inside a vehicle.
Unless you've got it setup under take/give dmg for other weapons.
Anyway, just use OnPlayerTakeDamage. There's no plausible way of doing it with OnPlayerWeaponShot FOR players in a vehicle.
PHP код:
public OnPlayerTakeDamage(playerid, .. )
{
if(IsPlayerInAnyVehicle(playerid)){
if(health < 50 && GetPVarInt(hitid, "Dead") == 0)
{
SetPlayerHealth(hitid, 50);
SetTimerEx("Wounded", 0, 0, "ii", playerid, hitid);
}
}
}
return true;
}