Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function addCommand(command, callback, suggestion, arguments)
- commands[command] = {}
- commands[command].perm = 0
- commands[command].group = "user"
- commands[command].cmd = callback
- commands[command].arguments = arguments or -1
- if suggestion then
- if not suggestion.params or not type(suggestion.params) == "table" then suggestion.params = {} end
- if not suggestion.help or not type(suggestion.help) == "string" then suggestion.help = "" end
- commandSuggestions[command] = suggestion
- end
- if(settings.defaultSettings.disableCommandHandler ~= 'false')then
- RegisterCommand(command, function(source, args)
- if((#args <= commands[command].arguments and #args == commands[command].arguments) or commands[command].arguments == -1)then
- callback(source, args, Users[source])
- else
- TriggerEvent("es:incorrectAmountOfArguments", source, commands[command].arguments, #args, Users[source])
- end
- end, false)
- end
- debugMsg("Command added: " .. command)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement