A list of server side events you can use in your scripts.
These events are part of FiveM and do not require any resource.
A server-side event that is triggered when an entity is being created.
This event can be canceled to instantly delete the entity.
Triggered when an entity is removed on the server.
The handle of the entity that got removed.
A server-side event triggered when the refresh
command completes.
An event that is triggered immediately when a resource has started.
The name of the resource that just started.
An event that is triggered when a resource is trying to start.
This can be canceled to prevent the resource from starting.
The name of the resource that is trying to start.
An event that is triggered immediately when a resource is stopping.
The name of the resource that is stopping.
An event that is queued after a resource has started.
The name of the resource that has started.
An event that is triggered after a resource has stopped.
The name of the resource that has stopped.
A server-side event that is triggered when a player is trying to connect.
This event can be canceled to reject the player instantly, assuming you haven't yielded.
The display name of the player connecting.
A function used to set a reason message for when the event is canceled.
An object to control deferrals.
deferrals.defer
will initialize deferrals for the current resource. It is required to wait for at least a tick after calling defer before calling update
, presentCard
or done
.
deferrals.done
finalizes a deferral. It is required to wait for at least a tick before calling done
after calling a prior deferral method.
If specified, the connection will be refused, and the user will see the specified message as a result. If this is not specified, the user will be allowed to connect.
deferrals.handover
adds handover data for the client to be able to use at a later point.
Data to pass to the connecting client.
deferrals.presentCard
will send an Adaptive Card to the client.
An object containing card data, or a serialized JSON string with the card information.
If present, will be invoked on an Action.Submit
event from the Adaptive Card.
A callback to be invoked for Action.Submit
.
A parsed version of the data sent from the card.
A JSON string containing the data sent from the card.
deferrals.update
will send a progress message to the connecting client.
The string to send to the client.
The player's temporary NetID (a number in Lua/JS), not a real argument, use [FromSource] or source.
A server-side event that is triggered when a player enters another player's scope.
Data containing the players entering each other's scope.
The player for which the scope is being entered.
The player that is entering the scope.
A server-side event that is triggered when a player has a finally-assigned NetID.
The player's NetID (a number in Lua/JS), not a real argument, use [FromSource] or source.
The original TempID for the connecting player, as specified during playerConnecting.
A server-side event that is triggered when a player leaves another player's scope.
Data containing the players leaving each other's scope.
The player for which the scope is being left.
The player that is leaving the scope.
Triggered when a particle fx (ptFx) is created.
The ID of the player that triggered the event.
The event data.
Triggered when a player removes all weapons from a ped owned by another player.
The ID of the player that triggered the event.
The event data.
Triggered when a projectile is created.
The ID of the player that triggered the event.
The event data.
Triggered when a client wants to apply damage to a remotely-owned entity. This event can be canceled.
The server-side player ID of the player that triggered the event.
The event data.
The timestamp the damage was originally inflicted at. This should match the global network timer.
A value (between 0 and 3) containing an internal damage type. Specific values are currently unknown.
Whether the damage should be inflicted as if it hit the weapon the entity is carrying. This likely applies to grenades being hit, which should explode, but also normal weapons, which should not harm the player much.
The network ID of the victim entity.
An array containing network IDs of victim entities. If there is more than one, the first one will be set in hitGlobalId
.
Whether the damage should be inflicted as if it hit an ammo attachment component on the weapon. This applies to players/peds carrying weapons where another player shooting the ammo component makes the weapon explode.
If set, 'weaponDamage' is valid. If unset, the game infers the damage from weapon metadata.
Set when the damage is applied using a silenced weapon.
The amount of damage inflicted, if overrideDefaultDamage
is set. If not, this value is set to 0
.
The weapon hash for the inflicted damage.
Whether the originating client thinks this should be instantly-lethal damage, such as a critical headshot.
A server-side event that is triggered when an entity has been created.