View Single Post
konash
Junior Member
Join Date: Mar 2020
Old 03-28-2020 , 15:50   Re: [css] auto restartgame after X rounds
Reply With Quote #3

Quote:
Originally Posted by Bacardi View Post
ok.

PHP Code:


/*
Server event "round_end", Tick 15041:
- "winner" = "1"
- "reason" = "9"
- "message" = "#Round_Draw"
*/

int maxrounds 15// max rounds

public void OnPluginStart()
{
    
HookEventEx("round_end"round_end);
}

public 
void round_end(Event event, const char[] namebool dontBroadcast)
{
    static 
int wins 0;

    if(
event.GetInt("winner") >= 2)
    {
        
wins++;

        
PrintToChatAll("[SM] Rounds played %i/%i"winsmaxrounds);

        if(
wins >= maxrounds)
        {
            
wins 0;

            
PrintToChatAll("[SM] Restart game");
            
ServerCommand("mp_restartgame 3");
        }
    }
    else
    {
        
wins 0;
    }


put it in wich folder ?
konash is offline