Skip to content

Commit e4d3ca9

Browse files
committed
killTask
1 parent 84437e4 commit e4d3ca9

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ void CLuaPedDefs::LoadFunctions()
115115
{"isPedDucked", IsPedDucked},
116116
{"isPedDead", IsPedDead},
117117
{"isPedReloadingWeapon", IsPedReloadingWeapon},
118+
{"killPedTask", ArgumentParser<killPedTask>},
118119
};
119120

120121
// Add functions
@@ -2493,3 +2494,17 @@ bool CLuaPedDefs::SetPedExitVehicle(CClientPed* pPed)
24932494
{
24942495
return pPed->ExitVehicle();
24952496
}
2497+
2498+
bool CLuaPedDefs::killPedTask(CClientPed* ped, std::string taskType, uint8_t taskNumber, bool gracefully)
2499+
{
2500+
2501+
if (taskType == "primary") // PRIMARY
2502+
{
2503+
return ped->KillTask(taskNumber, gracefully);
2504+
}
2505+
else if (taskType == "secondary") // SECONDARY
2506+
{
2507+
return ped->KillTaskSecondary(taskNumber, gracefully);
2508+
}
2509+
2510+
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,6 @@ class CLuaPedDefs : public CLuaDefs
115115
static bool SetPedExitVehicle(CClientPed* pPed);
116116
static bool IsPedBleeding(CClientPed* ped);
117117
static bool SetPedBleeding(CClientPed* ped, bool bleeding);
118+
119+
static bool killPedTask(CClientPed* ped, std::string taskType, uint8_t taskNumber, bool gracefully);
118120
};

0 commit comments

Comments
 (0)