AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   Plugin request: Terminate round end when all players dead (https://forums.alliedmods.net/showthread.php?t=327973)

dust2 10-19-2020 10:35

Plugin request: Terminate round end when all players dead
 
Hello,

I have a plugin request about terminating round:

Terminate round when all alive players are dead (excluding bots).
I am using mp_ignore_round_win_conditions 1

Sounds simple but is coding that simple? :D

-dust2

SSheriFF 10-19-2020 11:16

Re: Plugin request: Terminate round end when all players dead
 
Quote:

Originally Posted by dust2 (Post 2721907)
Hello,

I have a plugin request about terminating round:

Terminate round when all alive players are dead (excluding bots).
I am using mp_ignore_round_win_conditions 1

Sounds simple but is coding that simple? :D

-dust2

PHP Code:

#pragma semicolon 1

#define DEBUG

#include <sourcemod>
#include <sdktools>
#include <cstrike>
#pragma newdecls required

public Plugin myinfo 
{
    
name "Terminate Round",
    
author "SheriF",
    
description "",
    
version "1.0",
    
url ""
};

public 
void OnPluginStart()
{
    
HookEvent("player_death"OnPlayerDeathEventHookMode_Post);
}
public 
Action OnPlayerDeath(Event eventchar[] namebool dontBroadcast)
{
    if(
IsEveryoneDead())
    
CS_TerminateRound(0.0CSRoundEnd_Drawfalse);
}
bool IsEveryoneDead()
{
    for (
int i 1<= MaxClientsi++)
    {
        if(
IsClientInGame(i) && !IsFakeClient(i) && IsPlayerAlive(i))
            return 
false;
    }
    return 
true;



dust2 10-19-2020 11:37

Re: Plugin request: Terminate round end when all players dead
 
This plugin works very well! Thank you very much!
I have one more question. Is there a way to add some time after new round starts?
I ex. to follow mp_round_restart_delay 10.

SSheriFF 10-19-2020 12:22

Re: Plugin request: Terminate round end when all players dead
 
Quote:

Originally Posted by dust2 (Post 2721912)
This plugin works very well! Thank you very much!
I have one more question. Is there a way to add some time after new round starts?
I ex. to follow mp_round_restart_delay 10.

Change
PHP Code:

CS_TerminateRound(0.0CSRoundEnd_Drawfalse); 

To
PHP Code:

CS_TerminateRound(10.0CSRoundEnd_Drawfalse); 


dust2 10-19-2020 12:37

Re: Plugin request: Terminate round end when all players dead
 
Thank you! Now it works exactly how I wanted it to do! You are awesome! :))))


All times are GMT -4. The time now is 19:22.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.