i'm trying to alter the scoreboard to something like this
but i can't seems to make to headshot count since i am really a noob coder
any suggestion on how to ? i intend to make it as a separate mutator ..
by the way this headshot count is suppose to be for all guns, but i would like to know how to for the sharpy only too...
currently i have these following:
ScoreBoard.uc
ScoreBoardMut.uc
SRPlayerReplicationInfo.uc
SRGameType.uc
these are the stat i alter and will be put on the board later but for now i would like the headshot count ...
but i can't seems to make to headshot count since i am really a noob coder
any suggestion on how to ? i intend to make it as a separate mutator ..
by the way this headshot count is suppose to be for all guns, but i would like to know how to for the sharpy only too...
currently i have these following:
ScoreBoard.uc
Code:
...
// draw kills
if( bDisplayWithKills )
{
Canvas.StrLen(KFPlayerReplicationInfo(GRI.PRIArray[i]).Kills, KillWidthX, YL);
Canvas.SetPos(KillsXPos - 0.5 * KillWidthX, (PlayerBoxSizeY + BoxSpaceY) * i + BoxTextOffsetY);
Canvas.DrawText(KFPlayerReplicationInfo(GRI.PRIArray[i]).Kills, true);
}
// draw headshot kills
Canvas.StrLen(SRPlayerReplicationInfo(GRI.PRIArray[i]).KilledHeadshot, KillWidthX, YL);
Canvas.SetPos(KilledHeadshotXPos - 0.5 * KillWidthX, (PlayerBoxSizeY + BoxSpaceY) * i + BoxTextOffsetY);
Canvas.DrawText(SRPlayerReplicationInfo(GRI.PRIArray[i]).KilledHeadshot, true);
...
Code:
class ScoreboardMut extends Mutator;
function PostBeginPlay()
{
if(SRGameType(level.game)==none)
{
//currentmap=GetURLMap(false);
level.servertravel("?game=ACNXSCORE.SRGameType",true);
}
}
function bool CheckReplacement(Actor Other, out byte bSuperRelevant)
{
if( Controller(Other) !=None )
Controller(Other).PlayerReplicationInfoClass = Class'SRPlayerReplicationInfo';
return true;
}
...
Code:
class SRPlayerReplicationInfo extends KFPlayerReplicationInfo;
var int KilledSirens;
var int KilledScrakes;
var int KilledFPs;
var int KilledPats;
var int KilledHusks;
var byte MaxPlayers;
var int KilledHeadshot;
replication
{
// Things the server should send to the client.
reliable if ( bNetDirty && (Role == Role_Authority) )
KilledSirens,
KilledScrakes,
KilledFPs,
KilledPats,
KilledHusks,
MaxPlayers;
KilledHeadshot,
}
...
Code:
...
function ScoreKill(Controller Killer, Controller Other)
{
super.ScoreKill(Killer, Other);
}
simulated function Killed(Controller Killer, Controller Killed, Pawn KilledPawn, class<DamageType> damageType)
{
local SRPlayerReplicationInfo KFPRI;
Super.Killed(Killer,Killed,KilledPawn,DamageType);
if((Killer != None) && Killer.bIsPlayer)
{
KFPRI = SRPlayerReplicationInfo(KFPlayerController(Killer).PlayerReplicationInfo);
if(KilledPawn.IsA('ZombieSiren'))
KFPRI.KilledSirens++;
else if(KilledPawn.IsA('ZombieScrake'))
KFPRI.KilledScrakes++;
else if(KilledPawn.IsA('ZombieFleshpound'))
KFPRI.KilledFPs++;
else if(KilledPawn.IsA('ZombieHusk'))
KFPRI.KilledHusks++;
else if(KilledPawn.IsA('ZombieBoss'))
KFPRI.KilledPats++;
else
log(KilledPawn.Class);
}
}
defaultproperties
{
ScoreBoardType="ACNXSCORE.ScoreBoard"
}
Last edited: