Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fivemevents

A drop-in replacement for baseevents, built on ox_lib.

Every event name, argument order and payload shape matches baseevents, so existing resources keep working unchanged. The manifest declares provide 'baseevents', so anything with dependency 'baseevents' is satisfied by this resource.

Install

  1. Add ox_lib to your server if you do not already run it.
  2. Stop baseevents. In server.cfg, replace ensure baseevents with ensure fivemevents — running both duplicates every event.

Events

Client and server:

Event Arguments
baseevents:onPlayerDied killerType, position
baseevents:onPlayerKilled killerServerId, data

data contains killertype, weaponhash, killerinveh, killervehseat, killervehname, killerpos.

Server only:

Event Arguments
baseevents:enteringVehicle vehicle, seat, modelName, netId
baseevents:enteredVehicle vehicle, seat, modelName, netId
baseevents:leftVehicle vehicle, seat, modelName, netId
baseevents:enteringAborted

vehicle is the sending client's entity handle and is meaningless on the server — use netId.

baseevents:onPlayerWasted is registered so other resources can trigger and listen to it, but this resource never emits it. Neither does baseevents: its guard requires hasBeenDead to be false at a point where the same tick has already set it to true, so no consumer has ever received it.

Why it is cheaper

baseevents runs two Wait(0) threads, so both loops tick every frame for the lifetime of the session. Here, death state is polled at a fixed interval, vehicle occupancy rides on the cache ox_lib already maintains, and the only remaining poll — vehicle entry attempts, which have no event equivalent — backs off to idlePollInterval whenever the player is seated or dead. Intervals live in config.lua, alongside the debugEnabled toggle that logs every event this resource emits.

Differences from baseevents

Behaviour that was broken upstream and is corrected here:

  • killerinveh, killervehname and killervehseat are populated. baseevents compares a boolean native result against 1, which is never true in Lua, so those fields were always false, '' and 0.
  • A player warped straight from one vehicle to another gets a leftVehicle / enteredVehicle pair. baseevents missed the transition and kept reporting the first vehicle until the player got out.

About

Basevents Replacement Using ox_lib

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages