Raised This Month: $535 Target: $400
 133% 

Request: Plugin that terminates round (excluding bots)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SANDELS
New Member
Join Date: Nov 2022
Old 12-01-2022 , 17:46   Request: Plugin that terminates round (excluding bots)
Reply With Quote #1

Hello,

Is there already existing this kind of plugin that terminates round when all players are dead? (excluding bots)

These are my requirements for the plugin:

- The round should end, when there are no human players on CT or T side. (ignore bots)
- I am planning to use mp_ignore_round_win_conditions 1, so the plugin should override it.
- Plugin should obey the mp_round_restart_delay time (or cvar to set the round end delay manually)

If anyone could help me out, I'd be super happy!
SANDELS is offline
SANDELS
New Member
Join Date: Nov 2022
Old 12-04-2022 , 00:31   Re: Request: Plugin that terminates round (excluding bots)
Reply With Quote #2

I can pay for the work!
SANDELS is offline
Cruze
Veteran Member
Join Date: May 2017
Old 12-04-2022 , 08:30   Re: Request: Plugin that terminates round (excluding bots)
Reply With Quote #3

PHP Code:
#include <sourcemod>
#include <cstrike>

#define DEFAULT_ROUNDEND_DELAY 7.0

ConVar g_hRestartDelay;

public 
void OnPluginStart()
{
    
HookEvent("player_death"Event_PlayerDeath);
    
    
g_hRestartDelay FindConVar("mp_round_restart_delay");
}

public 
void Event_PlayerDeath(Event ev, const char[] namebool dbc)
{
    if(
GetAliveTeamPlayerCount(2) < && GetAliveTeamPlayerCount(3) < 1)
    {
        
CS_TerminateRound(g_hRestartDelay != null g_hRestartDelay.FloatValue DEFAULT_ROUNDEND_DELAYCSRoundEnd_Draw);
    }
}

int GetAliveTeamPlayerCount(int team)
{
    
int count;
    for(
int i 1<= MaxClientsi++)
    {
        if(
IsClientInGame(i) && !IsFakeClient(i) && IsPlayerAlive(i) && GetClientTeam(i) == team)
        {
            
count++;
        }
    }
    return 
count;

Attached Files
File Type: sp Get Plugin or Get Source (TerminateRound.sp - 19 views - 765 Bytes)
__________________
Taking paid private requests! Add me on steam/discord!
AlliedModders Releases | Github | Private Plugins | Steam | Discord

Last edited by Cruze; 12-04-2022 at 13:15. Reason: Some changes thanks to Bacardi
Cruze is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 12-04-2022 , 13:09   Re: Request: Plugin that terminates round (excluding bots)
Reply With Quote #4

This can include in OnPluginStart, not need find convar on every map start. Can be done once when plugin load.
PHP Code:
 g_hRestartDelay FindConVar("mp_round_restart_delay"); 
*edit
also, you could add check, is ConVar g_hRestartDelay Null when fail to find that specific convar name.
__________________
Do not Private Message @me

Last edited by Bacardi; 12-04-2022 at 13:11.
Bacardi is offline
Cruze
Veteran Member
Join Date: May 2017
Old 12-04-2022 , 13:14   Re: Request: Plugin that terminates round (excluding bots)
Reply With Quote #5

Quote:
Originally Posted by Bacardi View Post
This can include in OnPluginStart, not need find convar on every map start. Can be done once when plugin load.
PHP Code:
 g_hRestartDelay FindConVar("mp_round_restart_delay"); 
*edit
also, you could add check, is ConVar g_hRestartDelay Null when fail to find that specific convar name.
Thanks for the heads up man!
__________________
Taking paid private requests! Add me on steam/discord!
AlliedModders Releases | Github | Private Plugins | Steam | Discord
Cruze is offline
azalty
AlliedModders Donor
Join Date: Feb 2020
Location: France
Old 12-04-2022 , 17:53   Re: Request: Plugin that terminates round (excluding bots)
Reply With Quote #6

Quote:
Originally Posted by Bacardi View Post
also, you could add check, is ConVar g_hRestartDelay Null when fail to find that specific convar name.
Why would it fail though? It's a base game cvar.
__________________
azalty is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 12-05-2022 , 08:39   Re: Request: Plugin that terminates round (excluding bots)
Reply With Quote #7

For example someone create MOD out of blue so called:
Counter-Strike: Battlefield 2077

-Title look similiar like CS games
-Maybe game modes look similiar
-But if mod is using totally different cvar names than original cs games. This "mp_round_restart_delay" not exist in this mod.

SM devs make update so it support this mod.

Users find this post, take a plugin in use, get errors.
Rather they post in this same topic, they create new topic "help".
"Plugin not work"

After 5 posts, asking bunch of basic info, you know what mod and you find this topic through google search.

This, imaginary scenario, you could add check, does plugin work in that game.

Not everything is cs:go
__________________
Do not Private Message @me
Bacardi 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 03:03.


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