View Single Post
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 10-21-2021 , 13:04   Re: [ANY] Dev Cmds (1.25) [13-Sep-2021]
Reply With Quote #78

Addition to my previous code for sm_nospawn:

sm_nospawn sometimes miss infected/specials, bacause
PHP Code:
        FindConVar("director_no_bosses").SetInt(1);
        
FindConVar("director_no_specials").SetInt(1);
        
FindConVar("director_no_mobs").SetInt(1); 
wasn't enough, (e.g. when panic event occurs), so I also added:
PHP Code:
HookEvent("player_spawn"Event_PlayerSpawn);

public 
Action Event_PlayerSpawn(Event event, const char[] namebool dontBroadcast)
{
    if( 
g_bNospawn )
    {
        
int client GetClientOfUserId(event.GetInt("userid"));
        if( 
client && IsClientInGame(client) && GetClientTeam(client) == )
        {
            
KickClient(client);
        }
    }
}

public 
void OnEntityCreated(int entity, const char[] classname)
{
    if( 
g_bNospawn )
    {
        if( 
strcmp(classname"infected") == )
        {
            
SDKHook(entitySDKHook_SpawnPostOnSpawnCommon);
        }
    }
}

public 
void OnSpawnCommon(int Ent)
{
    
RemoveEntity(Ent);

Also, could you add please, sm_tele to use like:
Code:
sm_tele @all // teleports everybody to my position
sm_tele @all <x y z>
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline