Raised This Month: $51 Target: $400
 12% 

[CSGO] Kill all CT bots when CT players died


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Sw33T3R
AlliedModders Donor
Join Date: Mar 2014
Old 06-26-2017 , 08:19   [CSGO] Kill all CT bots when CT players died
Reply With Quote #1

Hello ;)

I'd like 2 request a small plugin
Kill all CT bots when CT "human" players died
Anyone can help?

Last edited by Sw33T3R; 06-26-2017 at 08:23.
Sw33T3R is offline
CamerDisco
AlliedModders Donor
Join Date: Aug 2015
Location: Poland
Old 06-26-2017 , 12:29   Re: [CSGO] Kill all CT bots when CT players died
Reply With Quote #2

Try it:
PHP Code:
#pragma semicolon 1


#define PLUGIN_AUTHOR "CamerDisco"
#define PLUGIN_VERSION "1.00"

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

#pragma newdecls required

public Plugin myinfo 
{
    
name "Kill all CT bots when CT players died",
    
author PLUGIN_AUTHOR,
    
description "",
    
version PLUGIN_VERSION,
    
url "http://max-play.pl"
};

public 
void OnPluginStart()
{
    
HookEvent("player_death"DeathEvent);
}

public 
Action DeathEvent(Event event, const char[] namebool dontBroadcast)
{
    
int number CountCTAlive();
    if(
number 1)
        
KillCTBots();
}

public 
void KillCTBots()
{
    for (
int i 0<= MaxClientsi++)
        if(
IsValidClient(i) && IsFakeClient(i) && IsPlayerAlive(i) && GetClientTeam(i) == CS_TEAM_CT)
            
ForcePlayerSuicide(i);
}

stock int CountCTAlive()
{
    
int l 0;
    for (
int i 0<= MaxClientsi++)
        if(
IsValidClient(i) && !IsFakeClient(i) && GetClientTeam(i) == CS_TEAM_CT && IsPlayerAlive(i))
            
l++;
    return 
l;
}

stock bool IsValidClient(int client)
{
    if(
client >= && client <= MaxClients && IsClientInGame(client))
        return 
true;

    return 
false;

__________________


Max-Play.pl - the best polish servers
CamerDisco is offline
Sw33T3R
AlliedModders Donor
Join Date: Mar 2014
Old 06-27-2017 , 10:46   Re: [CSGO] Kill all CT bots when CT players died
Reply With Quote #3

Quote:
Originally Posted by CamerDisco View Post
Try it:
...
Thanks ;3
Sw33T3R 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 04:25.


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