gunware docs
  • Docs GunWare
  • GW-SKINV2
    • State bags
    • Crée une tenue (exports)
    • Crée un items vêtements
    • getUrl
    • Command
    • config
    • token
  • GW-OFFLINEV2
    • exports
      • Client
      • Server
        • SetCustomState
        • DisplayEntity
        • SetDefaultAnim
    • Event
    • Config
    • target function
      • config.target.function.lua
Powered by GitBook
On this page
  1. GW-OFFLINEV2
  2. exports
  3. Server

SetCustomState

PreviousServerNextDisplayEntity

Last updated 3 months ago

Fonction : SetCustomState

Définition

function SetCustomState(ped)
    local entityState = Entity(ped).state
    local indentifiers = entityState.players
    
    --- exemple 
    --- entityState.job = GetJobsFormIdentifier(identifier)
end

Exportation

exports("SetCustomState", SetCustomState)

Utilisation

Voici 10 exemples d'utilisation de SetCustomState.

1. Définir un job personnalisé

Entity(ped).state.job = "police"

2. Ajouter un état de santé

Entity(ped).state.health = 100

3. Assigner un rang au joueur

Entity(ped).state.rank = "sergent"

4. Définir une faction

Entity(ped).state.faction = "gang_blood"

5. Ajouter un niveau de prime

Entity(ped).state.wantedLevel = 3

6. Gérer le statut de mission

Entity(ped).state.onMission = true

7. Définir une restriction d'armes

Entity(ped).state.weaponRestricted = true

8. Associer un véhicule personnel

Entity(ped).state.ownedVehicle = "Dominator"

9. Définir l'accès à une zone

Entity(ped).state.accessLevel = "VIP"

10. Ajouter un tag d'événement

Entity(ped).state.eventTag = "Halloween2025"

config.target.function.lua