Get attacker when player is killed by someone swinging a prop with their physgun

I don’t want to prevent propkilling damage, but I do want to find out when a player is killed as a result of someone else swinging a prop around with their physgun, and punish them accordingly. I’ve found surprisingly little about this problem by searching google. It’s not completely necessary to get the attacker if the prop was dropped on them, and they were killed while no one was holding the prop, but it would be nice if it found that as well.

I’m pretty sure you cant kill someone just by swinging it, you have to let it go. So in when it is let go (

GM/PhysgunDrop) record the player that is dropping it. Then when it kills someone, you can look up who dropped. HOWEVER THIS IS A BAD IDEA, it doesn’t work when people push one prop into another, hit props with their vehicles, or when they just spawn a prop in the air and it drops on someones head. Don’t rely on whatever you set up to be 100% evidence, just use the information to look it into further.

Players can drag around ragdolls, and are able to kill other players using that. Can I detect that?

Yeah use the same approach but do it when props are picked up instead of dropped. Record the player picking it up. When a player is killed, check if it was by a ragdoll, if it was being carried, and who by.

I’ll add some wiki links in a minute

The real problem comes in when a player pushes another players prop into someone.

I’m thinking about a system to draw blame on a player for indirect propkilling. Basically, whenever a prop is picked up by a player, it gets assigned a meta-value tag pointing to that player. If a prop collides with another prop, then the prop with the highest velocity prior to the collision pushes it’s ownership onto the other prop, assigning it a meta-value as well. As one last check, if a prop stops moving, then it’s ownership value is cleared. I’ve got everything down except for how to efficiently check if a prop stops moving; I made a separate post about it earlier.

[editline]11th March 2015[/editline]

This also applies to if a player spawns a prop, or picks it up via any other means, ie. with their gravity gun or with their hands.

Holy shit, lock this thread before FPtje gets here, he will lose his shit.

It is never ever ever a good idea to use any sort of prop kill detection system, ever.
Trust me, it will never be 100% accurate. Just give up, please for the love of god don’t even bother.

Please, listen to this advice, before, he comes…

[sp] FPtje will probs give you a really good lecture about it if he sees this, he’s really great, and I’m saying, you really should just not do it and avoid this issue, and save his and others time. [/sp]

Do yourself an favour and don’t do it. Minges aren’t that stupid anymore. There are more enought ways to trick your system. FPtje, like AnonTakesOver, can show you how easy.
The ultimate Solution for that is to have good, trustworthy Admins.
That is the Only, i repeat, the only real solution without any downsights.

Anon is right. This is one of the few things that makes me lose my shit. It’s so bad even that I bookmarked my main argunents:

Every prop kill detection script has errors. It’s impossible for them not to have errors (see thread for watertight evidence)
These errors are easily exploited by clever people to make it put the blame of a purposeful prop kill on innocent people.

There is no way to fix it and there is no way around it. Making a detection script automatically kick or ban will give minges the ability to kick anyone. I’ve seen this happen.

The idea then is to just tell the admins about the prop kill and have them decide. This is equally retarded. You’d be expecting admins to decide who the prop killer is even though the admin has even less information than the script itself. I’ve got a video on my channel in which such script is abused to make an admin ban an innocent person. Even with a huge warning that the script is terrible, doesn’t ever know anything for sure and is made by an idiot doesn’t fix the problem that I show in that video.

[editline]11th March 2015[/editline]

On my server, we did have a propkill protection script. However, we also gave every member of staff access to the spectate command. The idea was not to ban people straight away, but to watch them and see if they keep propkilling on purpose. We never banned people just because of the propkill logging.

The problem is that it’s really hard to find out how many innocent people are banned. Do you trust your admins to never rely on the prop kill messages for any information?

Your video is very exemplary of the problem with most propkill detection scripts, FPtje, and I can see why that particular script would be a problem. But that problem would not arise in the system that I suggested, and I hope you could see why. The reason is that with my method, it’s not individual props themselves that are attributed to player kills, which is a faulty method of checking, but rather the prop’s momentum that is attributed to player kills. With my system, the above cheat shown in the video would not work, and only display the exploiter as killing themselves, because they were the one to impart momentum onto the prop and cause it to do enough damage to kill.

You people are preaching how horrible it would be to implement a propkill script, and how much it could be exploited. Well, if you think it’s a bad idea, then tell me; how would you exploit a script built around my system? Give me specific examples please, before criticizing and chastising me.

Well you’re not clear.

I can only guess that you mean “the one that caused the prop to have momentum”, by which I can only guess you mean the last person who physgunned it, valid until velocity is zero. That can be bypassed by pusing a prop that a player dropped somewhere into another player. In a way that’s just redirecting the “thrown” prop.

Give me a specific pseudo algorithm and I might actually not have to guess what you mean. Please describe the steps between getting the momentum of a prop (ent:GetVelocity()) and pointing to a specific player.

[editline]11th March 2015[/editline]

Do you mean killing people while still holding the prop with physgun? Well that won’t work unless people are trying to kill with welded props. Props that you’re holding with the physgun don’t do damage.

I am referring to the psuedo-algorithm I posted earlier in this thread. I’ll paste it here, since you can’t be bothered to go back up and look for it;

[editline]11th March 2015[/editline]

Obviously, the algorithm should be more complicated; all props that are constrained to eachother ought to share a common ownership meta-tag, and props should also have their tags set if a player simply jumps on top of or runs into a prop.

I meant that I didn’t understand either post, but based on your last paragraph you’re still using ownership.
Ownership doesn’t work. See proof posted in link.

“Based on my paragraph, you’re still using ownership”, ie. I mentioned the word a couple times. Did you even read the psuedo-algorithm? Props don’t have definite ownership; they instead carry blame. It is easily subverted and lost quickly, and only exists while the prop is in motion.

You didn’t even bother to provide a specific example; you’re just preaching rhetoric so you don’t have to deal with my argument.

Of course I read it. I think I understand now. Drop prop -> set blame. Velocity 0 -> remove blame.
Getting around it: push prop before the velocity hits 0. The blame will still be put on the person who dropped it.

Also, don’t jump to conclusions too quickly. I genuinely have a hard time understanding when you want to store what on which props and how you use that data. I can think of counterexamples really easily.

[editline]11th March 2015[/editline]

Highest velocity prop push priority doesn’t work because you can nudge a fast prop in the right direction. Nudge of course with a lower velocity.

[editline]11th March 2015[/editline]

Also, wire forces can probably make someone else’s prop move without touching it. You’d have to hook into that, e2 functions and other wire stuff to fix that.

[editline]11th March 2015[/editline]

Actually, my original proof shows your algorithm to be unsound with a tiny change:

Replace step 1 with “drops a prop with the physgun” instead of spawning it. Also note that prop Y has a lower velocity than prop X at the time of collision, so the tag wouldn’t come from Y.

[editline]11th March 2015[/editline]

Also, isn’t your idea the same as oubliette’s here?

He also tags the prop on drop and based on the entities touched. I believe he expands it in later posts to reset on 0 velocity and uses the same highest velocity heuristic.

[editline]11th March 2015[/editline]

Please read the rest of the thread. Imagine you’re oubliette in that thread. He went really far in writing the algorithm. It pointed towards multiple players when not sure, it walked down multiple branches of collisions, building up a whole tree. Post 80 is your idea plus a load of that fancy shit and it still didn’t work.

In post 88 he gives up.

I’ve proven it to be impossible. No matter how clever you make the algorithm, it’s as impossible as the halting problem which I also explain in that thread. The proof is logical, not anecdotal.

Under the situation you linked, yes, it’s very ambiguous. But I don’t aim to cover those cases; they are so rare, few, and far in between that the actual outcome has very little significance on the overall picture. That situation couldn’t even be used for exploitation; it would be immensely difficult to recreate purposely, and if it was, the majority of attempts to do so would end up with the intended exploiter being blamed anyway under the suggested system.

Yes, this script might reach ambiguities, and occasionally place blame on the wrong person 1 in every 100 or more cases. As you’ve stated, the ambiguous nature of intent and complex physics simulation ordains it as such. But it is nonetheless incredibly difficult to exploit for an unfair purpose, as opposed to the one shown in the video. Is there a case where it would be easier to trick my script into blaming the wrong individual purposefully than in the one described in the video?

[editline]11th March 2015[/editline]

Here’s some psuedocode I’ve whipped up to better explain my script;

function calledPlayerInteractsWithPhysObj(ply, object)
	object.owner = ply

function calledEveryQuaterSecond()
	for prop in allProps do
		if prop:IsAsleep() then
			prop.owner = nil

function calledTwoEntitiesCollide(entone, enttwo)
	if entone.owner == nil then
		entone.owner = enttwo.owner
	elseif enttwo.owner == nil then
		enttwo.owner = entone.owner
		if entone:GetVelocity() > enttwo:GetVelocity() then
			enttwo.owner = entone.owner
			entone.owner = enttwo.owner

function calledPlayerKilled(player, attacker)
	if attacker:IsPhysicsObject() and attacker.owner ~= nil then
		print(player .. " killed by " .. attacker.owner)
		print(player .. " killed by " .. attacker)

I hope it explains my intent more clearly.

If an individual figures out that you are blaming a user you could easily create an e2 to exploit your unlikely scenario. You may also cause users to join your server just for a challenge to get as many people banned without getting caught. You shouldn’t do it just because it is unlikely, someone will do it and you may lose a large percentage of your population over it.

An e2 that interacts with props would obviously relay blame from the e2’s owner, via applyForce methods. So that’s not an issue.
It’s unlikely because it’s difficult to recreate, as I’ve stated above. For the situation to ever arise on purpose, two players would have to be cooperating, and at least one of them would end up getting blamed from the result, so there’s nothing to gain for them.
And by the way, if a player is spawning props on the ceiling of the map, then they’re probably deserving of any blame they take for killing people with said props.

[editline]11th March 2015[/editline]

The reason I believe so much in my method, is because even such a complex device as a long-winded rube-goldberg machine with 30 individually interacting parts would still theoretically succesfully relay blame from the first person who set it off to the final piece that kills whoever is standing at the end of it. Every single physics prop interaction relays the blame from the initiator to the next object, which in return interacts with the next one, which follows suit all the way through to the end where proper blame is placed. I also believe in it, because if someone were to spawn every single prop on a map, and have people run around propkilling with them, then as long as the spawner secludes themselves they would never be given blame for any actions, because they never acted upon any of the props after spawning them.
Also, I don’t plan on banning people who propkill; this is only to aid me in discouraging it when it occurs, and assisting other plugins I have that work with when players kill eachother intentionally.