Client events

A list of client side events you can use in your scripts.

Core events

These events are part of FiveM and do not require any resource.

Index

Functions

CEventName

  • CEventName(entities: number[], eventEntity: number, data: any[]): void
  • An event that is triggered when the game triggers an internal network event. CEventName can be any event name that GTA 5 throws, e.g.: "CEventShockingCarCrash". see: https://docs.fivem.net/docs/game-references/game-events/ for a list of known events.

    Parameters

    • entities: number[]

      All entities receiving/emitting the event, can be empty.

    • eventEntity: number

      Entity the event is related to.

    • data: any[]

      Extra event data.

    Returns void

entityDamaged

  • entityDamaged(victim: number, culprit: number, weapon: number, baseDamage: number): void
  • An event that is triggered when an entity is locally damaged.

    Parameters

    • victim: number

      The entity which is damaged, or 0 if none.

    • culprit: number

      The damaging entity, or 0 if none.

    • weapon: number

      The hash of the weapon inflicting damage.

    • baseDamage: number

      The base amount of damage inflicted, discounting any modifiers.

    Returns void

gameEventTriggered

  • gameEventTriggered(name: string, data: number[]): void
  • An event that is triggered when the game triggers an internal network event.

    Parameters

    • name: string

      The name of the triggered event.

    • data: number[]

      The type-specific event data.

    Returns void

mumbleConnected

  • mumbleConnected(address: string, reconnecting: boolean): void
  • An event triggered when the game completes (re)connecting to a Mumble server.

    Parameters

    • address: string

      The address of the Mumble server connected to.

    • reconnecting: boolean

      Is this a reconnection to a Mumble server.

    Returns void

mumbleDisconnected

  • mumbleDisconnected(address: string): void
  • An event triggered when the game disconnects from a Mumble server without being reconnected.

    Parameters

    • address: string

      The address of the Mumble server disconnected from.

    Returns void

onClientResourceStart

  • onClientResourceStart(resource: string): void
  • An event that is queued after a resource has started.

    Parameters

    • resource: string

      The name of the resource that has started.

    Returns void

onClientResourceStop

  • onClientResourceStop(resource: string): void
  • An event that is triggered after a resource has stopped.

    Parameters

    • resource: string

      The name of the resource that has stopped.

    Returns void

onResourceStart

  • onResourceStart(resource: string): void
  • An event that is triggered immediately when a resource has started.

    Parameters

    • resource: string

      The name of the resource that just started.

    Returns void

onResourceStarting

  • onResourceStarting(resource: string): void
  • An event that is triggered when a resource is trying to start.

    This can be canceled to prevent the resource from starting.

    Parameters

    • resource: string

      The name of the resource that is trying to start.

    Returns void

onResourceStop

  • onResourceStop(resource: string): void
  • An event that is triggered immediately when a resource is stopping.

    Parameters

    • resource: string

      The name of the resource that is stopping.

    Returns void

populationPedCreating

  • populationPedCreating(x: number, y: number, z: number, model: number, overrideCalls: { setModel: any; setPosition: any }): void
  • An event that is triggered when a ped is being created by the game population system. The event can be canceled to stop creating the ped.

    Parameters

    • x: number

      The X position the ped is trying to spawn at.

    • y: number

      The Y position.

    • z: number

      The Z position.

    • model: number

      The intended model.

    • overrideCalls: { setModel: any; setPosition: any }

      Functions to override position or model.

      • setModel: function
        • setModel(model: string | number): void
        • Sets the model of the created ped.

          Parameters

          • model: string | number

            The model hash or name of the target ped model.

          Returns void

      • setPosition: function
        • setPosition(x: number, y: number, z: number): void
        • Sets the position of the created ped.

          Parameters

          • x: number

            The X position the ped will spawn at.

          • y: number

            The Y position.

          • z: number

            The Z position.

          Returns void

    Returns void

spawnmanager events

These events are part of the spawnmanager resource.

mapmanager events

These events are part of the mapmanager resource.

baseevents events

These events are part of the baseevents resource.

sessionmanager events

These events are part of the sessionmanager resource.

chat events

These events are part of the chat resource.