SA-MP Forums Archive
OnVehicleDamageStatusUpdate - 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)
+--- Thread: OnVehicleDamageStatusUpdate (/showthread.php?tid=504333)



OnVehicleDamageStatusUpdate - Slicebook - 03.04.2014

I write to player: high collision
Do not write off the: small collision

how to solve? Code describing the low collision.

Код:
new Float:JarmuHP[MAX_VEHICLES];
Код:
public OnVehicleDamageStatusUpdate(vehicleid,playerid)
{
        new Float:jhp;
        GetVehicleHealth(vehicleid,jhp);
        if(JarmuHP[vehicleid]-100.0 <= jhp)
        {
            SendClientMessage(playerid,-1,"high bumped!");
            JarmuHP[vehicleid] = jhp;
        }
        return 1;
}

public OnVehicleSpawn(vehicleid)
{
        JarmuHP[vehicleid] = 1000.0;
        return 1;
}