Content Command

-snip- answer below

Just tested your code and it works fine.

You’re gonna need to AddCSLuaFile it you know; you could just put it shared and add at the top



if SERVER then AddCSLuaFile() return end


If you’re using ULX, use this


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

function ulx.content(ply)
	ply:SendLua([[gui.OpenURL("http://steamcommunity.com/sharedfiles/filedetails/?id=852939630")]]) -- Opens URL on ply's browser.
end
local content = ulx.command( CATEGORY_NAME, "ulx content", ulx.content, "!content" ) -- "!content" is the custom command. Change this to whatever you want players to type in.
content:defaultAccess( ULib.ACCESS_ALL ) -- Who has access to this command? Refer to ULib ranks.
content:help( "Our server's content! Download these if you're seeing errors!" ) -- Describes what the command does to the player using it.

Put this in ULX > LUA > ULX > MODULES > SH > {place file here called “content.lua”}

Autorun automatically AddCSLuaFile’s what the client will run.

[editline]31st January 2017[/editline]

ULX commands should be used for commands that require group permissions or use ULib functions, not simple stuff like this.

He wants a way to link his workshop collection with a chat command. If he’s using ULX there shouldn’t be any problem doing it this way. There isn’t any good reason you shouldn’t do it like this if you’re using ulx.

Sure there is: it adds extra overhead to do rank checks and process it as a ULX command. Also, if he ever switched admin mods then he’d have to remake it on that system. There’s no reason to use a ULX command for something that doesn’t need a rank check nor admin mod features. I just tested his code and it worked fine.

You are correct, but just to be a cunt im gonna add this.
“There is no reason to use a ulx command for something that doesnt need a rank”
You can add it to the ulx menu and it makes it look super snazzy.

Checkmate

Pretty sure ULX has a method to add custom entries to its menu without it strictly being a ULX command – could be wrong.

Thanks heaps, this works perfectly.