Chat commands library¶
Library for chat commands
Functions¶
add¶
Adds a new chat command:
cmd.add(name, callback, [asArray])
Arguments¶
stringname- name of a command (ex. “cry”)
functioncallback- callback function
function(client, arg1, arg2, ...)— all arguments is in type ofstring
booleanasArray (optional, default:false)- set it to true if you want to get arguments as an array
Examples¶
cmd.add("msg", function(player, text)
if text ~= nil then
API.sendChatMessageToPlayer(player, text)
end
end)