Throw a prop and make it hit another prop before killing someone.
Assuming that you can't knock other people's props with your own, would this work? :
[lua]
hook.Add( "EntityTakeDamage", "ETD", function( ent, dmginfo )
if ( ent:GetClass() == "prop_physics" ) then // or any other type of prop that you'd like to add in
while (true) do
if ( ent.lastTouched && IsValid( ent.lastTouched ) && ent.lastTouched:IsPlayer() ) then
// Take action
break;
elseif ( ent.lastContact && IsValid( ent.lastContact ) ) then
ent = ent.lastContact;
else
// Nothing was found
break;
end
end
end
end);
[/lua]
ent.lastTouched is the player that last grabbed the prop with a physgun.
ent.lastContact was the last prop to touch this prop.
I thought the entire point of your script was that people [i]could[/i] knock other people's props with your own.
Why would you want that?
Even so, you could make it so that a prop that collides with another that don't share owners has to be held with a physgun to have any physical effect.
My only argument is that it may be difficult, but we're modding Garry's mod. It's not going to be impossible.
[QUOTE=Netheous;39788836]
+If you want them not to be able to throw props
[lua]function AMS.PropKill( ply, ent )
if not IsValid(ent) then return end
ent:SetPos(ent:GetPos())--That trick resets velocity
end
hook.Add("PhysgunDrop", "Anti PropKill", AMS.PropKill)[/lua][/QUOTE]
This seems like the best solution..
[QUOTE=>>oubliette<<;39847421]Why would you want that?
Even so, you could make it so that a prop that collides with another that don't share owners has to be held with a physgun to have any physical effect.
My only argument is that it may be difficult, but we're modding Garry's mod. It's not going to be impossible.[/QUOTE]
It is impossible. Here's evidence:
premises:
Lua can only use the owner of a prop, the people who physgunned the prop and the entities the prop killing prop has touched as ways to find out the prop killer.
consider the following situation:
1. player A spawns prop X on the roof of the map
2.prop X falls down
3. Player B is holding prop Y
4. Prop X hits prop Y in its fall
5. prop X lands on Player C with C =/= A
Now who is the prop killer?
options:
- Player A because he purposefully spawned prop X above player C
- Player B because he purposefully pushed prop X into Player Z using prop Y
- Player Z because he saw prop X being spawned and purposefully walked under it to blame player A for prop killing
- A random player D who knew player A was going to spawn a prop, prop pushed player C under prop X. A variant of this is player D telling player C over the microphone to go under the prop
- No one purposefully prop killed player C. Player A was spawning the roof of his base, player B accidentally pushed it away whilst moving his contraption and Player C was at the wrong place at the wrong time.
Regardless of which player is the prop killer, in ALL three cases it looks exactly the same in Lua. the owners of the props are the same, the whole chain of entities that touched the prop killing prop X is the same.
Therefore, any script that would point at either player A OR player B OR player C OR player D has a chance > 0 of being wrong.
THEREFORE it is impossible to make a prop kill detection script that accurately points at the right person to be the prop killer with any or a combination of the information in the premises.
This is a proof guys. to nullify my claims you can mess with the premise and find a new variable to find out who the prop killer is (honestly doubt you will find it).
You can also nullify my proof by proving that the prop killer CAN be accurately found (without the possibility of being wrong)
[QUOTE=>>oubliette<<;39847421]
My only argument is that it may be difficult, but we're modding Garry's mod. It's not going to be impossible.[/QUOTE]
I've done something similar to what you're attempting, and it is impossible to properly detect. There's no hook that gets called when an entity touches another - EntityTakeDamage isn't called every time and therefor is not reliable.
[QUOTE=.\\Shadow};39851956]I've done something similar to what you're attempting, and it is impossible to properly detect. There's no hook that gets called when an entity touches another - EntityTakeDamage isn't called every time and therefor is not reliable.[/QUOTE]
[url]http://wiki.garrysmod.com/page/GM/ShouldCollide[/url] ?
I'll put together a bit of code tonight, I'm sure this isn't "impossible".
[QUOTE=>>oubliette<<;39852015][url]http://wiki.garrysmod.com/page/GM/ShouldCollide[/url] ?
I'll put together a bit of code tonight, I'm sure this isn't "impossible".[/QUOTE]
That will allow everyone to walk through any prop, unless we:
a) Check if the prop is being hold;
- Just throw the prop at a player. Still able to propkill
b) Check the speed of the prop;
- Props don't need speed to kill, you can still kill by rotate a large prop near a player .. ect.
c) Disable the damage caused by any props and the world
- This might be one of the best solutions, tho' people can still proppush and now able to 'trap' players.
Solution: Make a new build-system and remove the OP-physgun in the first place. You can make the player see a ghost of the prop and check if it interacts with any players, before he/she can placing it down.
[QUOTE=>>oubliette<<;39852015][url]http://wiki.garrysmod.com/page/GM/ShouldCollide[/url] ?
I'll put together a bit of code tonight, I'm sure this isn't "impossible".[/QUOTE]
Test your script against my evidence. if it points at any player, it has the possibility of being wrong and thus being useless.
if it doesn't point at any player at all, it is incomplete, making it possible to prop kill without getting detected.
That is of course if your script is consistent with the premise.
[QUOTE=>>oubliette<<;39852015][url]http://wiki.garrysmod.com/page/GM/ShouldCollide[/url] ?
I'll put together a bit of code tonight, I'm sure this isn't "impossible".[/QUOTE]
This gets called more often than just when one entity touches another.
[QUOTE=FPtje;39852169]Test your script against my evidence. if it points at any player, it has the possibility of being wrong and thus being useless.
if it doesn't point at any player at all, it is incomplete, making it possible to prop kill without getting detected.[/QUOTE]
What if it prints that player A,B and C are all at fault and explains the actions involved of the death of player C.
[QUOTE=theVendetta;39852418]What if it prints that player A,B and C are all at fault and explains the actions involved of the death of player C.[/QUOTE]
Interesting idea, but based on the information that Lua can provide, no prop killer can be accurately identified (my proof). If this information is all an admin has, he too, can not come to an accurate decision. He would still need to spectate to find out which of the three is the actual prop killer.
Actually if the script prints everyone involved, it might as well print every player currently playing in the server. To show this, I've expanded the evidence to cover "No one is at fault" and "a random (seemingly) uninvolved player is at fault"
[quote]- A random player D who knew player A was going to spawn a prop, prop pushed player C under prop X. A variant of this is player D telling player C over the microphone to walk under the prop
- No one purposefully prop killed player C. Player A was spawning the roof of his base, player B accidentally pushed it away whilst moving his contraption and Player C was at the wrong place at the wrong time.[/quote]
You can ignore the "telling over the microphone" bit, it's for complete correctness of the evidence.
The situation:
player D prop pushes player C under Prop X, causing player C to be killed by player D. Players A and B are unaware of the situation (until player C dies).
If the script prints everyone involved, it would print players A, B, C and D.
But if the script detects people prop pushing other people, you'd have the following dilemma (this is gonna go deep :V:)
1. Player D was holding a prop
2. Player D was prop pushed by player E
3. Player D then prop pushes player C under prop X
Player E could be the end responsible for player C's death, but he doesn't have to be because player D might still have had the intent to get player C prop killed. But, if you want to print everyone involved, you HAVE to print player E.
There you go, you would print players A, B, C, D and E.
I could go on and think of situations where you'd print the names of everyone in the server:
How about Admin F who teleports player C under prop X?
[QUOTE=FPtje;39852634]...[/QUOTE]
I have just thought of the ultimate solution; remove all players and only let scripted bots play, as it seems that free will is clearly the issue.
I could use this aswel, which from these scripts work & where do I put them? thank you
[QUOTE=3nforc3r;39852707]I could use this aswel, which from these scripts work & where do I put them? thank you[/QUOTE]
[QUOTE=Netheous;39788836]Here, you can use my script, it might be messy, I wrote it in a bus when plague of prop killers attacked my server and I had to write it immediately.
[lua]local AMS = {}
function AMS.PropDamage( target, inflictor )
if target:IsPlayer() and inflictor:GetClass() == "prop_physics" or inflictor:GetClass() == "prop_dynamic" then
return false
else
return true
end
end
hook.Add("PlayerShouldTakeDamage", "Anti PropDamage", AMS.PropDamage)[/lua]
Althought it doesn't work for bathtubs, sofas and a drawer (since it pushes you into ground so you take world damage instead of prop damage, either that or no fall damage lol)
+If you want them not to be able to throw props
[lua]function AMS.PropKill( ply, ent )
if not IsValid(ent) then return end
ent:SetPos(ent:GetPos())--That trick resets velocity
end
hook.Add("PhysgunDrop", "Anti PropKill", AMS.PropKill)[/lua][/QUOTE]
[QUOTE=theVendetta;39852666]I have just thought of the ultimate solution; remove all players and only let scripted bots play, as it seems that free will is clearly the issue.[/QUOTE]
My proof applies only to [i]detection[/i] scripts, not to prevention scripts.
The kind of approach you mention (in an exaggerated form) is the one prop kill prevention scripts take. Though effective, they also take away good gameplay mechanics.
Some reason that prevention scripts can be made reasonable, and that the things they take away are not [i]that[/i] crucial to gameplay. I disagree, but I'll be the first one to admit that prevention scripts aren't nearly as bad as detection scripts.
My opinion is the following:
- Never use detection scripts. They are the worst things ever. Correct detection scripts do not exist (see proof)
- Prevention scripts shouldn't be used, but if you have shitty admins that aren't involved in actually administrating, this is a reasonable last resort
- if anything, teach your admins how to spectate. [b]No[/b] script beats human eyes when it comes to prop killing.
Prop killing is only a good gameplay mechanic for prop killers.
But not all forms of prop damage are.
The majority are though, and the rest tend to be banned on RP servers to avoid the lag they cause.
What forms of prop damage cause lag?
Well iirc last time we discussed this hitting someone with your prop car was the only thing we agreed was a 'legitimate' form of prop damage.
We agreed? Where?
Prop cars is one, but there are others:
prop traps when someone enters a wrong keypad code
If you don't like traps, there's still committing suicide with props when you're stuck (so you don't have to call an admin)
If you don't care about that, prop damage is what causes most people to fail in prop surfing. They kill themselves and it's hilarious to watch.
There are accidents, which in DarkRP can cause hilarious situations. It's the hilarious situations that make DarkRP fun.
With prop damage, people won't get the idea to build a super fast prop elevator. They'll kill themselves.
Prop damage is an incentive to freeze a base. If you don't freeze your base, the base might kill you with a spazzing prop.
There was an admin mod that could smash a train on someone as punishment. If you disable entity damage, that'll stop working too.
What do you mean, the [i]only[/i] thing?
We had a very long conversation about this on steam at some point. I assume it ended with us agreeing on something?
As for your points
- You know my opinion on traps.
- If the owner has disabled the kill command then they clearly don't want people killing themselves via other methods
- Relying on someone to mess up is a terrible prevention method
- How does someone accidentally injuring themselves count as a hilarious situation?
- They'd only end up making a slightly slower prop elevator. I don't get this one
- Being able to walk in the server without elastic bounce back is a significantly better incentive than the quite low chance that one of your welded panels is going to suddenly become murderous.
- That killed people with Lua, the train was merely cosmetic (and nocollided so you couldn't avoid it)
Looks like this is really going to be a matter of opinion. I think some accidents are hilarious and you don't. That's not really worth discussing. I think that's something for server owners to consider when they install a prop kill prevention script.
The crucial point is that prop kill prevention scripts are going to change gameplay as it affects not only prop killing. Whether the downsides of these changes can be lived with really comes down to opinion. Our opinions are obviously different.
I'd rather have the server owners tell their admins to use spectate, others seem fine with the script.
I have any damage from DMG_Crush removed, and I have prop velocity reset when you stop physgunning, + props are no collided while physgunned. Virtually 0 side effects, and 0 prop kills.
I understand one anti prop kill measure, but why so many at once?
You say there are 0 side effects. Does the script apply to admins?
[QUOTE=Lexic;39852722][URL="http://facepunch.com/showthread.php?t=1251297&p=39852722&viewfull=1#post39852722"]Your post[/URL][/QUOTE]
sorry, but where do I put them? xd
[QUOTE=FPtje;39855838]I understand one anti prop kill measure, but why so many at once?
You say there are 0 side effects. Does the script apply to admins?[/QUOTE]
It does, but why would it matter? It would only take a few seconds to add !ply:IsAdmin() in there.
Just remove all damage delt via props..? no more prop killing! :D
Sorry, you need to Log In to post a reply to this thread.