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

SettingShipsWhat it does
EnableoffWhether the detection runs.
ActionbanWhat a hit does.
Types.Pickups.EnableonPickups. One switch, no methods.
Types.Peds.EnableonPeds, with the two methods below.
Types.Peds.Methods.NormalonUnverified ped spawns.
Types.Peds.Methods.AionPeds spawned close to players.
Types.Vehicles.EnableonVehicles, with the same two methods.
Types.Vehicles.Methods.NormalonUnverified vehicle spawns.
Types.Vehicles.Methods.AionVehicles spawned close to players.
Types.Objects.EnableonObjects 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.EnableoffStrips the ambient world as well. See below before you touch it.
DebugoffPrints every created entity to the game server console. Works whether or not the detection is on.
Read out of the resource config.json. Edit them from Protection Rules.

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.

TypeWhat lands in itMethods
PickupsPickupsNone
PedsPeds, including animalsNormal, Ai
VehiclesVehiclesNormal, Ai
ObjectsEverything else, so objects and propsNone

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.

ReasonMethodWhen
Unverified ped / vehicle / object spawn request detectedNormalThe Normal method fired. The reason names the singular entity type.
Unverified pickup spawn request detectedNoneA pickup hit, which writes no Method field and no Trigger field.
Ai ped / vehicle spawn request detectedAIThe Ai method fired, and the Trigger field says whether it was Too Close or Near Other Player.
There is no Ai pickup or Ai object reason.
FieldWhat it holds
Config OptionEntitiesSpawnProtection.
MethodNormal or AI, so you know which method to tune. Absent on a pickup hit.
TriggerToo Close or Near Other Player, on AI hits only.
Entity TypePickups, Peds, Vehicles or Objects.
Entity ModelThe model hash. This is what goes in WhitelistModels.
Entity Population TypeThe game’s own population number for the entity.
Entity ScriptThe 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.
The same fields appear under Additional Info on the detection row.

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.