2025-06-21 13:30:52 -04:00
|
|
|
required_rank = GM_RANK_DEBUG
|
2025-06-25 18:24:21 -04:00
|
|
|
command_sender = "[teri] "
|
2025-06-21 13:30:52 -04:00
|
|
|
|
|
|
|
function onCommand(args, player)
|
|
|
|
local parts = split(args)
|
2025-06-25 15:21:09 -04:00
|
|
|
local argc = #parts
|
2025-06-21 13:30:52 -04:00
|
|
|
local usage = "\nThis command moves the user to a new zone/territory.\nUsage: !teri <id>"
|
|
|
|
|
|
|
|
if argc == 0 then
|
2025-06-25 16:52:37 -04:00
|
|
|
printf(player, "A territory id is required to use this command."..usage)
|
|
|
|
return
|
2025-06-21 13:30:52 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
local id = tonumber(parts[1])
|
|
|
|
|
|
|
|
if not id or id < 0 or id > 65535 then -- Must be in range of unsigned 16-bit value
|
2025-06-25 16:52:37 -04:00
|
|
|
printf(player, "Error parsing territory id! Make sure your input is an integer between 0 and 65535."..usage)
|
2025-06-21 13:30:52 -04:00
|
|
|
return
|
|
|
|
end
|
|
|
|
|
|
|
|
player:change_territory(id)
|
2025-06-25 16:52:37 -04:00
|
|
|
printf(player, "Changing territory to %s.", id)
|
2025-06-21 13:30:52 -04:00
|
|
|
end
|