ULX

Author Topic: Question about sv_allowcslua.  (Read 2525 times)

0 Members and 1 Guest are viewing this topic.

Offline Monskiller

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
Question about sv_allowcslua.
« on: April 27, 2016, 02:17:43 PM »
Is it possible to allow clientside lua for a specific group/rank with ULX?
I'd like to allow trusted people the ability to load their custom HUDs. And restrict it from everyone else.

Offline roastchicken

  • Respected Community Member
  • Sr. Member
  • *****
  • Posts: 476
  • Karma: 84
  • I write code
Re: Question about sv_allowcslua.
« Reply #1 on: April 27, 2016, 02:41:41 PM »
Unless there is another way (while sv_allowcslua is set to 1) to prevent clientside lua to be run, I'm going to guess no as it is a server-side cvar meaning it will apply to all players.
Give a man some code and you help him for a day; teach a man to code and you help him for a lifetime.

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: Question about sv_allowcslua.
« Reply #2 on: April 27, 2016, 04:13:37 PM »
roastchicken is correct here. There's no way (that I know of) to do this.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Question about sv_allowcslua.
« Reply #3 on: April 27, 2016, 07:08:44 PM »
After all is said and done though, someone writing a modular / changeable multiple choice server controlled HUD system is an awesome project idea.
Gamemode HUDs are controlled server-side for connecting clients, who's to say there isn't some way to allow different ones?
At worst, the player would have to re-connect to initialize maybe. At best, change on the fly.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Monskiller

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
Re: Question about sv_allowcslua.
« Reply #4 on: April 28, 2016, 04:10:42 AM »
After all is said and done though, someone writing a modular / changeable multiple choice server controlled HUD system is an awesome project idea.
Gamemode HUDs are controlled server-side for connecting clients, who's to say there isn't some way to allow different ones?
At worst, the player would have to re-connect to initialize maybe. At best, change on the fly.

That would be awesome.
Allow players to code/upload their own custom HUDs. In sandbox at least since on other gamemodes (TTT, DarkRp, Murderer) could be used for cheating.
It's the only reason I would want sv_allowcslua.

Offline roastchicken

  • Respected Community Member
  • Sr. Member
  • *****
  • Posts: 476
  • Karma: 84
  • I write code
Re: Question about sv_allowcslua.
« Reply #5 on: April 28, 2016, 08:18:42 PM »
If my memory serves me correctly, there was (and maybe still is) a script on ScriptFodder that had some HUD-switching functionality but I think it was only for TTT. I don't think it would be very difficult to make a simple Derma menu to switch between different HUDs. I guess theoretically you could allow players to run custom lua via a menu element and Player:SendLua or the net library but that would be extremely vulnerable to exploitation. I think the best way would be to have players send lua code to you so you can vet it, and then add it to a list of options in a HUD-switcher of sorts.
Give a man some code and you help him for a day; teach a man to code and you help him for a lifetime.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Question about sv_allowcslua.
« Reply #6 on: April 28, 2016, 08:33:11 PM »
I'm with roastchicken.
You do not want end users just running random code, HUD or not.
My general idea was along what it sounds like roastchicken possibly saw elsewhere - the server owner controls all HUDs, and simply allows players to choose/change between them.
"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
Re: Question about sv_allowcslua.
« Reply #7 on: April 30, 2016, 10:00:09 AM »
You could look at ulx luarun and adopt it to your use.
Experiencing God's grace one day at a time.