• Simple Prop Protection
    779 replies, posted
hmm found a bug, I think: the PlayerDisconnected hook is only called for players who disconnect gracefully. this means that the props of players who time out are not cleaned up had this problem in wiremod too not long ago. I worked around by using EntityRemoved hooks instead. That's a bit wasteful, but it works... [editline]01:49PM[/editline] the docs should read Player:CPPIGetFriends() and yeah, Player:CPPIIsFriend(Player) if that's not too much effort :) it should return true if the two players are the same EDIT: oww, I just read the source code of that function. you should change your SPropProtection table to have a structure like this: SPropProtection[me:UniqueID()][friend:UniqueID()] = true/nil Then you can do this: [lua]function Player:CPPIGetFriends() if(SERVER) then local friends = {} for friendid,_ in pairs(SPropProtection[self:UniqueID()]) do local friend = player.GetByUniqueID(friendid) table.insert(friends, friend) end return friends else return CPPI_NOTIMPLEMENTED end end function Player:CPPIIsFriend(friend) if(SERVER) then return SPropProtection[self:UniqueID()][friend:UniqueID()] or false else return CPPI_NOTIMPLEMENTED end end[/lua] associative tables are faster to look up than iterating through all players and then iterating through all friends (table.HasValue iterates through the whole table to find something) Using UniqueID allows you to use player.GetByUniqueID to get a player entity from an ID. If you didn't know yet, a UniqueID is an ID that is generated from the IP in LAN mode and the steam id in internet mode. I can make you a patch if you want
How do I set this up to be off by default? Setting spp_check to 0 in the server config file didn't seem to work.
is there a way to make it unprotect buttons so people can use other peoples wire buttons?
just uncheck "use protection" under utilities/simple prop protection/admin
[QUOTE=Spacetech;6914481] Make yourself admin[/QUOTE] How?
Is this broken with a recent update? I'm getting reports of this not working on Spacebuild2, and DarkRP.
[QUOTE=faze;19100315]Is this broken with a recent update? I'm getting reports of this not working on Spacebuild2, and DarkRP.[/QUOTE] For the most part it seems to work fine for me (on sandbox) The only problem I am having with SPP is with the Addons [url=http://www.facepunch.com/showthread.php?t=731463]SolidVote[/url] and [url=http://www.facepunch.com/showthread.php?t=736509]hMaintenance.[/url] If you use their "clean up options" while using SPP, all the map/world props (buttons\doors\tracks) become ownerless, and the 1st player to use them becomes the owner. And when that player disconnects, after their props are auto cleaned, any world prop they have touched also gets removed. So on a map like [url=http://www.garrysmod.org/downloads/?a=view&id=66347]Trainconstruct2[/url], that causes a few problems when the track vanishes with them...
Hmmm... I have a suggestion... I think there should be an admin option that would allow players to choose to use prop protection or not to entirely, then also an opstion so if you want then you can allow players at their own choice to choose to use use protection or not, like this: Player On Off [x]----- [ ] [ ]Prop Protection -------- [x] [ ]Admins Can Do Anything [x]----- [ ] [ ]Use Protection [x]----- [ ] [ ]Entity Damage Protection [x]----- [ ] [ ]Physgun Reload Protection -------- [ ] [x]Admins Can Touch World Prop -------- [x] [ ]Disconnected Prop Deletion -------- [ ] [x]Delete Admin Entities Then basically if the server owner wanted, then the players can decide how protected they are, but also certain things that are serverwide can't be set to show up in the client menu.
is there a way i can remove the labels? in case i want to make a machinima with ragdolls.
I don't get any menus. Not in options or utilities. Did it break with a recent update? However my props are still protected. I don't get any HUD indication either. NVM I got it to work. I forgot to upload the .dua files to my webhost.
Although I in no way blame SPP for this as I've heavily modified both it and the rest of my server, I just thought I'd share a little silly detail. I have been debugging the source of my server's crashes for the past 3 hours, after applying the latest garrysmod update, and ended up finding removing both SBMP and SPP fixed the problem, but having either or both installed would crash the server with no error message the second a player fully spawned. Further debugging of SPP's sv_init.lua found that it crashed inside the function SPropProtection.PlayerInitialSpawn(ply). However, where it gets rediculous, is that adding prints fixed the problem. And I don't mean, shuffling all my addons around corrected some weird directory structure problems or anything. If I launch my server with function SPropProtection.PlayerInitialSpawn(ply) as is, I crash. If I add the line 'print("SPP Debug: Ravioli")' to it, right after SPropProtection.AdminReload(ply), the server doesn't crash. I have tested this 10 times now, changing nothing but the existance of that one line, and all 5 times that line existed, I loaded perfectly. All 5 times it didn't, I crashed. I tried Msg("Ravioli"), and MsgN("Ravioli"), but only using print would solve it. In my two years of coding lua for gmod, I have never encountered nor can I explain what could possibly be happening here. Thus, I certainly do not blame SPP, nor do I suggest a patch or anything (especially as SBMP had a near identical bug as well for me, though not Wiremod or my admin mod...). Its just the weirdest conclusion I have come to, following 3 hours of debugging: My server runs on Pasta.
Hi, recently with the last few Gmod updates i have noticed that simple pp has been having growing problems. The problems can range to simple pp not working at all or it only working for a short time. Is there any fix to this? i do have the latest version. Is there any other prop protection addons other than falcons prop protection?
[QUOTE=ayre10;22264597]Hi, recently with the last few Gmod updates i have noticed that simple pp has been having growing problems. The problems can range to simple pp not working at all or it only working for a short time. Is there any fix to this? i do have the latest version. Is there any other prop protection addons other than falcons prop protection?[/QUOTE] Are there any lua errors in your console? Nothing should stop this from working.
Nope, no errors.
I found this error when looking in my server logs. Hook 'SPropProtection.PhysgunPickup' Failed: addons\simplepp\lua\spropprotection\sv_init.lua:264: Infinite Loop Detected!
Bump. This error effects prop protection, any ideas?
I don't know how that is possible, it's just querying a sql row.
[QUOTE=Spacetech;22682417]I don't know how that is possible, it's just querying a sql row.[/QUOTE] Well I kind of lied but its the only error im getting that explains why my copy of your prop protection decides to not work after of while of the server being online. I don't have that many addons at all on my server so I doubt anything is conflicting. I can even show you if you want?
how to make me admin? the link is broken.
PP has reached the point of not working at all. Please look into this ASAP.
wow... thats an extreemly useful post... how about stating any errors you get or try removing your addons and finding which one conflicts with this addon. Or just a fresh install of Gmod :D always a good start.
Nothing is conflicting, I get no errors, I've even started the server off with a clean slate. It just doesn't so anything anymore. All it does at this point is show who owns what props.
It's not hugely important, but I would like to see some sort of optional checkbox menu underneath the current toolgun stuff, that allows setting what specific friends are able to do. For example, a server that doesn't allow using of other people's stuff. I would like to be able to enable "using" for some people, but not allow everything. This would allow people to co-pilot my vehicles and use any buttons I have made, but won't allow them to unfreeze/physgun/toolgun my stuff. But because it's optional, all options would be enabled by default when you add someone to your friends. Kinda like how the advanced button on Easy Precision drops down the extra options.
[QUOTE=Spacetech;6914481][u][b][highlight]Simple Prop Protection by Spacetech[/highlight][/b][/u] Simple Prop Protection is the all-in-one prop protection everyone needs. With it's friend system to extensive admin panel everything you need is just a click away. SVN is required. If you don't have svn [url=http://www.facepunch.com/showthread.php?p=13583073]read this tutorial[/url] [b]Download & Installation[/b] [list=1] [*]Create a folder in your addons directoy called "Simple Prop Protection" [*]Right click the folder and hit SVN Checkout. For the url enter: [url]http://simplepropprotection.googlecode.com/svn/trunk/[/url] [*][url=http://www.garrysmod.com/wiki/?title=Admin#Dedicated_Servers]Make yourself admin[/url] [*]Restart gmod [/list] [b]Information[/b] [list] [*]Full protection from anyone trying to remove your props (No more remover exploits!) [*]This actually protects everything you you spawn from adv dupe! [*]A working friend system configurable from spawnmenu->Utilities->Simple Prop Protection [*]Friends are saved on disconnect and server restart [*]Only admins can see the admin only panel [*]Prop Protection - No one can touch your props (besides admins or friends). [*]Use Protection - No one can use your props (no more people turning your life support off :D). [*]Entity Damage Protection - Your entitys cannot be damaged by anyone besides you. [*]Physgun Reload Protection - No more "WHO UNFROZE MY CONTRAPTION". [*]Disconnect Prop Deletion - When you disconnect your props will be deleted. [*]Everything I said above can be turned on/off in an admin panel, as well as cleanup disconnected player props and per player cleanup buttons. [*]Entities spawned by the game just as your server turns on is auto-owned to the world (anti-stargate owning). [/list] [b]Credits[/b] [list=1] [*]»?g« Failcake: Helped beta test [*]Tomato3017: Helping me beta test this in his server and for random function help. [*]Kevin!: Let me use his server for testing. [/list] If their are [b]any bugs[/b] please tell me so I can fix them.[/QUOTE] hahahahaha this program owns EPS in google fight! Also, GREAT PROGRAM!
What the hell, How do I make myself admin!??
@David: Adminness is entirely unrelated to SPP, but you can set yourself to be an admin by editing the /garrysmod/settings/users.txt file of the server and adding your steamid to the list (like how Garry shows). To get your steamid, type 'status' in console when on a server.
Using this within my server, some reason it'll show who owns the prop, but won't let you tool it or pick it up. No errors.
...you know thats part of the protection right ? o.O
[QUOTE=meeces2911;23389976]...you know thats part of the protection right ? o.O[/QUOTE] No, i'm pretty sure it's the addon. I'm sure you are allowed to pick up your own props. I've tried turning off every setting.
hey guys im sorry to bump this thread but i have a relevant question is this prop protection system still viable to use on servers or has better come out to replace this?
Sorry, you need to Log In to post a reply to this thread.