diff --git a/Client/mods/deathmatch/logic/luadefs/CLuaPedDefs.cpp b/Client/mods/deathmatch/logic/luadefs/CLuaPedDefs.cpp index f1229eea68..ddf624b3cf 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,12 +214,13 @@ 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"); lua_classvariable(luaVM, "canBeKnockedOffBike", "setPedCanBeKnockedOffBike", "canPedBeKnockedOffBike"); lua_classvariable(luaVM, "hasJetPack", NULL, "doesPedHaveJetPack"); - lua_classvariable(luaVM, "jetpack", NULL, "isPedWearingJetpack"); // introduced in 1.5.5-9.13846 + lua_classvariable(luaVM, "jetpack", "setPedWearingJetpack", "isPedWearingJetpack"); // introduced in 1.5.5-9.13846 lua_classvariable(luaVM, "armor", "setPedArmor", "getPedArmor"); lua_classvariable(luaVM, "fightingStyle", "setPedFightingStyle", "getPedFightingStyle"); lua_classvariable(luaVM, "cameraRotation", "setPedCameraRotation", "getPedCameraRotation"); @@ -2567,3 +2569,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 20ec1aa590..c1b51401ab 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); };