How to detect if a entity through adv dup was spawned
11 replies, posted
There is this ongoing problem with my server where any player can come in and spawn a nuke (if they have adv dupped a rocket or something from the nuke pack). I have been trying and trying but have failed. I was wondering how I would be able to detect if a player has spawned a rocket (from nuke pack) through a dup and ban/kick and remove the rocket or what ever was spawned.
PS Use sent_nuke_missile for examples as that is the rocket that is spawned.
Remove the nuke pack from the server???
Thats no fun... lol
I still want the Nuke Pack but I want to make sure you can't spawn it through adv dup even if your not admin.
Try this:
[lua]
function DeleteNukes( prop )
if ( prop:GetClass() == "sent_nuke_missiles" ) then
prop:Remove()
end
end
hook.Add( "OnEntityCreated", "DeleteNukes", DeleteNukes )
[/lua]
Untested, not sure if it works.
[QUOTE=MightyHaku;22709674]Try this:
[lua]
function DeleteNukes( prop )
if ( prop:GetClass() == "sent_nuke_missiles" ) then
prop:Remove()
end
end
hook.Add( "OnEntityCreated", "DeleteNukes", DeleteNukes )
[/lua]
Untested, not sure if it works.[/QUOTE]
How would I be able to get the owner of the nuke?
[b][url=http://wiki.garrysmod.com/?title=Player.IsAdmin]Player.IsAdmin [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] for user groups or if you want to check by steam id, [b][url=http://wiki.garrysmod.com/?title=Player.SteamID]Player.SteamID [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]
From what I understand (correct me if I am wrong), OnEntityCreate doesn't return the player who spawns it. It only returns the prop in which was spawned. How would I get the owner of the prop that was spawned?
What prop protection system are you using?
FPP (Falco's Prop Protection)
[QUOTE=Aaron113;22769573]FPP (Falco's Prop Protection)[/QUOTE]
i has the same problem "as" you :(
So is anyone going to even try or think about helping? These forums seem horrible for help.
Hmm, well you could if you wanted just disable the adv dupe upload if using the one with wiremod. But presuming you wanted to keep uploads, I'd say look at the wire e2 code libraries. As there is an e2 function that checks if something is duped and returns a boolean.
I'll look into it when I'm home, as at the moment posting from my phone and have access using RD.
[editline]06:05PM[/editline]
Hmm, well you could if you wanted just disable the adv dupe upload if using the one with wiremod. But presuming you wanted to keep uploads, I'd say look at the wire e2 code libraries. As there is an e2 function that checks if something is duped and returns a boolean.
I'll look into it when I'm home, as at the moment posting from my phone and have access using RD.
Sorry, you need to Log In to post a reply to this thread.