An apocalypse should feel empty. en-core removes GTA's ambient pedestrians, traffic and emergency services, so the only people in the world are players and the things scripts spawn on purpose: zombies, traders and EndCore vehicles. It also tracks when a player dies or is revived, so other resources can react.
Ambient population
Three switches in config/client.lua control the world. The server reads them too.
| Key | Default | What it does |
|---|---|---|
world.disablePedestrians | true | No ambient peds |
world.disableTraffic | true | No moving or parked vehicles, trains, boats or planes |
world.disableDispatch | true | No police, ambulance or fire services and no wanted level |
On the server
If disablePedestrians or disableTraffic is not false, en-core turns off population in routing bucket 0. Every 5 seconds it does the same for any routing bucket a player is in, so instanced interiors stay empty as well.
| Export | Returns |
|---|---|
IsPopulationDisabled() | boolean |
On the client
Every frame, while enabled:
- Ped, scenario, vehicle, parked vehicle and ambient density multipliers are held at 0.
- Garbage trucks, boats, trains, distant cars, parked vehicles and vehicle, military and police scenarios are disabled.
When disableDispatch is set:
- Dispatch services 1–15 are disabled.
- The maximum wanted level is 0 and random cops are off.
- Police ignore the player and the police scanner is muted.
These settings are reapplied every 10 seconds in case something else changes them.
Script-spawned entities are not affected. Zombies from en-zombies, traders and vehicles created by EndCore resources appear as normal.
Player movement and health
config/client.lua also sets a few player rules, applied every second while logged in.
| Key | Default | What it does |
|---|---|---|
player.runSpeed | 1.0 | Sprint speed multiplier |
player.fastSwim | false | Turns on the swim speed multiplier |
player.fastSwimSpeed | 1.2 | Swim speed multiplier when fastSwim is on |
player.infiniteStamina | false | Restores stamina every second |
The game's own health regeneration is always switched off. Healing is the job of items and resources, not the game.
The client reports health and armour to the server every 10 seconds when they change. They are stored in metadata as health (0–200) and armor (0–100).
Death and revive
en-core notices death by checking the local ped every 500 ms while the player is logged in. It does not need baseevents.
- The player dies. The client sends
encore:server:onPlayerDeath(killerServerId, cause)and fires the local eventencore:client:playerDied(killerServerId, cause). - The server records it. It sets
metadata.isdead = trueandmetadata.inlaststand = false, logs to thedeathwebhook, and firesencore:server:playerDied(source, killerServerId, cause). - The player is alive again. When the ped is no longer dead, for example after a medic or respawn script resurrects it, the client sends
encore:server:onPlayerReviveand fires the local eventencore:client:playerRevived. - The server clears the flags. It sets
isdeadandinlaststandback tofalsein one update.
While isdead or inlaststand is true, the survival tick skips that player.
Last stand
The net event encore:server:onPlayerLastStand sets inlaststand = true. en-core has no last stand system of its own, and no EndCore resource currently sends this event. It is there for a downed-state resource to use.
Respawning
en-core has no respawn logic. The death screen, the wait timer and choosing where to spawn are handled by en-respawn. A revive or respawn resource only has to bring the ped back to life; en-core notices and clears the dead state.
Events
| Side | Event | Payload |
|---|---|---|
| Client sends | encore:server:onPlayerDeath | killerServerId, cause |
| Client sends | encore:server:onPlayerRevive | none |
| Client sends | encore:server:onPlayerLastStand | none |
| Client sends | encore:server:syncHealth | health, armor |
| Server | encore:server:playerDied | source, killerServerId, cause |
| Client (local) | encore:client:playerDied | killerServerId, cause |
| Client (local) | encore:client:playerRevived | none |
Revive and last stand changes go through metadata, so they also fire encore:server:onSetMetaData for isdead and inlaststand.
Examples
Reward kills between players who are not in the same group:
AddEventHandler('encore:server:playerDied', function(source, killerServerId, cause)
local killer = tonumber(killerServerId)
if not killer or killer == source or not exports['en-core']:IsPlayerLoaded(killer) then
return
end
if not exports['en-core']:AreInSameGroup(killer, source) then
exports['en-core']:AddXP(killer, 50, 'Player kill')
end
end)Check whether a player is down before letting them use something:
if exports['en-core']:GetPlayerMetadata(source, 'isdead') then
return
endShow a message on the client when you die:
AddEventHandler('encore:client:playerDied', function(killerServerId, cause)
encore.notify({ description = 'You died.', type = 'error' })
end)