[Help]Patriarch Mutator

  • Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

matttthias

FNG / Fresh Meat
Mar 5, 2010
174
10
0
Austria
www.team-gmk.com
i need some help with this. i wanted to create a mutator that shows everyone who killed the patriarch but the message that appears is " The Patriarch was killed by someone!". but instead of "someone" should be the name of the player who has killed the patriarch

Code:
class PatriarchKillRules extends GameRules;

function PostBeginPlay()
{
    NextGameRules = Level.Game.GameRulesModifiers;
    Level.Game.GameRulesModifiers = Self;
}

function ScoreKill(Controller Killer, Controller Killed)
{
    local Controller C;
    local Pawn Target;
    
    if( PlayerController(Killer)!=None && ZombieBoss(Killed.Pawn)!=None )
    {
    for (C = Level.ControllerList; C != None; C = C.NextController)
    {
        if( C.bIsPlayer && C.Pawn!=None && PlayerController(C)!=None )
        {
            PlayerController(C).ReceiveLocalizedMessage(Class'MessageKill',,Target.Controller.PlayerReplicationInfo);
        }
    }
    }
    Super.ScoreKill(Killer,Killed);
}

defaultproperties
{
}
Code:
class MessageKill extends LocalMessage;

static function string GetString(
    optional int Switch,
    optional PlayerReplicationInfo RelatedPRI_1,
    optional PlayerReplicationInfo RelatedPRI_2,
    optional Object OptionalObject )
{
    return Default.Message@Eval(RelatedPRI_1!=None,RelatedPRI_1.PlayerName,"someone")$"!";
}

defaultproperties
{
     LifeTime=6.000000
     Message="The Name of the Patriarch-Killer is"
     DrawColor=(B=0,G=255,R=0)
}
Code:
class MutPatriarchHealth extends Mutator;

function PreBeginPlay()
{
    Spawn(Class'PatriarchKillRules');
    AddToPackageMap();
}

defaultproperties
{
     bAddToServerPackages=True
     GroupName="KF-Pat"
     FriendlyName="Patriach-Killer"
     Description="You can see who has killed the patriarch"
}
 

Marco

Active member
May 23, 2009
645
232
43
Finland
Code:
function ScoreKill( Controller Killer, Controller Killed )
{
    if( Killed!=None && ZombieBoss(Killed.Pawn)!=None )
    {
        if( Killer!=None )
            BroadcastLocalizedMessage(Class'MessageKill',,Killer.PlayerReplicationInfo);
        else BroadcastLocalizedMessage(Class'MessageKill');
    }
    Super.ScoreKill(Killer,Killed);
}
Simple as ABC huh?
 
Last edited:

simpleA

FNG / Fresh Meat
Jan 3, 2012
11
0
0
RUSSIA
Great, thx. But when i play in solo mode, each monster kill - it says: The Patriarch was killed by someone!