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

[CS:GO] Bombsite limiter


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
vERKE
Junior Member
Join Date: Sep 2018
Location: Hungary
Old 11-20-2018 , 10:28   [CS:GO] Bombsite limiter
Reply With Quote #1

Hey!

I am looking for a plugin, that would limit the bombsite if there are less then 4 players in CT. I would like a config file too, where I can define which bombsite would be usable for every map.

Thanks in advance!
__________________
vERKE is offline
eliteroyal
AlliedModders Donor
Join Date: Dec 2016
Location: Moldova
Old 04-04-2019 , 12:38   Re: [CS:GO] Bombsite limiter
Reply With Quote #2

same here, cant find one, sad
__________________
PEACE FROM MOLDOVA
eliteroyal is offline
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 04-04-2019 , 14:23   Re: [CS:GO] Bombsite limiter
Reply With Quote #3

PHP Code:

#pragma semicolon 1
#pragma newdecls required

#include <sourcemod>
#include <sdktools>
#include <cstrike>

int g_Site;

public 
void OnPluginStart()
{        
    
HookEvent("round_freeze_end"Event_RoundFreezeEnd); 
}

public 
void OnMapStart()
{
    
g_Site FindEntityByClassname(-1"func_bomb_target"); // Find site A
}

public 
void OnConfigsExecuted()
{
    
ConVar cvar FindConVar("mp_join_grace_time");
    
    if (
cvar)
    {
        
cvar.IntValue 0;
    }
}

public 
void Event_RoundFreezeEnd(Event event, const char[] namebool dontBroadcast)
{
    
int num GetAliveCT(), ent g_Site;
    
    if (
num)
    {
        if (
num 5)
        {        
            while ((
ent FindEntityByClassname(ent"func_bomb_target")) != -1)
            {
                
AcceptEntityInput(ent"Disable");
            }
            
            return;
        }
    }
    
    while ((
ent FindEntityByClassname(ent"func_bomb_target")) != -1
    {
        
AcceptEntityInput(ent"Enable");
    }
}

int GetAliveCT()
{
    
int num;
    
    for (
int i 1<= MaxClientsi++)
    {
        if (
IsClientInGame(i))
        {
            if (
GetClientTeam(i) != CS_TEAM_CT) continue;
            if (
IsPlayerAlive(i)) num++;
        }
    }
    
    return 
num;

Untested.
__________________
Ilusion9 is offline
B3none
AlliedModders Donor
Join Date: Oct 2016
Location: United Kingdom
Old 04-08-2019 , 12:30   Re: [CS:GO] Bombsite limiter
Reply With Quote #4

Refactored Ilusion9's code, again... untested.

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

public Plugin myinfo =
{
    
name "Bombsite Limiter",
    
author "B3none, Ilusion9",
    
description "",
    
version "1.0.0",
    
url "https://github.com/b3none"
}

int g_Bombsite;

public 
void OnPluginStart()
{
    
HookEvent("round_freeze_end"Event_RoundFreezeEnd);
}

public 
void OnMapStart()
{
    
g_Bombsite FindEntityByClassname(-1"func_bomb_target"); // Find site A
}

public 
void OnConfigsExecuted()
{
    
ConVar cvar FindConVar("mp_join_grace_time");
    
    if (
cvar)
    {
        
cvar.IntValue 0;
    }
}

public 
void Event_RoundFreezeEnd(Event event, const char[] namebool dontBroadcast)
{
    
int iAliveCTs GetAlivePlayers(CS_TEAM_CT);
    
int iEnt g_Bombsite;
    
    while ((
iEnt FindEntityByClassname(iEnt"func_bomb_target")) != -1)
    {
        
AcceptEntityInput(iEnt, (iAliveCTs && iAliveCTs 5) ? "Disable":"Enable");
    }
}

int GetAlivePlayers(int team)
{
    
int iAlivePlayers = -1;
    
    for (
int i 1<= MaxClientsi++)
    {
        if (
IsClientInGame(i) && GetClientTeam(i) == team && IsPlayerAlive(i))
        {
            
iAlivePlayers++;
        }
    }
    
    return 
iAlivePlayers;

__________________

Last edited by B3none; 04-08-2019 at 14:26.
B3none is offline
Schlesier
Junior Member
Join Date: Oct 2011
Old 04-30-2019 , 16:18   Re: [CS:GO] Bombsite limiter
Reply With Quote #5

@b3none

Don't work :-(
I play 1 vs BOT and i can plant the Bomb A and/or B...

Last edited by Schlesier; 07-10-2019 at 08:01.
Schlesier is offline
Reply



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 09:01.


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