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

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

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.