• 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/

Code [Help] Getting Pawn in Scoreboard

forrestmark9

Grizzled Veteran
Nov 29, 2011
1,110
42
I'm trying to setup a system that works with Marcos versus mod that basically does two things, Draws a zed icon next to the player based on how much a threat the zed is, and in the health section say ZED. My current problem is when getting the Pawn to check if they are a zed or not doesn't work, the icon will not draw but the health thing works but for only the owner and not anyone else.

This is the current code found within UpdateScoreboard

Code:
        //Show ZED possession
        if( Monster(Controller(PRI.Owner).Pawn)!=None )
        {
            ZEDIcon = GetZEDThreatTex(Controller(PRI.Owner));
            Canvas.SetPos(BoxXPos - PlayerBoxSizeY, (PlayerBoxSizeY + BoxSpaceY) * i + HeaderOffsetY + PlayerBoxSizeY*0.25);
            XL = PlayerBoxSizeY*0.5;
            Canvas.DrawTile(ZEDIcon, XL, XL, 0, 0, Texture(ZEDIcon).USize, Texture(ZEDIcon).VSize);
        }
 
        // draw healths
        if ( Monster(Controller(PRI.Owner).Pawn) != none )
        {
            Canvas.DrawColor = HUDClass.default.RedColor;
            S = "ZED";
        }
        else if ( PRI.bOutOfLives || KFPRI.PlayerHealth<=0 )
        {
            Canvas.DrawColor = HUDClass.default.RedColor;
            S = OutText;
        }
        else
        {
            if( KFPRI.PlayerHealth>=90 )
                Canvas.DrawColor = HUDClass.default.GreenColor;
            else if( KFPRI.PlayerHealth>=50 )
                Canvas.DrawColor = HUDClass.default.GoldColor;
            else Canvas.DrawColor = HUDClass.default.RedColor;
            S = KFPRI.PlayerHealth@HealthyString;
        }
        Canvas.TextSize(S, XL, YL);
        Canvas.SetPos(HealthXpos - 0.5 * XL, (PlayerBoxSizeY + BoxSpaceY) * i + BoxTextOffsetY);
        Canvas.DrawTextClipped(S);