View Single Post
GoD-Tony
Veteran Member
Join Date: Jul 2005
Old 09-16-2013 , 01:10   Re: [CS:S/CS:GO] Bot Attack Control
Reply With Quote #25

Quote:
Originally Posted by xCoderx View Post
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?
__________________

Last edited by GoD-Tony; 09-16-2013 at 01:36.
GoD-Tony is offline