The Lab
TASK native

TASK_MELEE

returns BOOL8 paramsbuild 1207

Tasks ped to engage targetPed in melee. Returns true on success.

Signature

C
BOOL TASK_MELEE(Ped ped, Ped targetPed, Hash p2, Any p3, Any p4, float p5, Any p6, float p7); // 0x482C99D0B38D1B0A b1207

Parameters

#NameType
1pedPed
2targetPedPed
3p2Hash
4p3Any
5p4Any
6p5float
7p6Any
8p7float

Facts

Facts about TASK_MELEE
Name
TASK_MELEE
Hash
0x482C99D0B38D1B0A
Namespace
Returns
BOOL
Game build
1207

Examples

Calls by hash work in every RedM runtime. Replace the placeholder arguments with your own values.

Lua
local result = Citizen.InvokeNative(0x482C99D0B38D1B0A, -- TASK_MELEE
  PlayerPedId(), -- Ped ped
  PlayerPedId(), -- Ped targetPed
  GetHashKey("name"), -- Hash p2
  0, -- Any p3
  0, -- Any p4
  0.0, -- float p5
  0, -- Any p6
  0.0 -- float p7
)
if result then
  -- ...
end
JavaScript
// Whole JS numbers are sent as integers: pass floats like 1.5 (or n + 0.0000001), never 1.
const result = Citizen.invokeNative("0x482C99D0B38D1B0A", // TASK_MELEE
  PlayerPedId(), // Ped ped
  PlayerPedId(), // Ped targetPed
  GetHashKey("name"), // Hash p2
  0, // Any p3
  0, // Any p4
  0.0, // float p5
  0, // Any p6
  0.0, // float p7
  Citizen.returnResultAnyway()
);
if (result) {
  // ...
}
C#
bool result = Function.Call<bool>((Hash)0x482C99D0B38D1B0A, // TASK_MELEE
  API.PlayerPedId(), // Ped ped
  API.PlayerPedId(), // Ped targetPed
  (uint)API.GetHashKey("name"), // Hash p2
  0, // Any p3
  0, // Any p4
  0.0f, // float p5
  0, // Any p6
  0.0f // float p7
);
All TASK natives

Facts compiled from community research (alloc8or/rdr3-nativedb-data, femga/rdr3_discoveries); descriptions and examples by The Lab.