View Single Post
alphaearth
Senior Member
Join Date: Feb 2018
Location: Turkey
Old 02-16-2019 , 14:20   Re: Send commands to console in 10 rounds 1
Reply With Quote #6

Spoiler



PHP Code:
#include <sourcemod>
#include <sdktools>
int RoundCount 0;
ConVar RestartGame;
/// native GameRules_GetProp(const String:prop[], size=4, element=0);

public void OnPluginStart()
{
    
RegAdminCmd("sm_rr"RRADMFLAG_GENERIC)
    
HookEvent("round_start"Event_RoundStart);
    
RestartGame CreateConVar("mp_restartgame""1");
    
HookConVarChange(RestartGameDetected);
    
AutoExecConfig(true"botbenson_strip""sourcemod");
}

public 
void OnMapStart()
{
    
RoundCount 0;
}

public 
Detected(ConVar convar, const char[] oldValue, const char[] newValue)
{
    
RoundCount 0;    
}

public 
Action RR(clientargs)
{
    
ServerCommand("mp_restartgame 1");
    
RoundCount 0;    
}

public 
Action Event_RoundStart(Event event, const char[] namebool dontBroadcast)
{
    if (
GameRules_GetProp("m_bWarmupPeriod") == 0
    {
        
RoundCount++;
        if(
RoundCount != 10 && RoundCount != 20 && RoundCount != 30 && RoundCount != 40 && RoundCount != 50 && RoundCount != 60) {
            
ServerCommand("sm_strip @all 2");
        }
    }
    else
    {
        
RoundCount=0;
    }


I think it will work this way
__________________

Last edited by alphaearth; 02-16-2019 at 14:21.
alphaearth is offline