ULX

Author Topic: Custom chat command aliases for console commands  (Read 8531 times)

0 Members and 2 Guests are viewing this topic.

Offline Chiller252

  • Jr. Member
  • **
  • Posts: 59
  • Karma: 3
  • On a Journey to Combine Technology and Design
    • Personal Website
Custom chat command aliases for console commands
« on: June 10, 2016, 11:00:22 AM »
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: [Select]
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" )

Something like that?

An Error Has Occurred!

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