Skip to content

REVO / API version 0.0.10

IServerEvent

Entity state notifications are queued. Check valid before reading entity properties. Combat and connection callbacks run synchronously.

Property Type Details
armourChanged (ped, oldArmour, newArmour, source) => void —
beforeDamage (event) => number | void Return damage in [0, 1000000], or nothing to keep it unchanged. Returning 0 cancels damage and skips later listeners. Listeners run in order and receive earlier changes. Returning a Promise, an invalid value or throwing cancels damage.
currentWeaponChanged (ped, oldWeapon, newWeapon, source) => void —
engineStateChanged (vehicle, oldRunning, newRunning, source) => void —
entityCreated (entity) => void —
entityRemoved (entity) => void —
healthChanged (entity, oldHealth, newHealth, source) => void —
lightDamageChanged (vehicle, light, oldDamaged, newDamaged, source) => void —
maxHealthChanged (ped, oldMaxHealth, newMaxHealth, source) => void —
netOwnerChanged (entity, oldOwner, newOwner) => void —
playerConnected (player) => void Fires after the handshake. player.spawn() is available from this point.
playerDied (player, source) => void —
playerDisconnected (player, reason, message) => void Only fires for players who completed the handshake. The player is valid during this callback and becomes invalid afterwards.
playerEnteredVehicle (player, vehicle, seat) => void —
playerEnteringVehicle (player, vehicle, seat) => void —
playerExitedVehicle (player, vehicle, seat, reason) => void —
playerExitingVehicle (player, vehicle, seat) => void —
playerSpawned (player, position) => void Fires when the server applies the spawn. The client may still be loading the player.
playerVehicleEntryCancelled (player, vehicle, seat, reason) => void —
projectileLaunched (source, weapon, origin, direction, velocity) => void —
radioStationChanged (vehicle, oldStation, newStation, source) => void —
serverStop () => void | Promise<void> Return a Promise to finish cleanup before the server stops. All handlers share a 10-second timeout. Existing players and server logic keep running. New connections are blocked. A throw or rejected Promise does not skip other handlers. Errors and timeouts set exit code 1. process.exit() skips the wait. The timeout cannot interrupt synchronous code.
syncedMetaChange (object, key, newValue, oldValue) => void Queued after metadata changes. Missing old or new values are undefined.
trailerAttached (truck, trailer) => void —
trailerDetached (truck, trailer) => void —
tyreBurst (vehicle, wheel, source) => void —
tyreFixed (vehicle, wheel, source) => void —
weaponShotAccepted (source, weapon, origin, direction) => void —

Events and listeners