Author Topic: !addons command  (Read 2793 times)

0 Members and 1 Guest are viewing this topic.

Offline Bryantdl7

  • Jr. Member
  • **
  • Posts: 86
  • Karma: -2
!addons command
« on: August 24, 2014, 11:10:54 AM »
Hello, sorry if this was posted in the wrong area.

I have been getting lots of requests from clients on my server to add an addon that when a user types !addons in chat a list of addons on the server is displayed to them. Anyone hear of such a thing?

Thanks and sorry once again if this is the wrong area.



Offline bipezar

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
Re: !addons command
« Reply #1 on: August 24, 2014, 07:42:25 PM »
That's easy, but you will need a little bit of Lua and HTML knowledge.
go to your servers addons folder and then to ulx\lua\ulx\modules\sh, once in the "sh" folder create a new text document and name it "links.lua"

then paste this code into it:


CATEGORY_NAME = "Links"

function ulx.addons(ply)
   ply:SendLua([[gui.OpenURL("http://yourcustomwebsite.com/")]])
end
local website = ulx.command( CATEGORY_NAME, "ulx addons", ulx.addons, "!addons" )
website:defaultAccess( ULib.ACCESS_ALL )
website:help( "Open a list of the servers addons." )



You will need to create a website with a list of the addons on your server, then just place in the url into this code.
Good luck bro.