AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Extensions (https://forums.alliedmods.net/forumdisplay.php?f=134)
-   -   [CS:S/CS:GO] Bot Attack Control (https://forums.alliedmods.net/showthread.php?t=220118)

GoD-Tony 09-04-2013 11:18

Re: [CS:S/CS:GO] Bot Attack Control
 
Quote:

Originally Posted by senecas (Post 2027483)
CS:GO Server Crash with this ext.

Today's Update + metamod 1.10 + sm 1.5 or 1.6 => crash

Still working for me on Windows. At which point does it crash your server? Windows/Linux?

senecas 09-04-2013 20:55

Re: [CS:S/CS:GO] Bot Attack Control
 
linux
crash after csgo latest update. only changing is csgo update.
Crash with this ext, If I remove it, it's Ok.

Can you check on linux server ?

something's wrong with this csgo update 1.30.2.1.
In my minigame server, atfer update,
mg_multigames_devine_or_guess map crash with ED_Alloc: no free edicts atfer bot or player joining.

senecas 09-10-2013 23:57

Re: [CS:S/CS:GO] Bot Attack Control
 
I Fixed it out...:)

cssdm_ffa_enabled 1 -> 0

That cvar make server-crashing when bot is damaged by teammate.

SM9 09-15-2013 17:57

Re: [CS:S/CS:GO] Bot Attack Control
 
Hello, I can't seem to get this working correctly.. I think I done it wrong :(

PHP Code:

public Action:OnShouldBotAttackPlayer(botplayer, &bool:result)
{
    
    for(new 
1<= MaxClientsi++)
    {
        if(
Client_IsValid(i))
        {
            if(
IsFakeClient(i))
            {
                
bot i;
            }
            else
            {
                
player i;
                
                if(
isSpawnKillProtected[player] == true){
                    
result false;
                }
                else
                {
                    
result true;
                }
            }
        }
    }


I'm trying to make all bots not attack players with the bool isSpawnKillProtected true. And when it goes false then attack again.

PHP Code:

EnableKillProtection(client
{
    if(
Client_IsValid(client))
    {
        if( !
IsFakeClientclient) )
        {
            
isKillProtected[client] =  true;
            
lastPlayerHealth[client] = Entity_GetHealth(client);
            
Entity_SetHealth(clientPROTECTED_HEALTHtrue);
            
            
CreateTimer(GetConVarFloat(zr_protect_time), Timer_DisableSpawnProtectionclientTIMER_FLAG_NO_MAPCHANGE);
        }
    }
}

DisableKillProtection(client)
{    
    
isKillProtected[client] =  false;
    
isSpawnKillProtected[client] = false;
    
Entity_SetHealth(clientlastPlayerHealth[client], true);
    
    
PrintHintText(client"[WARNING] Spawn Protection is now OFF!");



GoD-Tony 09-16-2013 01:10

Re: [CS:S/CS:GO] Bot Attack Control
 
Quote:

Originally Posted by xCoderx (Post 2035409)
Hello, I can't seem to get this working correctly.. I think I done it wrong :(

I'm trying to make all bots not attack players with the bool isSpawnKillProtected true. And when it goes false then attack again.

You shouldn't need a loop there. The forward will be called for all bots checking against all players. Also, don't forget to return Plugin_Changed if you're changing the result param:
PHP Code:

public Action:OnShouldBotAttackPlayer(botplayer, &bool:result)
{
    if (
isSpawnKillProtected[player] == true) {
        
result false;
    } else {
        
result true;
    }
    
    return 
Plugin_Changed;


In your EnableKillProtection function, are you forgetting to set isSpawnKillProtected to true?

SM9 09-16-2013 03:13

Re: [CS:S/CS:GO] Bot Attack Control
 
Quote:

Originally Posted by GoD-Tony (Post 2035499)
In your EnableKillProtection function, are you forgetting to set isSpawnKillProtected to true?

Woops, Good spot!

And it works perfectly now, thanks :)

Edit: Does this mean I can use "Bot" as a default index for any bots instead of running a loop in my functions or using "IsFakeClient" to determine bots from normal players?

alencore 11-15-2013 07:24

Re: [CS:S/CS:GO] Bot Attack Control
 
Wow finally css bots finally can do real FFA game play...thank you very much!

weeb1e 04-18-2014 20:21

Re: [CS:S/CS:GO] Bot Attack Control
 
There seems to be some kind of flaw with these hooks when used to limit a bot to a single target on CS:GO, the bot will fire at other players randomly even though the forward says it shouldn't.

I'm not sure if this has always been the case with CS:GO, or if valve changed something, such as adding another condition somewhere, after this was implemented.

El Diablo War3Evo 05-12-2014 15:32

Re: [CS:S/CS:GO] Bot Attack Control
 
Any way to port this to TF2?

Mitchell 05-13-2014 16:21

Re: [CS:S/CS:GO] Bot Attack Control
 
Quote:

Originally Posted by El Diablo War3Evo (Post 2136879)
Any way to port this to TF2?

I'm sure it would be technically possible, but tf2 bots do act differently, in fact their are two different types of bots, and the ones that actually move are considered tfbots
maybe look into the "bot_controller"
just catch it on EntityCreated
each bot should have one ( assumption )


All times are GMT -4. The time now is 14:21.

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