Author Topic: Custom URL links that can be edited via the ULX admin panel  (Read 1821 times)

0 Members and 1 Guest are viewing this topic.

Offline elfnet_gaming

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
Ok so I got this code

Code: [Select]
CATEGORY_NAME = "Our Community"

//Our Website
function ulx.website(ply)
ply:SendLua([[gui.OpenURL("URL your website Here")]])
end
local website = ulx.command( CATEGORY_NAME, "visit website", ulx.website, "!website" )
website:defaultAccess( ULib.ACCESS_ALL )
website:help( "Displays our Website." )

// Youtube Channel
function ulx.youtube(ply)
ply:SendLua([[gui.OpenURL("URL to your Youtube channel here")]])
end
local youtube = ulx.command( CATEGORY_NAME, "visit youtube", ulx.youtube, "!youtube" )
twitter:defaultAccess( ULib.ACCESS_ALL )
twitter:help( "Visit our Youtube Channel." )

What I want to do here is have this where I can change the URL for this button via the admin level panel in ULX. Is that possible?

Thanks guys

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: Custom URL links that can be edited via the ULX admin panel
« Reply #1 on: July 25, 2018, 11:44:27 PM »
No, I don't think there's a way to add more data fields to the XGUI menu. Stickly can correct me on this if I'm wrong..

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Custom URL links that can be edited via the ULX admin panel
« Reply #2 on: July 26, 2018, 08:37:57 PM »
I've long since forgotten where, but Stickly has discussed this here somewhere before.
That being said, you MIGHT be able to figure out the way XGUI adds a URL input line by actually looking into the code.
https://github.com/TeamUlysses/ulx/blob/b3815da088ed03b880a29dfd3dae309d1679471d/lua/ulx/xgui/settings/server.lua#L592

There's lots of other code in that file that allows for input also. May wish to compare them (gimps, adverts, etc)

"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming