Skip to content
EntranceJew edited this page Sep 22, 2014 · 1 revision

Properties

local PLUGIN = {}
PLUGIN.Title = "Health"
PLUGIN.Description = "Set the health of a player."
PLUGIN.Author = "Overv"
PLUGIN.ChatCommand = "hp"
PLUGIN.Usage = "<players> [health]"
PLUGIN.Privileges = { "Health" }
  • Title is how your plugin will be referenced on the plugin panel.
  • Description is a table or a string that contains information on what a plugin does and how it's used. This is shown when an admin uses the !commands command.
  • Author should be your name or handle -- it'd be weird if you didn't credit yourself.
  • ChatCommand is what an admin would have to type in conjunction with the evolve command identifier (by default: "!") order to invoke the command. For example: !hp.
  • Usage is the text that accompanies the autocomplete for the command. It describes which parameters the command accepts. I can't even begin to pretend that there's any sort of standard for what these strings look like. If applicable, it is usually convention to target the player that invoked the command if no other players are targeted.
  • Privileges is a table of strings. Those strings are separate privileges that your plugin uses. You should always have at least one privilege so that an admin can use their own discretion as to which users have access to the command. For example, we may want two separate privilege levels for being able to use "!hp" to set health or in a hypothetical plugin example, seeing someone's health. Two different and distinct actions that can be done by one command. Privileges are not enforced by the framework, you must manually put in checks in your code to verify the player using the command has access to it using helper functions provided by evolve.
  • Dependencies a table of strings, if your plugin makes use of features provided by another plugin

Methods

  • Call( ply, args ) is the function that is invoked when a user types !command in the chat or ev command in the console.
    • Arguments
    • ply is the player that invoked the command.
    • args is a table of all the arguments provided to the command.
    • Returns
    • nil
  • Menu( args, players ) is the function invoked when a command is invoked from the menu.
    • Arguments
    • args is for when your menu provides a submenu for the player to selection options from.
    • players is a table of the players that were selected on the previous page.
    • Returns
    • title is a string that will be its name on the menu, this should usually be PLUGIN.Title or self.Title.
    • category is a number that represents collapsible category that the command will be available under. The defaults are 1 = administration, 2 = actions, 3 = punishment, 4 = teleportation. These are available under evolve.category.
    • submenu is a table of options for the system to provide as default arguments for the plugin. If this is not returned then the menu will attempt to call the plugin on the targets without any arguments.
    • submenutitle is a string that provides a title for the submenu provided by submenu.

Extra

evolve:RegisterPlugin( PLUGIN )

At the bottom of each plugin you must use the utility function to register the plugin, otherwise you wasted your time.

Clone this wiki locally