Raised This Month: $32 Target: $400
 8% 

Plugin request: Terminate round end when all players dead


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
dust2
Member
Join Date: Jun 2016
Old 10-19-2020 , 10:35   Plugin request: Terminate round end when all players dead
Reply With Quote #1

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?

-dust2
dust2 is offline
SSheriFF
AlliedModders Donor
Join Date: May 2020
Location: Israel
Old 10-19-2020 , 11:16   Re: Plugin request: Terminate round end when all players dead
Reply With Quote #2

Quote:
Originally Posted by dust2 View Post
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?

-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;

__________________
Taking small private requests (Free) and big private requests (Paid).
Contact me via Discord: WilDick#1524

My Plugins:
SSheriFF is offline
dust2
Member
Join Date: Jun 2016
Old 10-19-2020 , 11:37   Re: Plugin request: Terminate round end when all players dead
Reply With Quote #3

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.
dust2 is offline
SSheriFF
AlliedModders Donor
Join Date: May 2020
Location: Israel
Old 10-19-2020 , 12:22   Re: Plugin request: Terminate round end when all players dead
Reply With Quote #4

Quote:
Originally Posted by dust2 View Post
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); 
__________________
Taking small private requests (Free) and big private requests (Paid).
Contact me via Discord: WilDick#1524

My Plugins:
SSheriFF is offline
dust2
Member
Join Date: Jun 2016
Old 10-19-2020 , 12:37   Re: Plugin request: Terminate round end when all players dead
Reply With Quote #5

Thank you! Now it works exactly how I wanted it to do! You are awesome! )))
dust2 is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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