22.08.2017, 09:50
(
Последний раз редактировалось thegamer355; 22.08.2017 в 12:27.
)
You can use the code below to prevent people from fixing their cars:
And every time you repair a vehicle use:
To set the health and change the variable.
I hope this helps you,
-TG
pawn Код:
new Float:VehicleHealth[MAX_VEHICLES];
stock SetVhealth(vehicleid, Float:health)
{
VehicleHealth[vehicleid] = health;
SetVehicleHealth(vehicleid, health);
return 1;
}
public OnVehicleDamageStatusUpdate(vehicleid, playerid)
{
GetVehicleHealth(vehicleid, VehicleHealth[vehicleid]);
return 1;
}
// now use this in the anti cheat, i use it in a timer which runs every few seconds.
new vehicleid = GetPlayerVehicleID(playerid);
GetVehicleHealth(vehicleid, vHealth);
if(vHealth > VehicleHealth[vehicleid])
{
return 1; // do the stuff you want to do with the player in here
}
pawn Код:
SetVhealth(vehicleid, health); // where health stands for the value of the health you want to set it to
I hope this helps you,
-TG

