killPedTask
Client
Removes the task a ped runs in a slot.
bool killPedTask(ped ped, string priority, int slot [, bool gracefully = true])
Parameters
| Name | Type | Description |
|---|---|---|
| ped | ped | The ped or player. |
| priority | string | primary or secondary. |
| slot | int | The slot, as in getPedTask. Primary slot 4 (default) cannot be removed. |
| gracefully | bool | true 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.