Posts: 119
Threads: 10
Joined: Oct 2010
Reputation:
0
Why not use OnPlayerTakeDamage callback? You can check if the issuerid has the weaponid in his hands, if he doesn't, ban the playerid for fake kill hack.
Posts: 1,496
Threads: 78
Joined: Jun 2008
Reputation:
0
Check the distance, interior and virtual world between the 2 players, and also the weapon the killer is holding. Note that some death reasons are impossible to have a killer. Checking these things will be more accurate.
My system for that is quite accurate, and it can even detect fake death caused by SA-MP bug (for example, if A hits B, and then B commits suicide, the death reason will be A killed B, instead of committing suicide).
Posts: 6,129
Threads: 36
Joined: Jan 2009
Quote:
Originally Posted by Lorenc_
Noobish to ask but would you send it to me? Having to have this mod be on my server is my nightmare. Thanks.
|
That's err...pretty simple to make. Or better yet, you could check if the player is streamed in to the player.
pawn Code:
public OnPlayerDeath(playerid, killerid, reason) {
if(IsPlayerStreamedIn(playerid, killerid)) { // No need for a VW check, you don't stream in to other clients if they're in different VWs to you (presumably...)
if(GetPlayerInterior(playerid) == GetPlayerInterior(killerid)) {
if(GetPlayerWeapon(killerid) == reason) {
print("OH HERRO!!!1!1!1");
}
}
}
return 1;
}
Posts: 406
Threads: 16
Joined: Nov 2007
Reputation:
0
what if you shoot someone, and they jump off something after you're streamed out? (or /kill) that won't work.
I don't have a good solution for this, maybe you could use GetPlayerKeys or monitor ammo changes (and do an IsPlayerInRangeOfPoint for melee weapons, because they have infinite ammo.)
Posts: 6,129
Threads: 36
Joined: Jan 2009
Well, it depends really. It's a lot more reliable than having no checks at all.
Posts: 6,129
Threads: 36
Joined: Jan 2009
Read what I commented before I included the code, there's no way you can kill a player if they're not streamed in. This way, snipers' kills won't be ignored.
Posts: 6,129
Threads: 36
Joined: Jan 2009
So you're saying you would rather have it completely wrong than half right, basically?
Posts: 132
Threads: 11
Joined: Nov 2008
Reputation:
0
No I'm saying that I prefer not banning at all, than banning innocents.
Posts: 6,129
Threads: 36
Joined: Jan 2009
Quote:
Originally Posted by [ABK]Antonio
That's why you report it to admin and/or log it. That way it can be checked into.
pawn Code:
public OnPlayerDeath(playerid, killerid, reason) { if(IsPlayerStreamedIn(playerid, killerid)) { // No need for a VW check, you don't stream in to other clients if they're in different VWs to you (presumably...) if(GetPlayerInterior(playerid) == GetPlayerInterior(killerid)) { if(GetPlayerWeapon(killerid) == reason) { print("OH HERRO!!!1!1!1"); } } } return 1; }
Why are you checking if they have everything correct? I would check against it...Then have it auto-message admins..Besides that, you don't need to not be streamed in to fake kill...Just GetWeapon is good enough in that perspective.
Now you come to the point where, what if they have that weapon? That just breaks the entire thing...
|
Well, it was more along the lines of proof of concept, but you're right about checking against it.
If you read what I just wrote, you'll understand why I'm checking if the player is streamed in to the killer. This way we can determine whether the kill was actually possible - you can't kill someone if you're not streamed in to their client, but you can probably fake kill.
Quote:
Originally Posted by decondelite
No I'm saying that I prefer not banning at all, than banning innocents.
|
Who said anything about banning people?
Posts: 1,164
Threads: 20
Joined: Oct 2008
Reputation:
0
Store last damager id at onplayertakedamage and check if the killer id is that person. Works 99.9% of times, tested with hacks, there's only false positives when a person is killed by a fire and it makes the killer the person who set the fire, but onplayeratake damage counts as invalid player
Posts: 1,496
Threads: 78
Joined: Jun 2008
Reputation:
0
I doubt it, although I haven't tested it. Seems that SA-MP also make use of the callback there. If SA-MP itself can show fake deaths, so are the callback.
Calgon: I remember that the cheat can only apply fake deaths for players that are streamed in, making the check of IsPlayerStreamedIn useless.