M MY Multiplayer: Wiki
Side
Kind

killPedTask

Client

Removes the task a ped runs in a slot.

bool killPedTask(ped ped, string priority, int slot [, bool gracefully = true])

Parameters

NameTypeDescription
pedpedThe ped or player.
prioritystringprimary or secondary.
slotintThe slot, as in getPedTask. Primary slot 4 (default) cannot be removed.
gracefullybooltrue lets the task wind down before it is removed; false removes it outright.default true

Returns

true if there was a task and it was removed, false if the slot was empty or the ped does not exist in the game.

Example

bindKey("backspace", "down", function()
    killPedTask(localPlayer, "primary", 3)
end)
NoteAn invalid priority, a slot out of range or primary slot 4 raise an error instead of returning false.

See also