SA-MP Forums Archive
Pls help me find this script - 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: Pls help me find this script (/showthread.php?tid=334428)



Pls help me find this script - skew - 14.04.2012

er.. plugin that make u stop the car and cant run if car health is low

pls help me =/\=

T_T


Re: Pls help me find this script - AustinJ - 14.04.2012

Not really a plugin but you could use something like this.


pawn Код:
forward Check_Veh();

public Check_Veh()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(GetPlayerState(i) == 2)
        {
            new Float:health, vehicleid, engine, lights, alarm, doors, bonnet, boot, objective;
            vehicleid = GetPlayerVehicleID(i);
            GetVehicleHealth(vehicleid, health);
            GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
            if(health < 300) // less then 30%
            {
                SetVehicleParamsEx(vehicleid, false, lights, alarm, doors, bonnet, boot, objective);
            }
        }
    }
}

public OnGameModeInit()
{
    SetTimer("Check_Veh", 1000, true);
}