Description:
Spawn entities randomly across the map. Entities spawned can be set in configs/entityspawner/entities.cfg
Commands:
Quote:
sm_esspawn - Force spawn all props on the current map. (Will remove previously spawned props first) - flag Z sm_esclear - Force remove all props spawned by this plugin - flag Z sm_esreload - Reload entities.cfg - flag Z
Convars:
Quote:
entityspawner_nav_areas_required - 50 - Amount of nav areas required for items to spawn entityspawner_spawn_limit - 1900 - Stop spawning entities once global entity count reaches this value
Preview:
Stock Config:
PHP Code:
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// INFO
//
// The config is read from top to bottom, so maps put further up
// the config will be prioritized
//
// Example:
// - de_dust2
// - de_
//
// If the map is dust2, the spawns for that section will be read.
// If the map is nuke, the spawns for "de_" section will be read.
//
// MAP KEYS:
// "spawnroundstart" "<number>" - 0 will disable entity spawning on round start
// - 1 will enable entity spawning on round start
//
// "maxroundspawns" "<number>" - Amount of rounds entities will spawn
// - 0 will spawn entities every round
//
// "spawninterval" "<number>" - Amount of seconds until entities should spawn again
// - 0 will disable
//
// "resettimer" "<0/1>" - Should the spawn timer be reset on round start or transfer over rounds
//
//
// ENTITY KEYS:
// "classname" "<string>" - The classname of the entity you want to spawn
// - List of CSGO specific entities can be found here: [url]https://developer.valvesoftware.com/wiki/List_of_Counter-Strike:_Global_Offensive_Entities[/url]
//
// "keyvalue<number>" "<key> <value>" - Enter a keyvalue for a entity, this is optional
// - If you need to set multiple keyvalues, just increment the number after the key
// Example:
// - "keyvalue0" "model modelpath/modelname.mdl"
// - "keyvalue1" "modelscale 5.0"
//
// "prop<number>" "<prop> <value>" - Enter a value for an entity property, this is optional
// - If you need to set multiple props, just increment the number after the key
// Example:
// - "prop0" "m_iHealth 2"
// - "prop1" "m_vecOrigin 50.0 24.5 36.0"
// - "prop2" "m_iszName hehehehe"
//
// "maxspawns" "<number"> - Max amount of times this entity could be spawned per round.
// However, it does not guarantee that it will spawn this amount of times.
//
// "zoffset" "<decimal>" - If the terrain is very uneven like dust2, increase this value a bit (5.0 - 10.0)
// and you might see an increase of spawns.
// - The reason for this key is because everytime a prop is spawned, it makes sure
// that the prop fits around the area its spawned.
// - Increasing this value will make the prop spawn higher above the ground
//
// "slopes" "<0/1>" - Can this entity spawn on slopes or only flat surfaces
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////
// This stock config will spawn AWPS/Breakable crates/Chickens on maps that start with "de_" or "cs_"
/**
* Spawns random entities on the map (Set in entityspawner.cfg)
* @return int amount of entities spawned
*/
native int ES_SpawnEntities();
/**
* Clears all randomly spawned entities
* @return int amount of entities removed
*/
native int ES_ClearEntities();
/**
* Returns true if spawning is enabled on round start
* @return bool are entities spawning on round start
*/
native bool ES_IsSpawningOnRoundStart();
/**
* Returns true if theres enough nav areas (Set by convar) and if config is setup for current map
* @return bool enough nav areas/config setup
*/
native bool ES_IsRandomSpawnsEnabled();
/**
* Called when entities are randomly spawned across the map
* @param entities that spawned (Entity references)
* @param amount of entities spawned
* @noreturn
*/
forward void ES_OnEntitiesSpawned(int entities[ES_MAX_ENTITIES], int entCount);
/**
* Called when all randomly spawned entities are removed
* @param amount of entities removed
* @noreturn
*/
forward void ES_OnEntitiesCleared(int entCount);
public SharedPlugin __pl_entityspawner =
{
name = "entityspawner",
file = "entityspawner.smx",
#if defined REQUIRE_PLUGIN
required = 1
#else
required = 0
#endif
};