2021-01-18 13:34:00 -05:00
|
|
|
-----------------------------------
|
2016-07-29 08:35:15 -06:00
|
|
|
-- func: cs
|
2016-01-16 01:26:33 -05:00
|
|
|
-- desc: Starts the given event for the player.
|
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 = 'iiiiiiiiii'
|
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('!cs <csID> (op1) (op2) (op3) (op4) (op5) (op6) (op7) (op8) (texttable)')
|
2020-02-19 21:40:57 -08:00
|
|
|
end
|
2017-08-03 12:31:51 -04:00
|
|
|
|
2023-09-02 07:01:35 -04:00
|
|
|
commandObj.onTrigger = function(player, csid, op1, op2, op3, op4, op5, op6, op7, op8, texttable)
|
2017-08-03 12:31:51 -04:00
|
|
|
-- validate csid
|
2022-10-30 10:31:18 -04:00
|
|
|
if csid == nil then
|
2023-08-28 21:02:28 -04:00
|
|
|
error(player, 'You must enter a cutscene id.')
|
2020-02-19 21:40:57 -08:00
|
|
|
return
|
2016-01-16 01:26:33 -05:00
|
|
|
end
|
2020-03-19 18:41:42 -07:00
|
|
|
|
2017-08-03 12:31:51 -04:00
|
|
|
-- play cutscene
|
2022-11-04 10:44:34 -04:00
|
|
|
if op1 == nil then
|
2020-02-19 21:40:57 -08:00
|
|
|
player:startEvent(csid)
|
2018-05-19 13:05:52 -04:00
|
|
|
else
|
2020-02-19 21:40:57 -08:00
|
|
|
player:startEvent(csid, op1, op2, op3, op4, op5, op6, op7, op8, texttable)
|
2016-10-30 13:03:48 -04:00
|
|
|
end
|
2016-05-02 20:48:10 +01:00
|
|
|
end
|
2023-09-02 07:01:35 -04:00
|
|
|
|
|
|
|
|
return commandObj
|