Tripwire Interactive Forums

Go Back   Tripwire Interactive Forums > Killing Floor Forums > Killing Floor Modifications > Coding

Reply
 
Thread Tools Display Modes
  #1  
Old 06-20-2012, 09:53 PM
forrestmark9's Avatar
forrestmark9 forrestmark9 is offline
Senior Member
 
Join Date: Nov 2011
Posts: 513
Default Admin Post message help

I need help with getting a custom admin post message, what I'm trying to achieve is to make it where it shows that they logged in as a donor or moderator instead of administrator but sadly I'm having a problem I got most of it working but I keep getting this error when I try to log in

Code:
Warning: UltraAdmin  KF-EvilSantasLair.KFPlayerController.UltraAdmin0 (Function  AdminPlus_v3.UltraAdmin.findMut:000A) Accessed None 'M'
Warning: UltraAdmin  KF-EvilSantasLair.KFPlayerController.UltraAdmin0 (Function  AdminPlus_v3.UltraAdmin.DoLogin:004B) Accessed None 'MyMut'
Here is the code

Code:
function AdminEnter( PlayerController P, string Post)
{
        Log( P.PlayerReplicationInfo.PlayerName@"logged in as"@Post@"." );
        Level.Game.Broadcast( P, P.PlayerReplicationInfo.PlayerName@LoggedInText@Post@"." );
}
 
function AdminExit( PlayerController P )
{
        Log(P.PlayerReplicationInfo.PlayerName@"logged out.");
        Level.Game.Broadcast( P, P.PlayerReplicationInfo.PlayerName@LoggedOutText@".");
}
 
function DoLoginSilent( string Username, string Password)
{
        local Mutator MyMut;
 
        Admin_Login = Username;
        MyMut = FindMut(Level.Game.BaseMutator, class'MutAdminPlus');
 
        if ( !MutAdminPlus(MyMut).AllowLogin(Self) )
                return;
                
        if ( !MutAdminPlus(MyMut).SilentLoginEnabled(Self) )
                return;
 
        Super.DoLoginSilent(Username,Password);
}
 
function string ConvertIDToName(string ID)
{
        local Controller C;
        if ( Len(ID) == 1 || Len(ID) == 2 )
        {
                for( C = Level.ControllerList; C != None; C = C.nextController )
                { 
                        if( C.IsA('PlayerController') || C.IsA('xBot')) 
                        {
                                DebugMessage("PlayerID = "$string(PlayerController(C).PlayerReplicationInfo.PlayerID));
                                if (ID == string(PlayerController(C).PlayerReplicationInfo.PlayerID))
                                        return PlayerController(C).PlayerReplicationInfo.PlayerName;
                        }
                }
        }
        return ID;
}
 
function DebugMessage(string Mes)
{
        local Mutator MyMut;
        
        MyMut = FindMut(Level.Game.BaseMutator, class'MutAdminPlus');
        
        if ( !MutAdminPlus(MyMut).bDebug )
                return;
 
        AllMessage(mes);
}
 
function AllMessage(string Mes)
{
        local Controller C;
 
        for( C = Level.ControllerList; C != None; C = C.nextController )
        {
        if( C.IsA('PlayerController') || C.IsA('xBot'))
                {
                        C.Pawn.ClientMessage(Mes);
        }
    }
}
 
function DoLogin( string Username, string Password )
{
        local Mutator MyMut;
 
        Admin_Login = Username;
        MyMut = FindMut(Level.Game.BaseMutator, class'MutAdminPlus');
 
        if ( !MutAdminPlus(MyMut).AllowLogin(Self) )
                return;
 
        if (Level.Game.AccessControl.AdminLogin(Outer, Username, Password))
        {
                bAdmin = true;
            AdminEnter(Outer, MutAdminPlus(MyMut).GetAdminPost(self));
        }
}
 
function DoLogout()
{
        if (Level.Game.AccessControl.AdminLogout(Outer))
        {
                bAdmin = false;
                AdminExit(Outer);
        }
}
Here is the specific part pf the code in MutAdminPlus

Code:
function bool AllowLogin(UltraAdmin AC)
{
        local int i;
        for (i=0; i<Admin_ID.Length; i++)
                if (  AC.GetPlayerIDHash() == Admin_ID[i] && (  AC.PlayerReplicationInfo.PlayerName == Admin_NickName[i] ||  bAllowUseOtherNames[i] )
                        && AC.Admin_Login == Admin_Username[i] )
                break;
        if ( i >= Admin_ID.Length )
                return false;
        return true;
}
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:14 PM.


Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright ©2005 - 2013, Tripwire Interactive, LLC