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;
}