natives.setBlockingOfNonTemporaryEvents
Jump to navigation
Jump to search
Function Client Only ![]()
Online and Offline
Available since Client 1.0.0
void natives.setBlockingOfNonTemporaryEvents(int ped, bool toggle)
The natives.setBlockingOfNonTemporaryEvents function is used to Prevents the ped from reacting to non-temporary events such as fleeing, fighting, or ambient AI behaviors. Commonly used before forcing a ped into a scripted animation.
Parameters
| 1) | int | ped | The ped handle. |
| 2) | bool | toggle | True to block non-temporary events, false to allow them. |
Return
| void | This function doesn't return a value. |
Notes
- - Often combined with natives.createChar to spawn a ped- Typically used together with natives.taskPlayAnimWithFlags to keep the ped in a looped animation without interruption.
Examples
Example 1 - JavaScript:
addCommandHandler("handsup", function(command, params, client) {
natives.setBlockingOfNonTemporaryEvents(ped, true); }
});
Compatibility
There isn't any compatibility information for this function.
Related
Client Related
addEvent
addEventHandler
bindEventHandler
removeEventHandler
triggerEvent
triggerNetworkEvent
unbindEventHandler