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"
}