Entities Spawn Protection
What this detection catches, what it ships as, how to read a hit, and the order to clear a false positive in.
Entities Spawn Protection watches every entity a player creates and acts when one did not come from a script it trusts. It is the fix other pages point at for a spawn flood, it ships switched off, and it needs its whitelists filled in before it is safe to leave banning.
What it ships as
| Setting | Ships | What it does |
|---|---|---|
Enable | off | Whether the detection runs. |
Action | ban | What a hit does. |
Types.Pickups.Enable | on | Pickups. One switch, no methods. |
Types.Peds.Enable | on | Peds, with the two methods below. |
Types.Peds.Methods.Normal | on | Unverified ped spawns. |
Types.Peds.Methods.Ai | on | Peds spawned close to players. |
Types.Vehicles.Enable | on | Vehicles, with the same two methods. |
Types.Vehicles.Methods.Normal | on | Unverified vehicle spawns. |
Types.Vehicles.Methods.Ai | on | Vehicles spawned close to players. |
Types.Objects.Enable | on | Objects and props. One switch, no methods. |
WhitelistResources | [] | Scripts whose entities are never checked. Matched against the Entity Script field in the log. |
WhitelistModels | [] | Models that are never checked. Takes a model name or the numeric hash from the log. |
RemoveNPCs.Enable | off | Strips the ambient world as well. See below before you touch it. |
Debug | off | Prints every created entity to the game server console. Works whether or not the detection is on. |
What it watches
Every entity a player creates falls into one of four types, and the type names in the config match the names in the log exactly. Only Peds and Vehicles carry a Methods block.
| Type | What lands in it | Methods |
|---|---|---|
Pickups | Pickups | None |
Peds | Peds, including animals | Normal, Ai |
Vehicles | Vehicles | Normal, Ai |
Objects | Everything else, so objects and props | None |
The two methods
Normal flags a ped, vehicle or object spawn that did not come from a script Raven trusts. A script on Resources Installation's whitelist (Auto-Installation's ignore list before 1.9.3) produces these on every spawn.
Ai flags peds and vehicles spawned close to players, and logs either Near Other Player or Too Close. It covers Peds and Vehicles only.
Reading a hit
The reason line names the method and the entity, so you can tell the routes apart at a glance.
| Reason | Method | When |
|---|---|---|
| Unverified ped / vehicle / object spawn request detected | Normal | The Normal method fired. The reason names the singular entity type. |
| Unverified pickup spawn request detected | None | A pickup hit, which writes no Method field and no Trigger field. |
| Ai ped / vehicle spawn request detected | AI | The Ai method fired, and the Trigger field says whether it was Too Close or Near Other Player. |
| Field | What it holds |
|---|---|
Config Option | EntitiesSpawnProtection. |
Method | Normal or AI, so you know which method to tune. Absent on a pickup hit. |
Trigger | Too Close or Near Other Player, on AI hits only. |
Entity Type | Pickups, Peds, Vehicles or Objects. |
Entity Model | The model hash. This is what goes in WhitelistModels. |
Entity Population Type | The game’s own population number for the entity. |
Entity Script | The resource that created the entity. This is what goes in WhitelistResources, and it is empty when the game could not attribute the spawn to a script. |
Clearing a false positive
Both whitelists are checked before the detection acts, so a whitelisted resource or model is never reported and, with RemoveNPCs off, never deleted either. Work down this list and stop at the first fix that holds, because each step after it is a bigger hole than the one before.
Whitelist the resource
Add the script named in Entity Script to WhitelistResources. This is the right fix almost every time: it trusts one script and leaves the detection protecting everything else. If Entity Script is empty on the row, the game could not attribute the spawn, and this fix is not available for it.
Whitelist the model
For a one-off, add the value from Entity Model to WhitelistModels. The list takes either the model name or the numeric hash from the log, so whichever you have in front of you works. It exempts that model everywhere, in every script and for every player.
Turn off the method, then the type
If the hits all share one Method, turn that method off and keep the other. Turning the whole type off is the last resort: it stops the detection for every player and every script, which is a much bigger hole than the one you are patching.
The two extras
Debug
Debug prints a line to the game server console for every entity a player creates, including the model, the entity type and the creating script. It works with Enable still off. That makes it the cheapest way to collect the model and script names for your whitelists before you arm anything.
RemoveNPCs
RemoveNPCs.Enable is not a cheat check. With it on, ambient peds and vehicles are deleted as the game creates them and the routing bucket's own population is switched off, so the city empties out. It only takes effect while the detection itself is enabled. Leave it off unless an empty map is what you are after, and expect the ambient traffic and pedestrians your players are used to to disappear the moment you save it.
Where to go next
Protection Rules is where these switches and both lists live. Your first hour of tuning covers the order to bring this detection up in, and Resources and World is the cleanup for a flood that is already on the map rather than the fix for it.