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
#2

Interesting.
Thanks.
Reply
#3

Greatz
Reply
#4

Very Very interesting!
Reply
#5

I probably know why OPTD or OPGD doesn't get called after this:

Guess 1: OnPlayerUpdate never gets called if a player is in death mode (The part between OnPlayerDeath and OnPlayerSpawn) and OPTD and OPGD does only get called after player update (in case of health decrease).

Guess 2: The players might get killed serverside which could proofs that OPTD and OPGD doesn't get called and the client sends ofc the invalid kill reason ID.

Guess 3: Both of them could be the reason of this "bug".


By the way thanks for the information.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)