23.12.2011, 02:57
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:
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...
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
}
}
}
anyway.. discuss...