AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   [CSGO] Plugin edit (https://forums.alliedmods.net/showthread.php?t=322911)

Sajmooooon 04-07-2020 10:32

[CSGO] Plugin edit
 
Can someone edit this plugin that will works only if CT<T and it will block B site ? Thanks.
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[] name, bool 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; i <= MaxClients; i++)
    {
        if (IsClientInGame(i))
        {
            if (GetClientTeam(i) != CS_TEAM_CT) continue;
            if (IsPlayerAlive(i)) num++;
        }
    }
   
    return num;
}


zipcore 04-07-2020 12:12

Re: [CSGO] Plugin edit
 
You have to get the 2nd func_bomb_target entity on your map since it's depending on which one was created first in hammer editor.


All times are GMT -4. The time now is 12:40.

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