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.

<section class="tsd-panel-group tsd-index-group"> <h2>Index</h2> <section class="tsd-panel tsd-index-panel"> <div class="tsd-index-content"> <section class="tsd-index-section "> <h3>Functions</h3> <ul class="tsd-index-list"> <li class="tsd-kind-function"><a href="#ceventname" class="tsd-kind-icon">CEvent<wbr>Name</a></li> <li class="tsd-kind-function"><a href="#entitydamaged" class="tsd-kind-icon">entity<wbr>Damaged</a></li> <li class="tsd-kind-function"><a href="#gameeventtriggered" class="tsd-kind-icon">game<wbr>Event<wbr>Triggered</a></li> <li class="tsd-kind-function"><a href="#mumbleconnected" class="tsd-kind-icon">mumble<wbr>Connected</a></li> <li class="tsd-kind-function"><a href="#mumbledisconnected" class="tsd-kind-icon">mumble<wbr>Disconnected</a></li> <li class="tsd-kind-function"><a href="#onclientresourcestart" class="tsd-kind-icon">on<wbr>Client<wbr>Resource<wbr>Start</a></li> <li class="tsd-kind-function"><a href="#onclientresourcestop" class="tsd-kind-icon">on<wbr>Client<wbr>Resource<wbr>Stop</a></li> <li class="tsd-kind-function"><a href="#onresourcestart" class="tsd-kind-icon">on<wbr>Resource<wbr>Start</a></li> <li class="tsd-kind-function"><a href="#onresourcestarting" class="tsd-kind-icon">on<wbr>Resource<wbr>Starting</a></li> <li class="tsd-kind-function"><a href="#onresourcestop" class="tsd-kind-icon">on<wbr>Resource<wbr>Stop</a></li> <li class="tsd-kind-function"><a href="#populationpedcreating" class="tsd-kind-icon">population<wbr>Ped<wbr>Creating</a></li> </ul> </section> </div> </section> </section> <section class="tsd-panel-group tsd-member-group "> <h2>Functions</h2> <section class="tsd-panel tsd-member tsd-kind-function"> <a name="ceventname" class="tsd-anchor"></a> <h3>CEvent<wbr>Name</h3> <ul class="tsd-signatures tsd-kind-function"> <li class="tsd-signature tsd-kind-icon">CEvent<wbr>Name<span class="tsd-signature-symbol">(</span>entities<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span>, eventEntity<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, data<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>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.: &quot;CEventShockingCarCrash&quot;. see: <a href="https://docs.fivem.net/docs/game-references/game-events/">https://docs.fivem.net/docs/game-references/game-events/</a> for a list of known events.</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>entities: <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h5> <div class="tsd-comment tsd-typography"> <p>All entities receiving/emitting the event, can be empty.</p> </div> </li> <li> <h5>eventEntity: <span class="tsd-signature-type">number</span></h5> <div class="tsd-comment tsd-typography"> <p>Entity the event is related to.</p> </div> </li> <li> <h5>data: <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span></h5> <div class="tsd-comment tsd-typography"> <p>Extra event data.</p> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-function"> <a name="entitydamaged" class="tsd-anchor"></a> <h3>entity<wbr>Damaged</h3> <ul class="tsd-signatures tsd-kind-function"> <li class="tsd-signature tsd-kind-icon">entity<wbr>Damaged<span class="tsd-signature-symbol">(</span>victim<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, culprit<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, weapon<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, baseDamage<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>An event that is triggered when an entity is <em>locally</em> damaged.</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>victim: <span class="tsd-signature-type">number</span></h5> <div class="tsd-comment tsd-typography"> <p>The entity which is damaged, or 0 if none.</p> </div> </li> <li> <h5>culprit: <span class="tsd-signature-type">number</span></h5> <div class="tsd-comment tsd-typography"> <p>The damaging entity, or 0 if none.</p> </div> </li> <li> <h5>weapon: <span class="tsd-signature-type">number</span></h5> <div class="tsd-comment tsd-typography"> <p>The hash of the weapon inflicting damage.</p> </div> </li> <li> <h5>baseDamage: <span class="tsd-signature-type">number</span></h5> <div class="tsd-comment tsd-typography"> <p>The base amount of damage inflicted, discounting any modifiers.</p> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-function"> <a name="gameeventtriggered" class="tsd-anchor"></a> <h3>game<wbr>Event<wbr>Triggered</h3> <ul class="tsd-signatures tsd-kind-function"> <li class="tsd-signature tsd-kind-icon">game<wbr>Event<wbr>Triggered<span class="tsd-signature-symbol">(</span>name<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, data<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>An event that is triggered when the game triggers an internal network event.</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>name: <span class="tsd-signature-type">string</span></h5> <div class="tsd-comment tsd-typography"> <p>The name of the triggered event.</p> </div> </li> <li> <h5>data: <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h5> <div class="tsd-comment tsd-typography"> <p>The type-specific event data.</p> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-function"> <a name="mumbleconnected" class="tsd-anchor"></a> <h3>mumble<wbr>Connected</h3> <ul class="tsd-signatures tsd-kind-function"> <li class="tsd-signature tsd-kind-icon">mumble<wbr>Connected<span class="tsd-signature-symbol">(</span>address<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, reconnecting<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>An event triggered when the game completes (re)connecting to a Mumble server.</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>address: <span class="tsd-signature-type">string</span></h5> <div class="tsd-comment tsd-typography"> <p>The address of the Mumble server connected to.</p> </div> </li> <li> <h5>reconnecting: <span class="tsd-signature-type">boolean</span></h5> <div class="tsd-comment tsd-typography"> <p>Is this a reconnection to a Mumble server.</p> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-function"> <a name="mumbledisconnected" class="tsd-anchor"></a> <h3>mumble<wbr>Disconnected</h3> <ul class="tsd-signatures tsd-kind-function"> <li class="tsd-signature tsd-kind-icon">mumble<wbr>Disconnected<span class="tsd-signature-symbol">(</span>address<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>An event triggered when the game disconnects from a Mumble server without being reconnected.</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>address: <span class="tsd-signature-type">string</span></h5> <div class="tsd-comment tsd-typography"> <p>The address of the Mumble server disconnected from.</p> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-function"> <a name="onclientresourcestart" class="tsd-anchor"></a> <h3>on<wbr>Client<wbr>Resource<wbr>Start</h3> <ul class="tsd-signatures tsd-kind-function"> <li class="tsd-signature tsd-kind-icon">on<wbr>Client<wbr>Resource<wbr>Start<span class="tsd-signature-symbol">(</span>resource<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>An event that is <em>queued</em> after a resource has started.</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>resource: <span class="tsd-signature-type">string</span></h5> <div class="tsd-comment tsd-typography"> <p>The name of the resource that has started.</p> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-function"> <a name="onclientresourcestop" class="tsd-anchor"></a> <h3>on<wbr>Client<wbr>Resource<wbr>Stop</h3> <ul class="tsd-signatures tsd-kind-function"> <li class="tsd-signature tsd-kind-icon">on<wbr>Client<wbr>Resource<wbr>Stop<span class="tsd-signature-symbol">(</span>resource<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>An event that is triggered after a resource has stopped.</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>resource: <span class="tsd-signature-type">string</span></h5> <div class="tsd-comment tsd-typography"> <p>The name of the resource that has stopped.</p> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-function"> <a name="onresourcestart" class="tsd-anchor"></a> <h3>on<wbr>Resource<wbr>Start</h3> <ul class="tsd-signatures tsd-kind-function"> <li class="tsd-signature tsd-kind-icon">on<wbr>Resource<wbr>Start<span class="tsd-signature-symbol">(</span>resource<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>An event that is triggered <em>immediately</em> when a resource has started.</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>resource: <span class="tsd-signature-type">string</span></h5> <div class="tsd-comment tsd-typography"> <p>The name of the resource that just started.</p> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-function"> <a name="onresourcestarting" class="tsd-anchor"></a> <h3>on<wbr>Resource<wbr>Starting</h3> <ul class="tsd-signatures tsd-kind-function"> <li class="tsd-signature tsd-kind-icon">on<wbr>Resource<wbr>Starting<span class="tsd-signature-symbol">(</span>resource<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>An event that is triggered when a resource is trying to start.</p> </div> <p>This can be canceled to prevent the resource from starting.</p> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>resource: <span class="tsd-signature-type">string</span></h5> <div class="tsd-comment tsd-typography"> <p>The name of the resource that is trying to start.</p> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-function"> <a name="onresourcestop" class="tsd-anchor"></a> <h3>on<wbr>Resource<wbr>Stop</h3> <ul class="tsd-signatures tsd-kind-function"> <li class="tsd-signature tsd-kind-icon">on<wbr>Resource<wbr>Stop<span class="tsd-signature-symbol">(</span>resource<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>An event that is triggered <em>immediately</em> when a resource is stopping.</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>resource: <span class="tsd-signature-type">string</span></h5> <div class="tsd-comment tsd-typography"> <p>The name of the resource that is stopping.</p> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-function"> <a name="populationpedcreating" class="tsd-anchor"></a> <h3>population<wbr>Ped<wbr>Creating</h3> <ul class="tsd-signatures tsd-kind-function"> <li class="tsd-signature tsd-kind-icon">population<wbr>Ped<wbr>Creating<span class="tsd-signature-symbol">(</span>x<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, y<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, z<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, model<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, overrideCalls<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">{ </span>setModel<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">; </span>setPosition<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>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.</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>x: <span class="tsd-signature-type">number</span></h5> <div class="tsd-comment tsd-typography"> <p>The X position the ped is trying to spawn at.</p> </div> </li> <li> <h5>y: <span class="tsd-signature-type">number</span></h5> <div class="tsd-comment tsd-typography"> <p>The Y position.</p> </div> </li> <li> <h5>z: <span class="tsd-signature-type">number</span></h5> <div class="tsd-comment tsd-typography"> <p>The Z position.</p> </div> </li> <li> <h5>model: <span class="tsd-signature-type">number</span></h5> <div class="tsd-comment tsd-typography"> <p>The intended model.</p> </div> </li> <li> <h5>overrideCalls: <span class="tsd-signature-symbol">{ </span>setModel<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">; </span>setPosition<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol"> }</span></h5> <div class="tsd-comment tsd-typography"> <p>Functions to override position or model.</p> </div> <ul class="tsd-parameters"> <li class="tsd-parameter"> <h5>set<wbr>Model<span class="tsd-signature-symbol">: </span>function</h5> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-type-literal"> <li class="tsd-signature tsd-kind-icon">set<wbr>Model<span class="tsd-signature-symbol">(</span>model<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Sets the model of the created ped.</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>model: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">number</span></h5> <div class="tsd-comment tsd-typography"> <p>The model hash or name of the target ped model.</p> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4> </li> </ul> </li> <li class="tsd-parameter"> <h5>set<wbr>Position<span class="tsd-signature-symbol">: </span>function</h5> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-type-literal"> <li class="tsd-signature tsd-kind-icon">set<wbr>Position<span class="tsd-signature-symbol">(</span>x<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, y<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, z<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Sets the position of the created ped.</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>x: <span class="tsd-signature-type">number</span></h5> <div class="tsd-comment tsd-typography"> <p>The X position the ped will spawn at.</p> </div> </li> <li> <h5>y: <span class="tsd-signature-type">number</span></h5> <div class="tsd-comment tsd-typography"> <p>The Y position.</p> </div> </li> <li> <h5>z: <span class="tsd-signature-type">number</span></h5> <div class="tsd-comment tsd-typography"> <p>The Z position.</p> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4> </li> </ul> </li> </ul> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4> </li> </ul> </section> </section>

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.

Last modified January 16, 2021: early events stuff (b6dad91)