SA-MP Forums Archive
Help me vehicle system, command fix and repair - 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: Help me vehicle system, command fix and repair (/showthread.php?tid=499236)



Help me vehicle system, command fix and repair - SFRPVN - 07.03.2014

Hello!
Help me set damage vehicle and vehicle can't explode unless it flip

instead it will explode and can't engine and wont restart until it is repaired, it will can't engine until vehicle is fixed or repaired


Re: Help me vehicle system, command fix and repair - SyntaxQ - 07.03.2014

Do you want an Auto Repair script?
pawn Код:
//on top of your script
forward FixAllCars();
new FixTimer;

// OnGameModeInit
FixTimer = SetTimer("FixAllCars", 1000, true);

//OnGameModeExit
KillTimer(FixTimer);

//------------------
public FixAllCars()
{
        for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
        // loop all possible player
        {
                if(IsPlayerConnected(playerid) && IsPlayerInAnyVehicle(playerid))
                //if the player is connected AND in a car
                {
                        new vehicleid = GetPlayerVehicleID(playerid);// gettin the vehicle id
                        SetVehicleHealth(vehicleid,1000.0);// set the vehicle health
                }
        }
}



Re: Help me vehicle system, command fix and repair - SFRPVN - 07.03.2014

can you help me damage vehicle?


Re: Help me vehicle system, command fix and repair - SyntaxQ - 07.03.2014

What do you exactly mean by 'damage vehicle'?