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

[CSS] Autoslay BOT


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
bluefatcat1993
New Member
Join Date: Nov 2021
Old 09-26-2022 , 14:15   [CSS] Autoslay BOT
Reply With Quote #1

All player dead: Slay All BOT
C4 has been installed: Do not slay BOT

I have searched for similar plugins:
https://forums.alliedmods.net/showthread.php?t=91700

but this plugin only on...
Player (Terrorist) C4 has been installed and dead, no slay BOT...

---
I'm not very good at English, I translated it with Google...

Last edited by bluefatcat1993; 09-26-2022 at 14:18.
bluefatcat1993 is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 09-26-2022 , 17:52   Re: [CSS] Autoslay BOT
Reply With Quote #2

here something
PHP Code:





public void OnPluginStart()
{
    
HookEvent("round_start"events);
    
HookEvent("round_end"events);

    
HookEvent("bomb_planted"events);
    
HookEvent("player_death"events);
}

public 
void events(Event event, const char[] namebool dontBroadcast)
{
    static 
bool KillBotsAllow false;



    if(
StrEqual(name"player_death"false))
    {
        
bool humans false;
        
bool humansalive false;

        for(
int i 1<= MaxClientsi++)
        {
            if(!
IsClientInGame(i) || IsFakeClient(i) || GetClientTeam(i) < 2)
                continue;
            
            
humans true;

            if(
IsPlayerAlive(i))
                
humansalive true;
        }

        if(
KillBotsAllow &&
            
humans &&
            !
humansalive)
        {
            
PrintToChatAll("[SM] All humans dead, kill bots");
            
CreateTimer(2.0delay, .flags=TIMER_FLAG_NO_MAPCHANGE);
        }

        return;
    }

    if(
StrEqual(name"round_start"false))
    {
        
KillBotsAllow true;
        return;
    }


    
KillBotsAllow false;
}

public 
Action delay(Handle timer)
{
    
ServerCommand("bot_kill all");
    return 
Plugin_Continue;

__________________
Do not Private Message @me

Last edited by Bacardi; 09-26-2022 at 17:57. Reason: *team check
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 21:46.


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