Detect invincible vehicle ?
#7

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;
}
NOT TESTED!
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)
to
pawn Код:
if(vehiclehealth[veh] > vehhealth)
Reply


Messages In This Thread
Detect invincible vehicle ? - by vardanega - 24.06.2013, 08:32
Re: Detect invincible vehicle ? - by Cjgogo - 24.06.2013, 09:01
Re: Detect invincible vehicle ? - by park4bmx - 24.06.2013, 09:13
Re: Detect invincible vehicle ? - by Vrag - 24.06.2013, 09:16
Re : Detect invincible vehicle ? - by vardanega - 24.06.2013, 10:43
Re: Detect invincible vehicle ? - by Kyle - 24.06.2013, 10:47
Re: Detect invincible vehicle ? - by introzen - 24.06.2013, 11:30
Re : Detect invincible vehicle ? - by vardanega - 28.06.2013, 06:36
Re: Detect invincible vehicle ? - by park4bmx - 28.06.2013, 09:53
Re : Detect invincible vehicle ? - by vardanega - 28.06.2013, 10:47

Forum Jump:


Users browsing this thread: 5 Guest(s)