ULX

Author Topic: DarkRP re: Urestrict - and anything else DarkRP breaks  (Read 10969 times)

0 Members and 2 Guests are viewing this topic.

Offline ihasaaccount

  • Newbie
  • *
  • Posts: 1
  • Karma: -1
DarkRP re: Urestrict - and anything else DarkRP breaks
« 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.
« Last Edit: September 06, 2009, 09:31:52 AM by JamminR »

Offline jay209015

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 934
  • Karma: 62
    • Dev-Solutions
DarkRP re: Urestrict - and anything else DarkRP breaks
« Reply #1 on: September 06, 2009, 09:01:55 AM »
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.
« Last Edit: September 06, 2009, 09:05:46 AM by jay209015 »
An error only becomes a mistake when you refuse to correct it. --JFK

"And thus the downfall of the great ULX dynasty was wrought not by another dynasty, but the slow and steady deterioration of the leaders themselves, followed by the deprecation of the great knowledge they possessed." -Gmod, Chapter 28, verse 34 -- Stickly

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
DarkRP re: Urestrict - and anything else DarkRP breaks
« Reply #2 on: September 06, 2009, 09:37:56 AM »
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.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
DarkRP re: Urestrict - and anything else DarkRP breaks
« Reply #3 on: September 06, 2009, 12:44:34 PM »
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
Experiencing God's grace one day at a time.

Offline Drakehawke

  • Newbie
  • *
  • Posts: 38
  • Karma: 0
    • Serious Roleplaying Hell
DarkRP re: Urestrict - and anything else DarkRP breaks
« Reply #4 on: September 06, 2009, 01:09:00 PM »
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.

Offline jay209015

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 934
  • Karma: 62
    • Dev-Solutions
DarkRP re: Urestrict - and anything else DarkRP breaks
« Reply #5 on: September 06, 2009, 01:28:27 PM »
Simply look at my files compared to yours.
An error only becomes a mistake when you refuse to correct it. --JFK

"And thus the downfall of the great ULX dynasty was wrought not by another dynasty, but the slow and steady deterioration of the leaders themselves, followed by the deprecation of the great knowledge they possessed." -Gmod, Chapter 28, verse 34 -- Stickly

Offline Drakehawke

  • Newbie
  • *
  • Posts: 38
  • Karma: 0
    • Serious Roleplaying Hell
DarkRP re: Urestrict - and anything else DarkRP breaks
« Reply #6 on: September 06, 2009, 01:36:11 PM »
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.
« Last Edit: September 06, 2009, 01:58:03 PM by Drakehawke »

Offline jay209015

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 934
  • Karma: 62
    • Dev-Solutions
DarkRP re: Urestrict - and anything else DarkRP breaks
« Reply #7 on: September 06, 2009, 01:55:54 PM »
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
An error only becomes a mistake when you refuse to correct it. --JFK

"And thus the downfall of the great ULX dynasty was wrought not by another dynasty, but the slow and steady deterioration of the leaders themselves, followed by the deprecation of the great knowledge they possessed." -Gmod, Chapter 28, verse 34 -- Stickly

Offline Drakehawke

  • Newbie
  • *
  • Posts: 38
  • Karma: 0
    • Serious Roleplaying Hell
DarkRP re: Urestrict - and anything else DarkRP breaks
« Reply #8 on: September 06, 2009, 02:06:07 PM »
So wherever I find "return true" in the CanTool hooks, I change it to just "return"?

Offline Drakehawke

  • Newbie
  • *
  • Posts: 38
  • Karma: 0
    • Serious Roleplaying Hell
DarkRP re: Urestrict - and anything else DarkRP breaks
« Reply #9 on: September 07, 2009, 10:23:43 AM »
Ugh, just updated DarkRP for a different bug fix, the CanTool thing now does this:
Code: [Select]
...
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?

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
DarkRP re: Urestrict - and anything else DarkRP breaks
« Reply #10 on: September 07, 2009, 11:38:53 AM »
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.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline atomicspark

  • Full Member
  • ***
  • Posts: 196
  • Karma: 12
Re: DarkRP re: Urestrict - and anything else DarkRP breaks
« Reply #11 on: September 07, 2009, 01:36:30 PM »
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.

Offline jay209015

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 934
  • Karma: 62
    • Dev-Solutions
Re: DarkRP re: Urestrict - and anything else DarkRP breaks
« Reply #12 on: September 07, 2009, 02:29:57 PM »
...
Code: [Select]
...
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%
An error only becomes a mistake when you refuse to correct it. --JFK

"And thus the downfall of the great ULX dynasty was wrought not by another dynasty, but the slow and steady deterioration of the leaders themselves, followed by the deprecation of the great knowledge they possessed." -Gmod, Chapter 28, verse 34 -- Stickly

Offline atomicspark

  • Full Member
  • ***
  • Posts: 196
  • Karma: 12
Re: DarkRP re: Urestrict - and anything else DarkRP breaks
« Reply #13 on: September 07, 2009, 03:12:35 PM »
Ulysses RP?

I never understood the interest in RP gamemodes. It really just ends up being a cost system applied to weapons.

Offline Drakehawke

  • Newbie
  • *
  • Posts: 38
  • Karma: 0
    • Serious Roleplaying Hell
Re: DarkRP re: Urestrict - and anything else DarkRP breaks
« Reply #14 on: September 08, 2009, 03:38:32 PM »
Will URestrict still work with this hook within itself, or do I still need to make it just return?