2021-01-18 13:34:00 -05:00
|
|
|
-----------------------------------
|
2016-10-11 05:48:28 -04:00
|
|
|
-- func: wallhack <optional target>
|
2016-01-16 01:26:33 -05:00
|
|
|
-- desc: Allows the player to walk through walls.
|
2021-01-18 13:34:00 -05:00
|
|
|
-----------------------------------
|
2024-08-25 10:54:45 -04:00
|
|
|
---@type TCommand
|
2023-09-02 07:01:35 -04:00
|
|
|
local commandObj = {}
|
2016-01-16 01:26:33 -05:00
|
|
|
|
2023-09-02 07:01:35 -04:00
|
|
|
commandObj.cmdprops =
|
2016-01-16 01:26:33 -05:00
|
|
|
{
|
|
|
|
|
permission = 1,
|
2023-08-28 21:02:28 -04:00
|
|
|
parameters = 's'
|
2020-02-19 21:40:57 -08:00
|
|
|
}
|
2016-01-16 01:26:33 -05:00
|
|
|
|
2023-09-02 07:01:35 -04:00
|
|
|
local function error(player, msg)
|
2023-12-09 23:54:00 +00:00
|
|
|
player:printToPlayer(msg)
|
|
|
|
|
player:printToPlayer('!wallhack (player)')
|
2020-02-19 21:40:57 -08:00
|
|
|
end
|
2017-08-10 15:35:53 -04:00
|
|
|
|
2023-09-02 07:01:35 -04:00
|
|
|
commandObj.onTrigger = function(player, target)
|
2017-08-10 15:35:53 -04:00
|
|
|
-- validate target
|
2020-02-19 21:40:57 -08:00
|
|
|
local targ
|
2022-10-30 09:13:30 -04:00
|
|
|
if target == nil then
|
2020-02-19 21:40:57 -08:00
|
|
|
targ = player
|
2016-10-11 05:48:28 -04:00
|
|
|
else
|
2021-01-09 08:01:35 +02:00
|
|
|
targ = GetPlayerByName(target)
|
2022-10-30 09:13:30 -04:00
|
|
|
if targ == nil then
|
2023-08-28 21:02:28 -04:00
|
|
|
error(player, string.format('Player named "%s" not found!', target))
|
2020-02-19 21:40:57 -08:00
|
|
|
return
|
2017-08-10 15:35:53 -04:00
|
|
|
end
|
2016-10-11 05:48:28 -04:00
|
|
|
end
|
|
|
|
|
|
2017-08-10 15:35:53 -04:00
|
|
|
-- toggle wallhack for target
|
2024-02-25 00:29:47 -07:00
|
|
|
if targ:getWallhack() then
|
|
|
|
|
targ:setWallhack(false)
|
2023-12-09 23:54:00 +00:00
|
|
|
player:printToPlayer(string.format('Toggled %s\'s wallhack flag OFF.', targ:getName()))
|
2016-10-11 05:48:28 -04:00
|
|
|
else
|
2024-02-25 00:29:47 -07:00
|
|
|
targ:setWallhack(true)
|
2023-12-09 23:54:00 +00:00
|
|
|
player:printToPlayer(string.format('Toggled %s\'s wallhack flag ON.', targ:getName()))
|
2016-10-11 05:48:28 -04:00
|
|
|
end
|
|
|
|
|
end
|
2023-09-02 07:01:35 -04:00
|
|
|
|
|
|
|
|
return commandObj
|