Target
Target Configuration
The Config.Target
section in the configuration file determines whether your server will use an external target system for NPC interactions (like ox_target
), or fall back to the default method of displaying text over NPCs. Here's a breakdown of how this works:
1. Target Enabled (Config.Target.enabled = true
)
When the enabled
property is set to true
, the server will rely on the external target system (in this case, ox_target
). This means that NPC interactions will be handled by ox_target
, and the user will need to use the target system's functionality to interact with NPCs.
Target Resource: The
resource
field indicates which resource to use for the target system. In this example, it's set to"ox_target"
, meaning it will use theox_target
resource to handle NPC interaction.
Behavior:
The NPC will have a dynamic interaction, and you will use the target system to interact with the NPC (e.g., a circle or indicator will appear around the NPC, and the player will click on the target to initiate interaction).
This method provides a more polished and integrated experience for NPC interactions.
2. Target Disabled (Config.Target.enabled = false
)
When the enabled
property is set to false
, the server does not use any external target system, and the default interaction method is used. In this case, the NPC will show a text label above its head (such as "[E] - Supermarket 24/7"), and players can press the configured key (e.g., [E]) to interact with the NPC.
DrawText: With
enabled = false
, the NPC interaction is based on a simple text prompt that appears above the NPC, usually controlled viaDrawText
or similar functions. This text will display the interaction key (e.g.,[E] - Supermarket 24/7
), instructing the player to press the corresponding button to interact.Example:
Behavior:
When the
target
system is disabled, players will see a text label above the NPC, such as[E] - Supermarket 24/7
. They can then press the key (e.g.,E
with key code38
) to interact with the NPC.This method is simpler and does not require an external resource but still provides basic interaction functionality.
Summary of Behavior Based on Config.Target.enabled
Enabled
Method
Resource
Interaction
Key Binding
true
Uses target system (e.g., ox_target
)
ox_target
Dynamic NPC interaction (circle, icons)
Configured via ox_target
false
Draws text above the NPC's head
No external resource
Simple interaction with text (e.g., [E] - Supermarket 24/7
)
Customizable via key
Last updated