Skocz do zawartości

Nowy szablon forum

mygo.pl

Stworzyliśmy dla Was nowy wygląd forum. Z pewnością znajdziesz rzeczy, które wg Ciebie mogą zostać zmienione - wspomnij o tym w specjalnym wątku.

Czytaj więcej

Jak założyć własną sieć

serwerów CS

Zastanawiasz się nad prowadzeniem własnej sieci serwerów? Przeczytaj podstawowe informacje, na które należy zwrócić uwagę, przy takim projekcie.

Czytaj więcej

Tworzymy spis sieci

dodaj swoją

Dodaj sieć do której należysz, pozwoli to na promocję i budowę ogólnopolskiej bazy sieci CS.

Czytaj więcej

[CS:GO] Entity Spawner (v1.0 8/2/2018)


MYGO.pl
 Udostępnij

Rekomendowane odpowiedzi

  • RSSy
Entity Spawner v1.0


THIS PLUGIN REQUIRES: NAV AREA UTILITIES

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
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: https://developer.valvesoftware.com/wiki/List_of_Counter-Strike:_Global_Offensive_Entities
//
//    "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 keyvalues, 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 amount 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_"

"entities"
{
    
"de_"
    
{
        
"spawnroundstart"    "1"
        "maxroundspawns"    "0"
        "spawninterval"        "0"
        "resettimer"        "1"
        
        "AWP"
        
{
            
"classname"        "weapon_awp"
            "maxspawns"        "20"
            "zoffset"        "10.0"
            "slopes"        "1"
        
}
        
        
"Breakable Crate"
        
{
            
"classname"        "prop_physics_override"
            "keyvalue0"        "model models/props_junk/wood_crate001a.mdl"
            "prop0"            "m_takedamage 2"
            "maxspawns"        "50"
            "zoffset"        "10.0"
            "slopes"        "1"
        
}
        
        
"Chicken Medium"
        
{
            
"classname"        "chicken"
            "maxspawns"        "20"
            "zoffset"        "5.0"
            "slopes"        "1"
        
}
    }
    
    
"cs_"
    
{
        
"spawnroundstart"    "1"
        "maxroundspawns"    "0"
        "spawninterval"        "0"
        "resettimer"        "1"
        
        "AWP"
        
{
            
"classname"        "weapon_awp"
            "maxspawns"        "20"
            "zoffset"        "10.0"
            "slopes"        "1"
        
}
        
        
"Breakable Crate"
        
{
            
"classname"        "prop_physics_override"
            "keyvalue0"        "model models/props_junk/wood_crate001a.mdl"
            "prop0"            "m_takedamage 2"
            "maxspawns"        "50"
            "zoffset"        "10.0"
            "slopes"        "1"
        
}
        
        
"Chicken Medium"
        
{
            
"classname"        "chicken"
            "maxspawns"        "20"
            "zoffset"        "5.0"
            "slopes"        "1"
        
}
    }


Include:
PHP Code:

#if defined _entityspawner_included
 #endinput
#endif
#define _entityspawner_included

#define ES_PREFIX " \x09[\x04ES\x09]"
#define ES_MAX_ENTITIES 256
#define ES_INVALID_MAX_SPAWNS 0
#define ES_INVALID_SPAWN_INTERVAL 0
#define ES_INVALID_PROP_SEND_OFFSET -1
#define ES_INVALID_PROP_DATA_OFFSET -1

/**
 * 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
};

#if !defined REQUIRE_PLUGIN
public __pl_entityspawner_SetNTVOptional()
{    
    
MarkNativeAsOptional("ES_SpawnEntities");
    
MarkNativeAsOptional("ES_ClearEntities");
    
MarkNativeAsOptional("ES_IsSpawningOnRoundStart");
    
MarkNativeAsOptional("ES_IsRandomSpawnsEnabled");
}
#endif 

Extra:
Make sure your map has a .nav file. Will barely work if not.

Credits:
  • Me

DOWNLOAD

Wyświetl pełny artykuł

Odnośnik do komentarza
Udostępnij na innych stronach

Jeśli chcesz dodać odpowiedź, zaloguj się lub zarejestruj nowe konto

Jedynie zarejestrowani użytkownicy mogą komentować zawartość tej strony.

Zarejestruj nowe konto

Załóż nowe konto. To bardzo proste!

Zarejestruj się

Zaloguj się

Posiadasz już konto? Zaloguj się poniżej.

Zaloguj się
 Udostępnij

  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...