24.06.2013, 11:30
pawn Код:
new Float:vehiclehealth[MAX_VEHICLES];
new Float:playerhealth[MAX_PLAYERS];
new Float:playerarmor[MAX_PLAYERS];
forward CheckPlayerGodMode(playerid);
public CheckPlayerGodMode(playerid)
{
new Float:health, Float:armor, Float:vehhealth;
new veh = GetPlayerVehicleID(playerid);
GetVehicleHealth(veh, vehhealth);
if(vehiclehealth[veh] != vehhealth)
{
GetPlayerHealth(playerid,health);
GetPlayerArmour(playerid,armor);
if((playerhealth[playerid] == health) || (playerarmor[playerid] == armor))
{
//Player has godmode. What to do?
}
else
{
//player doesn't cheat
}
playerhealth[playerid] = health;
playerarmor[playerid] = armor;
return 1;
}
vehiclehealth[veh] = vehhealth;
return 1;
}
Also, this script is simple so if anyone repairs the car in a pay'n'spray, it would show up as cheat. Fix:
switch
pawn Код:
if(vehiclehealth[veh] != vehhealth)
pawn Код:
if(vehiclehealth[veh] > vehhealth)