Many natives take a small number that selects a behaviour: a flag id, an attribute or an enum value. They are not named in Lua, so keep them in a named constant table and comment them.
The main families#
| Native | What the number selects | Notes |
|---|---|---|
SetPedConfigFlag(ped, id, value) |
A persistent ped behaviour switch | Stays until you change it or the ped is deleted. |
SetPedResetFlag(ped, id, true) |
A behaviour for one frame only | Must be called every frame while you want it. |
SetPedCombatAttributes(ped, id, value) |
How the ped fights | Used for hostile or scripted peds. |
SetPedFleeAttributes(ped, id, value) |
How the ped runs away | Mainly for NPCs you spawn. |
SetPedCapability(ped, id, value) |
What the ped is allowed to do | Build dependent. |
Keep numbers readable#
local PED_FLAG = {
-- id found by testing, always say what it does
-- NO_RAGDOLL = 0,
}
SetPedConfigFlag(ped, PED_FLAG.NO_RAGDOLL, true)Flag ids can change between game builds. If a flag stops working after a game update, recheck the id before debugging your own code.
Flags and attributes set by JRS Core (36)#
Note is the comment written next to the call in the script (when there is one).
| Native | Id | Value | السكربتات | الاستدعاءات | Note |
|---|---|---|---|---|---|
SetPedCombatAttributes |
2 | true | jrs_railroad |
2 | horseback drive-by shooting |
SetPedCombatAttributes |
5 | true | jrs_fight, jrs_organizations, jrs_police |
7 | always fight |
SetPedCombatAttributes |
17 | false, true | jrs_fight, jrs_government, jrs_organizations |
3 | never flee |
SetPedCombatAttributes |
46 | false, true | jrs_fight, jrs_guarma, jrs_hunting |
21 | fight to the death |
SetPedCombatAttributes |
58 | true | jrs_organizations |
1 | |
SetPedConfigFlag |
2 | - | jrs_admin |
1 | |
SetPedConfigFlag |
6 | true | jrs_pets, jrs_stable |
3 | PCF_DontInfluenceWantedLevel |
SetPedConfigFlag |
17 | true | jrs_fishing |
1 | |
SetPedConfigFlag |
65 | true | jrs_essentials |
1 | |
SetPedConfigFlag |
108 | true | jrs_casino |
1 | |
SetPedConfigFlag |
113 | false, true | jrs_pets, jrs_stable, jrs_stables |
8 | DisableShockingEvents |
SetPedConfigFlag |
136 | false, true | jrs_pets, jrs_stable |
14 | PCF_CannotBeMounted |
SetPedConfigFlag |
166 | true | jrs_hotair |
2 | |
SetPedConfigFlag |
169 | true | jrs_core |
1 | |
SetPedConfigFlag |
176 | false, true | jrs_stable |
2 | |
SetPedConfigFlag |
184 | true | jrs_organizations |
2 | |
SetPedConfigFlag |
185 | true | jrs_casino |
1 | |
SetPedConfigFlag |
207 | false | jrs_stable |
2 | |
SetPedConfigFlag |
208 | true | jrs_casino, jrs_pets, jrs_stable |
3 | |
SetPedConfigFlag |
209 | true | jrs_pets, jrs_stable |
2 | |
SetPedConfigFlag |
211 | false, true | jrs_pets, jrs_stable |
3 | PCF_GiveAmbientDefaultTaskIfMissionPed (false prevents erratic ambient tasks) |
SetPedConfigFlag |
263 | true | jrs_core |
1 | |
SetPedConfigFlag |
277 | true | jrs_pets, jrs_stable |
2 | |
SetPedConfigFlag |
297 | true | jrs_pets, jrs_stable |
4 | PCF_ForceInteractionLockonOnTargetPed |
SetPedConfigFlag |
301 | false | jrs_pets, jrs_stable |
3 | PCF_DisableInteractionLockonOnTargetPed |
SetPedConfigFlag |
312 | false, true | jrs_pets, jrs_stable |
6 | PCF_DisableHorseGunshotFleeResponse |
SetPedConfigFlag |
319 | true | jrs_pets, jrs_stable |
2 | PCF_EnableAsVehicleTransitionDestination |
SetPedConfigFlag |
324 | true | jrs_pets, jrs_stable |
2 | |
SetPedConfigFlag |
340 | true | jrs_core |
1 | |
SetPedConfigFlag |
400 | true | jrs_pets, jrs_stable |
2 | |
SetPedConfigFlag |
442 | true | jrs_stable |
2 | Disable panic |
SetPedConfigFlag |
471 | true | jrs_stable |
5 | PCF_DisableHorseKick |
SetPedConfigFlag |
561 | false | jrs_stable |
1 | PCF_EnableHorseCollectPlantInteractionInMP |
SetPedFleeAttributes |
0 | false, true | jrs_fight, jrs_government, jrs_guarma |
16 | Never flee |
SetPedResetFlag |
249 | true | jrs_casino |
1 | |
SetPedResetFlag |
364 | true | jrs_essentials |
1 |
الشكر والمصادر
Flag meanings are community research. A maintained list of flags and enums: Halen84/RDR3-Native-Flags-And-Enums.