Anti Cleo fixcar
#3

You can use the code below to prevent people from fixing their cars:

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
}
And every time you repair a vehicle use:
pawn Код:
SetVhealth(vehicleid, health); // where health stands for the value of the health you want to set it to
To set the health and change the variable.


I hope this helps you,

-TG
Reply


Messages In This Thread
Anti Cleo fixcar - by skiplovebra - 21.08.2017, 03:06
Re: Anti Cleo fixcar - by 10MIN - 21.08.2017, 11:36
Re: Anti Cleo fixcar - by thegamer355 - 22.08.2017, 09:50

Forum Jump:


Users browsing this thread: 1 Guest(s)