adding !donate !steamgroup !website to my server

I was wondering if someone could tell me where I can add my custom urls to these commands in ulx.

https://www.youtube.com/watch?v=GD0Z3UUywFs

I don’t quite know what ULX is/how it works, but in vanilla GMod you can make chat commands that link to websites like so:



hook.Add( 'OnPlayerChat', 'Unique_Name', function( ply, text, teamchat, dead ) -- change Unique_Name to some unique string
    if text == "!website" then -- or whatever text you want
        gui.OpenURL( 'somewebsite.com' ) -- open some website
        return true -- return true to stop the message from being put in the chat, false if you want it to be put in the chat
    end
end )


Someone will probably post the proper way to do this in ULX though

In addons\ulx\lua\ulx\modules\sh*namethis*.lua You can change *namethis *to what you like

The namethis.lua should contain:



CATEGORY_NAME = "Community Links" -- What category this command falls under. Choose existing group or create a new one.

function ulx.steamgroup(ply)
	ply:SendLua([[gui.OpenURL("http://YOURURLHERE.com/")]]) -- Opens URL on ply's browser.
end
local steamgroup = ulx.command( CATEGORY_NAME, "ulx steamgroup", ulx.steamgroup, "!steamgroup" ) -- "!steamgroup" is the custom command. Change this to whatever you want players to type in.
steamgroup:defaultAccess( ULib.ACCESS_ALL ) -- Who has access to this command? Refer to ULib ranks.
steamgroup:help( "Custom description here! CHANGE ME" ) -- Describes what the command does to the player using it.


I put a little commentary in the code to assist you.

Warning: This is not my code and I have not tested this. In order to learn, try experimenting around with this code to fit your needs.

so if i wanted to add a donation command i would just change everything that says steamgroup to donation?

you dont deserve people donating to you if you have no idea how to do stuff

having a server and not being able to code for it is a bad idea

I’ll correct you.
You dont deserve people donating to you if you cant read a fking comment.
Example:



local steamgroup = ulx.command( CATEGORY_NAME, "ulx steamgroup", ulx.steamgroup, "!steamgroup" ) -- "!steamgroup" is the custom command. Change this to whatever you want players to type in.


Obviously it was just a copy and paste into a lua file without actually reading anything.