SA-MP Forums Archive
OnVehicleHealthChange - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: OnVehicleHealthChange (/showthread.php?tid=251032)



OnVehicleHealthChange - Gh0sT_ - 25.04.2011

Maybe someone has got this function? I really need it. Yes, I have searched for it but.. 0! :X


Re: OnVehicleHealthChange - iJumbo - 25.04.2011

pawn Код:
new oldVH[MAX_VEHICLES],newVH[MAX_VEHICLES];




public OnVehicleHealthChange(vehicleid, newhealth, oldhealth)
{
    return 1;
}
public OnGameModeInit()
{
    SetTimer("VehicleCheck", 1000, true);
    return 1;
}

public VehicleCheck()
{
    for(new v = 1; v <= MAX_VEHICLES; v++)
    {
        new Float:health;
        GetVehicleHealth(v, health);
        newVH[v] = floatround(health);
        if(newVH[v] != oldVH[v])
        {
            OnVehicleHealthChange(v, newVH[v], oldVH[v]);
            oldVH[v] = newVH[v];
        }
    }
    return 1;
}

idk ..


Re: OnVehicleHealthChange - playbox12 - 25.04.2011

Maybe this topic helps you?

http://forum.sa-mp.com/showthread.ph...nVehicleDamage

(I searched for OnVehicleDamage, as that sounds more logical to me).


Re: OnVehicleHealthChange - iJumbo - 25.04.2011

oh now i remember where i take the function i post xD time ago