General > Developers Corner

Custom chat command aliases for console commands

(1/7) > >>

Chiller252:
So I just added Enhanced PlayerModel Selector to a few servers, but on gamemodes other than Sandbox the player must send a console command: 'playermodel_selector' to open the playermodel selector.

Is there a quick, easy and customizable code that I can use to create aliases for console command that can be executed in the chat.

Ex: A player typing !model or !playermodel will in turn send the console command: 'playermodel_selector' causing the menu to open without having to know what the console is.


--- Code: ---CATEGORY_NAME = "Aliases"
 
// Enhanced PlayerModel Selector
function ulx.something(ply)
        something
end
local donate = ulx.command( CATEGORY_NAME, "ulx playermodel", ulx.playermodel, "!playermodel",  "!model" )
playermodel:defaultAccess( ULib.ACCESS_ALL )
playermodel:help( "Description" )
--- End code ---

Something like that?

An Error Has Occurred!

array_keys(): Argument #1 ($array) must be of type array, null given

[0] Board index

Go to full version