Ulysses
General => Developers Corner => Topic started by: ihasaaccount on September 06, 2009, 07:47:17 AM
-
Please fix it so you can restrict your tools with Darkrp..
Please fix it so you can restrict your tools with Darkrp..
Please fix it so you can restrict your tools with Darkrp..
Please fix it so you can restrict your tools with Darkrp..
[NOTICE] - User was banned 7 days for this post. Once would have been plenty.
-
Ok, after a lot of research, I found the problem and came up with a solution.
In the attachment there are three .lua files.
physgunlimiter.lua
sv_gamemode_functions.lua
sv_init.lua
physgunlimiter.lua and sv_gamemode_functions.lua both go into your <server>/gamemode/DarkRP/gamemode folder and when prompted to replace say yes.
sv_init. lua goes into your <server>/gamemode/DarkRP/gamemode/SPropProtection and when prompted to replace say yes.
::EDIT::
For the record, this wasn't the fault of URestrict, the coder of DarkRP made the beginner mistake of returning true instead of just returning so other scripts don't get broken.
-
came up with a solution.
Best solution, don't use it.
We as a team have said it before, and I'll say it again.
We even have a news release in which there were several exploits for one of the versions.
DarkRP is rubbish. Each new release by totally different authors have made it just as much broken, if not more, than the last release by someone else.
It amazes me, as much as RP seems popular on Gmod, that a decent lua coder hasn't made an RP game mode from scratch.
-
Best solution, don't use it.
We as a team have said it before, and I'll say it again.
We even have a news release in which there were several exploits for one of the versions.
DarkRP is rubbish. Each new release by totally different authors have made it just as much broken, if not more, than the last release by someone else.
It amazes me, as much as RP seems popular on Gmod, that a decent lua coder hasn't made an RP game mode from scratch.
I don't think many decent coders like RP. :P
-
Could you please post exactly what you did to those files? I have customized DarkRP loads and also im using the SVN version by Falco, which uses FPP (Falco's Prop Protection), so it may be different. Sorry to be a pain.
-
Simply look at my files compared to yours.
-
Yes but, for me, physgunlimiter.lua and sv_init.lua dont exist. Im currently going to make the changes to sv_gamemode_functions.lua, and see if that helps.
-
Well, look anywhere that the author calls the CanTool hook and see if it returns true anywhere and if it does, make it just return
-
So wherever I find "return true" in the CanTool hooks, I change it to just "return"?
-
Ugh, just updated DarkRP for a different bug fix, the CanTool thing now does this:
...
end
return GAMEMODE:CanTool(ply, trace, tool)
end
hook.Add("CanTool", "FPP.Protect.CanTool", FPP.Protect.CanTool)
Do I still have to make it just return? Or will it work now?
-
Ugh. The more I see darkRP code, the more I cringe.
Drake, the DarkRP advice is far beyond the scope of this discussion for URestrict.
I'm splitting the conversation to the Developer's corner forum area.
-
Ok, after a lot of research, I found the problem and came up with a solution.
In the attachment there are three .lua files.
physgunlimiter.lua
sv_gamemode_functions.lua
sv_init.lua
physgunlimiter.lua and sv_gamemode_functions.lua both go into your <server>/gamemode/DarkRP/gamemode folder and when prompted to replace say yes.
sv_init. lua goes into your <server>/gamemode/DarkRP/gamemode/SPropProtection and when prompted to replace say yes.
::EDIT::
For the record, this wasn't the fault of URestrict, the coder of DarkRP made the beginner mistake of returning true instead of just returning so other scripts don't get broken.
Just in case you didn't know this already, Garry's Mod has a "physgun_limited" console command that when set to "1", protects world entities. I have only tested it on doors, but it seems to work very well. It doesn't even let you attempt to grab it, almost like the door isn't there. It's a nice feature to have enabled just in case your prop protection or gamemode script decides to implode.
-
...
...
end
return GAMEMODE:CanTool(ply, trace, tool)
end
hook.Add("CanTool", "FPP.Protect.CanTool", FPP.Protect.CanTool)
...
- Is this just me or is he calling a hook within itself?
Ugh. The more I see darkRP code, the more I cringe.
...
- Agree 100%
-
Ulysses RP?
I never understood the interest in RP gamemodes. It really just ends up being a cost system applied to weapons.
-
Will URestrict still work with this hook within itself, or do I still need to make it just return?
-
Drake, difficult to really know.
Worth trying.
Problem is, with the way DarkRP is coded, if you change it to only 'return', you may break it or other scripts.
Tip for all Gmod lua coders - returning anything, even 'true', breaks 99% of most Gmod standard hooks.
It will in most cases prevent any other hook of the same type in other scripts from running.
Yes, sometimes that is wanted (returning false, etc), but in most you don't.
There are exceptions to this rule of course, but, not many.
-
Been very busy lately, and ive finally got round to trying to fix this.
Making all the CanTool functions not return at all, URestrict still dosn't work.
Making all the CanTool functions just return, URestrict Works :), Prop Protection breaks completely :-\.
Any ideas?
-
Any ideas?
Find a better coded RP script? :/
Sorry, DarkRP just isn't coded well, and has been rehashed so many times by so many attempts of people who thought they could do better, that often didn't I'm betting, that I'm not sure a version exists that doesn't have major flaw somewhere.
Is there one out there?
I've no idea.
What Prop protect do you use? Are you talking of DarkRPs?
Did you edit your prop protect too?
Returning something sometimes is a good thing...just not as often as many seem to do.
-
Im using FPP (Falco's Prop Protection), Falco being the current updater of it. It comes with the DarkRP SVN, but you can download it seperately.
I have edited it as Jay told me to make any CanTool function not return true.
A guy on the DarkRP thread told me that he had got URestrict working without having to edit FPP, and only the CanTool in sv_gamemode_functions, this is the next thing im going to try.
-
Nevermind all of this, Falcos about to release an update to DarkRP with the ability to restrict tools to admins or superadmins.
-
You know Falco's steam nick?
-
No, I don't. But whatever he does to make his system work, should also automatically make URestrict work.
http://www.facepunch.com/showthread.php?t=778336&page=21
Thats the DarkRP thread, you can speak to him through there, his name on Facepunch is FPtje.
-
i think changing:
ur.config["loadouts"] = true
to
ur.config["loadouts"] = false
The loadouts seem to be giving me the problems. like if you disable them all with the GUI in the game people can spawn guns but with it enabled no one spawned with keys, arrest stick, and so on. disabling this may be the trick ill let you know tomorow
not sure on that one.
-
That wont help at all, it would just reverse the effects of disabling it in the gui. To make it work, you have to add the keys, arrest stick, .... to the loadouts.