Events and handlers
Handler decisions
Events and handlers for REC_Core, with configuration and implementation details.
- Added
- Updated
| File | Function | Return value |
|---|---|---|
handler/sv_handler.lua | getSpawnPosition(playerId, character) | vector4 overrides the spawn; nil uses the normal fallback. |
handler/sv_handler.lua | canChangeMoney(playerId, account, action, amount, reason) | false rejects an online balance change. |
handler/sv_handler.lua | getPaycheck(playerId, character, amount) | Return a positive integer; 0 skips the paycheck. |
handler/sv_handler.lua | canSetValue(citizenId, namespace, dataKey, value) | false rejects an online value write. |
handler/cl_handler.lua | onSpawn(character, spawn) | true takes full responsibility for spawning; false continues the default spawn. |
Server observation hooks cover load, unload, creation, deletion, balance, job, gang, duty, profile, metadata, and value changes. The unload handler runs before the final save, allowing it to write values while the character remains loaded. Its server event runs after disposal, so use the handler when a write must enter that final save. Client hooks observe load, unload, money, job, gang, profile, metadata, and value changes. Keep event listeners and hooks free of unguarded writes to the same field, which could trigger the same callback again.
