Skip to content

Commit fb26fe2

Browse files
committed
Add setPedWearingJetpack client-side
1 parent f855b36 commit fb26fe2

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

Client/mods/deathmatch/logic/luadefs/CLuaPedDefs.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ void CLuaPedDefs::LoadFunctions()
6363
{"setPedExitVehicle", ArgumentParser<SetPedExitVehicle>},
6464
{"setPedBleeding", ArgumentParser<SetPedBleeding>},
6565
{"playPedVoiceLine", ArgumentParser<PlayPedVoiceLine>},
66+
{"setPedWearingJetpack", ArgumentParser<SetPedWearingJetpack>},
6667

6768
{"getPedVoice", GetPedVoice},
6869
{"getElementBonePosition", ArgumentParserWarn<false, GetElementBonePosition>},
@@ -213,6 +214,7 @@ void CLuaPedDefs::AddClass(lua_State* luaVM)
213214
lua_classfunction(luaVM, "setExitVehicle", "setPedExitVehicle");
214215
lua_classfunction(luaVM, "setBleeding", "setPedBleeding");
215216
lua_classfunction(luaVM, "playVoiceLine", "playPedVoiceLine");
217+
lua_classfunction(luaVM, "setWearingJetpack", "setPedWearingJetpack");
216218

217219
lua_classvariable(luaVM, "vehicle", OOP_WarpPedIntoVehicle, GetPedOccupiedVehicle);
218220
lua_classvariable(luaVM, "vehicleSeat", NULL, "getPedOccupiedVehicleSeat");
@@ -2560,3 +2562,11 @@ void CLuaPedDefs::PlayPedVoiceLine(CClientPed* ped, int speechId, std::optional<
25602562

25612563
ped->Say(speechContextId, probability.value_or(1.0f));
25622564
}
2565+
2566+
bool CLuaPedDefs::SetPedWearingJetpack(CClientPed* ped, bool state)
2567+
{
2568+
if (!ped->IsLocalEntity())
2569+
return false;
2570+
2571+
return ped->SetHasJetPack(state);
2572+
}

Client/mods/deathmatch/logic/luadefs/CLuaPedDefs.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,4 +120,6 @@ class CLuaPedDefs : public CLuaDefs
120120
static bool killPedTask(CClientPed* ped, taskType taskType, std::uint8_t taskNumber, std::optional<bool> gracefully);
121121

122122
static void PlayPedVoiceLine(CClientPed* ped, int speechId, std::optional<float> probability);
123+
124+
static bool SetPedWearingJetpack(CClientPed* ped, bool state);
123125
};

0 commit comments

Comments
 (0)