diff --git a/Client/mods/deathmatch/logic/luadefs/CLuaPedDefs.cpp b/Client/mods/deathmatch/logic/luadefs/CLuaPedDefs.cpp index 68b707d14b3..59c6d06b609 100644 --- a/Client/mods/deathmatch/logic/luadefs/CLuaPedDefs.cpp +++ b/Client/mods/deathmatch/logic/luadefs/CLuaPedDefs.cpp @@ -63,6 +63,7 @@ void CLuaPedDefs::LoadFunctions() {"setPedExitVehicle", ArgumentParser}, {"setPedBleeding", ArgumentParser}, {"playPedVoiceLine", ArgumentParser}, + {"setPedWearingJetpack", ArgumentParser}, {"getPedVoice", GetPedVoice}, {"getElementBonePosition", ArgumentParserWarn}, @@ -213,6 +214,7 @@ void CLuaPedDefs::AddClass(lua_State* luaVM) lua_classfunction(luaVM, "setExitVehicle", "setPedExitVehicle"); lua_classfunction(luaVM, "setBleeding", "setPedBleeding"); lua_classfunction(luaVM, "playVoiceLine", "playPedVoiceLine"); + lua_classfunction(luaVM, "setWearingJetpack", "setPedWearingJetpack"); lua_classvariable(luaVM, "vehicle", OOP_WarpPedIntoVehicle, GetPedOccupiedVehicle); lua_classvariable(luaVM, "vehicleSeat", NULL, "getPedOccupiedVehicleSeat"); @@ -2560,3 +2562,11 @@ void CLuaPedDefs::PlayPedVoiceLine(CClientPed* ped, int speechId, std::optional< ped->Say(speechContextId, probability.value_or(1.0f)); } + +bool CLuaPedDefs::SetPedWearingJetpack(CClientPed* ped, bool state) +{ + if (!ped->IsLocalEntity()) + return false; + + return ped->SetHasJetPack(state); +} diff --git a/Client/mods/deathmatch/logic/luadefs/CLuaPedDefs.h b/Client/mods/deathmatch/logic/luadefs/CLuaPedDefs.h index 20ec1aa5909..c1b51401ab4 100644 --- a/Client/mods/deathmatch/logic/luadefs/CLuaPedDefs.h +++ b/Client/mods/deathmatch/logic/luadefs/CLuaPedDefs.h @@ -120,4 +120,6 @@ class CLuaPedDefs : public CLuaDefs static bool killPedTask(CClientPed* ped, taskType taskType, std::uint8_t taskNumber, std::optional gracefully); static void PlayPedVoiceLine(CClientPed* ped, int speechId, std::optional probability); + + static bool SetPedWearingJetpack(CClientPed* ped, bool state); };