natives.setCharDecisionMaker
Jump to navigation
Jump to search
Function Client Only ![]()
Online and Offline
Available since Client 1.0.0
void natives.setCharDecisionMaker(int ped, int decisionMakerId)
The natives.setCharDecisionMaker function is used to Assigns a decision maker to a ped, which controls how the ped reacts to threats, combat, and ambient events.
Parameters
| 1) | int | ped | The ped handle. |
| 2) | int | decisionMakerId | The decision maker ID that defines the ped’s AI behavior. |
Return
| void | This function doesn't return a value. |
Notes
- - Often combined with natives.createChar to spawn a ped- Typically used together with natives.setBlockingOfNonTemporaryEvents and natives.taskPlayAnimWithFlags to override AI and force scripted animations.
Examples
Example 1 - JavaScript:
addCommandHandler("setdm", function(command, params, client) {
natives.setCharDecisionMaker(ped, 4); }
});
Compatibility
There isn't any compatibility information for this function.