17.06.2013, 03:38
Alright, the first thing you should do is have a vehicle engine variable, in my case I use:
At the top portion of the script.
Then I would create a timer when a player gets into a vehicle:
And then forward it with all your other forwards:
Then I would create the public for that.
Also be sure to make it to where the "Total" timer stops when the player exits the vehicle.
Note that this is probably buggy as I havn't scripted in a while, lemme know of any bugs or issues and I will gladly fix them.
pawn Код:
new vehEngine[MAX_PLAYERS];
Then I would create a timer when a player gets into a vehicle:
pawn Код:
SetTimerEx("Total", 1000, true, "i", playerid);
pawn Код:
forward Total(playerid);
pawn Код:
Public Total (playerid) //This is probably not right, I'm typing it in this textbox, not the compiler.
{
new VehHealth = GetVehicleHealth(playerid);
if (VehHealth <= 300)
{
SetVehicleParams(vehicleid, 0, -1, -1, -1, -1, -1);
}
return 1;
}
Note that this is probably buggy as I havn't scripted in a while, lemme know of any bugs or issues and I will gladly fix them.