Download

Problem with AllControler KFPlayerController


class ULocalMessage extends KFLocalMessage
	abstract;



static function string GetString(optional int Switch,
	optional bool bPRI1HUD,
	optional PlayerReplicationInfo RelatedPRI_1,
	optional PlayerReplicationInfo RelatedPRI_2,
	optional Object OptionalObject){
	local int MsgType;
	
    local KFPlayerController KFPC;
   
	MsgType = Switch;
	
		if(MsgType==1)
			return DisplayPlayerInfo();
	
}

static function string DisplayPlayerInfo()
{
    local string Result;
    local KFPlayerController KFPC;
    local int I;
    local bool bHide;
    local Inventory Inv;
    local WorldInfo WI;
    WI = class'WorldInfo'.static.GetWorldInfo();
    Result = "\n---------------------------------------\n";
    
    foreach WI.AllControllers(class'KFPlayerController', KFPC)
    {
        
        if(KFPC.PlayerReplicationInfo.bOnlySpectator)
        {
            continue;            
        }
        Result $= "\n";
        Result $= (KFPC.PlayerReplicationInfo.PlayerName $ " | ");
        Result $= (Mid(string(KFPC.GetPerk().GetPerkClass()), 7) $ " | ");
        I = 0;
        J0x16A:
      
        if(I < 10)
        {
            Result $= ((KFPC.GetPerk().PerkSkills[I].bActive) ? "L" : "R");
            I += 2;
            
            goto J0x16A;
        }
        Result $= "\n";
        Inv = KFPC.Pawn.InvManager.InventoryChain;
        J0x266:
       
        if(Inv != none)
        {
            switch(Inv.ItemName)
            {
                
                case class'KFWeap_Healer_Syringe'.default.ItemName:
              
                case class'KFWeap_Knife_Berserker'.default.ItemName:
               
                case class'KFWeap_Knife_Commando'.default.ItemName:
              
                case class'KFWeap_Knife_Demolitionist'.default.ItemName:
              
                case class'KFWeap_Knife_FieldMedic'.default.ItemName:
              
                case class'KFWeap_Knife_Firebug'.default.ItemName:
              
                case class'KFWeap_Knife_Gunslinger'.default.ItemName:
               
                case class'KFWeap_Knife_Sharpshooter'.default.ItemName:
               
                case class'KFWeap_Knife_Support'.default.ItemName:
               
                case class'KFWeap_Knife_Survivalist'.default.ItemName:
               
                case class'KFWeap_Knife_SWAT'.default.ItemName:
                
                case class'KFWeap_Pistol_9mm'.default.ItemName:
               
                case class'KFWeap_Welder'.default.ItemName:
                    bHide = true;
              
                default:
                   
                    if(!bHide)
                    {
                        Result $= (Inv.ItemName $ " | ");
                    }
                    // End:0x4B1
                    else
                    {
                        bHide = false;
                    }
                    Inv = Inv.Inventory;
                   
                    goto J0x266;
                    
            }
                              
        }
         		Result $= "\n";
    }     
            return Result;
            //return ReturnValue;            
}

I tried to show Players’ Info in chat but it turned out that it didnt show for all players, it showed the info for each player, like when i executed a command i saw mine and my friend saw his. what’s happening here .