1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Hey Guest, is it this your first time on the forums?

    Visit the Beginner's Box

    Introduce yourself, read some of the ins and outs of the community, access to useful links and information.

    Dismiss Notice

Team Detection: What is wrong with this code?

Discussion in 'Modding Help' started by Jackard, Jun 5, 2013.

  1. Jackard

    Jackard Base Burner

    Messages:
    852
    Code:
        CBlob@ blob = this.getBlob();
        CPlayer@ player = blob.getPlayer();
        if (player.getTeamNum() == 0)
        {
            string heartFile = "GUI/jHUDhp.png";
        }
        else if (player.getTeamNum() == 1)
        {
            string heartFile = "GUI/zhp.png";
        }
    line 31 of KAB\Base\Entities\Common\GUI\DefaultActorHUD.as
    </br>--- merged: Jun 5, 2013 12:08 AM ---</br>
    resolved; it was trying to declare the same variable twice. here is working:

    Code:
        CPlayer@ player = blob.getPlayer();
        string heartFile = "GUI/jHUDhp.png";
        if (player.getTeamNum() == 1) { heartFile = "GUI/zhp.png"; }
     
    Apronymous and jerloch like this.