Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Client/mods/deathmatch/logic/luadefs/CLuaPedDefs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ void CLuaPedDefs::LoadFunctions()
{"setPedExitVehicle", ArgumentParser<SetPedExitVehicle>},
{"setPedBleeding", ArgumentParser<SetPedBleeding>},
{"playPedVoiceLine", ArgumentParser<PlayPedVoiceLine>},
{"setPedWearingJetpack", ArgumentParser<SetPedWearingJetpack>},

{"getPedVoice", GetPedVoice},
{"getElementBonePosition", ArgumentParserWarn<false, GetElementBonePosition>},
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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);
}
2 changes: 2 additions & 0 deletions Client/mods/deathmatch/logic/luadefs/CLuaPedDefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,6 @@ class CLuaPedDefs : public CLuaDefs
static bool killPedTask(CClientPed* ped, taskType taskType, std::uint8_t taskNumber, std::optional<bool> gracefully);

static void PlayPedVoiceLine(CClientPed* ped, int speechId, std::optional<float> probability);

static bool SetPedWearingJetpack(CClientPed* ped, bool state);
};
Loading