AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   [CS:GO] Bombsite limiter (https://forums.alliedmods.net/showthread.php?t=312190)

vERKE 11-20-2018 10:28

[CS:GO] Bombsite limiter
 
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!

eliteroyal 04-04-2019 12:38

Re: [CS:GO] Bombsite limiter
 
same here, cant find one, sad

Ilusion9 04-04-2019 14:23

Re: [CS:GO] Bombsite limiter
 
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.

B3none 04-08-2019 12:30

Re: [CS:GO] Bombsite limiter
 
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;



Schlesier 04-30-2019 16:18

Re: [CS:GO] Bombsite limiter
 
@b3none

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


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

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