I wrote a mutator that checks the team of a player/bot and then changes there inventory items but there are some problems.
If I use TeamNum = GetTeamNum() to get the team index of a player. It works and compiles and the team number is correct ingame but for some reason it makes bots and players take no damage and makes bots randomly clip through walls.
How do I fix this? What is the proper way to check a team?
Here is my code:
If I use TeamNum = GetTeamNum() to get the team index of a player. It works and compiles and the team number is correct ingame but for some reason it makes bots and players take no damage and makes bots randomly clip through walls.
How do I fix this? What is the proper way to check a team?
Here is my code:
Code:
class UTMutator_Zombies extends UTMutator;
simulated function PostBeginPlay()
{
Super.PostBeginPlay();
WorldInfo.Game.DefaultPawnClass = class'ZombiesMutator.UTPawn_Zombies';
}
defaultproperties
{
}
Code:
class UTPawn_Zombies extends UTPawn;
var int BigFatZero;
var int TeamIndex;
simulated function PostBeginPlay()
{
Super.PostBeginPlay();
SetTimer(0.1,true);
}
function Timer()
{
Super.PostBeginPlay();
TeamIndex = GetTeamNum();
if(TeamIndex == 0)
{
loginternal("Red Team!");
}
if(TeamIndex == 1)
{
loginternal("Blue Team!");
}
}
defaultproperties
{
BigFatZero=0;
TeamIndex=0;
}
Last edited: