General > Developers Corner
Custom URL links that can be edited via the ULX admin panel
(1/1)
elfnet_gaming:
Ok so I got this code
--- Code: ---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." )
--- End code ---
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
MrPresident:
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..
JamminR:
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)
Navigation
[0] Message Index
Go to full version