mirror of
https://github.com/redstrate/Kawari.git
synced 2025-06-30 11:47:45 +00:00

-Introduce a printf helper command which can print the sending command's name for you, and treats the message as a format string if additional params follow
31 lines
817 B
Lua
31 lines
817 B
Lua
required_rank = GM_RANK_DEBUG
|
|
sender = "[unlockaction] "
|
|
|
|
function onCommand(args, player)
|
|
local parts = split(args)
|
|
local argc = #parts
|
|
|
|
local usage = "\nThis command teaches the user an action, emote, etc.\nUsage: !useaction <id/all>"
|
|
|
|
if argc < 1 then
|
|
printf(player, "This command requires 1 parameter."..usage)
|
|
return
|
|
end
|
|
|
|
if parts[1] == "all" then
|
|
for i = 0, 1000, 1 do
|
|
player:unlock_action(i)
|
|
end
|
|
printf(player, "Everything is unlocked!", id)
|
|
else
|
|
local id = tonumber(parts[1])
|
|
|
|
if not id then
|
|
printf(player, "Error parsing action id! Make sure the id is an integer."..usage)
|
|
return
|
|
end
|
|
|
|
player:unlock_action(id)
|
|
printf(player, "Action %s unlocked!", id)
|
|
end
|
|
end
|