Detect Car Jack Killing
#1

I'm talking about the thread https://sampforum.blast.hk/showthread.php?tid=301366

from what I've tested OnPlayerGiveDamage and OnPlayerTakeDamage is not called and under OnPlayerDeath they die from reason 255 with invalid killerid.

Driver Check
I've only tested with a low ping but I ran a check to see if there was a driver in the players last vehicle and that worked well, you could also save and check the time they entered the vehicle.
However there's a way where they can do this without entering as a driver which would mean this method of detection would be useless against them.

Vehicle Health Check
You also have to take into consideration that staying in the vehicle when it blows up won't call OPTD or OPGD so you could also run a check on the players last vehicle health.
If a player dies by the car jack then GetPlayerVehicleID(playerid) will return their vehicle they died in.

example script:
pawn Код:
public OnPlayerDeath(playerid,killerid,reason)
{
    if(reason == 255 && killerid == INVALID_PLAYER_ID)
    {
        new Float:Health;
        GetVehicleHealth(GetPVarInt(playerid,"vehicleid"),Health);
        if(Health > 250.0)
        {
            //possible car jack bug
        }
    }
}
setting a players health to 0 may also cause the 255 reason so I'd suggest adding a variable like I_Have_Script_Killed_This_Player[playerid] = true;

anyway.. discuss...
Reply


Messages In This Thread
Detect Car Jack Killing - by cessil - 23.12.2011, 02:57
Re: Detect Car Jack Killing - by Medardo4Life - 24.12.2011, 03:31
Re: Detect Car Jack Killing - by RadioRockz - 24.12.2011, 04:51
Re: Detect Car Jack Killing - by [O.z]Caroline - 24.12.2011, 05:10
AW: Detect Car Jack Killing - by BigETI - 30.12.2011, 00:39

Forum Jump:


Users browsing this thread: 1 Guest(s)