Quote:
Originally Posted by xCoderx
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(bot, player, &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?
__________________