Spectator Password

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

-=[mSn]=-Yawner

New Member
Apr 10, 2004
10
0
0
Hey guys i run a DM Sniper Server and i dont know much about mods but i wnated to make a mod that only allows clan members to acess the spectator slots... I have a password protect that allows for a couple of spots for members to get in without having to wait. So i thought that i could modify that in order to allow a password to kick in whenever sum1 tried to access the spectator slots.

heres the code...

class mSnSpecPassword expands Mutator config(mSnSpecPassword);

var bool bPassworded;
var config string mSnPassword;
var config string MessagePW;
var config string MessageUnPW;
var config int PlayerLimit;

event PreBeginPlay()
{
UnSetPW();
}

function ModifyPlayer(Pawn Other)
{
if (bPassworded == false)
{
if ( Level.Game.NumPlayers + 1 > PlayerLimit )
{
SetPW();
}
else if (GetPW() != "")
{
bPassworded = true;
}
}
else
{
if ( Level.Game.NumPlayers < PlayerLimit )
{
UnSetPW();
}
}

if ( NextMutator != None )
NextMutator.ModifyPlayer(Other);
}

function SetPW()
{
Level.ConsoleCommand("set engine.gameinfo GamePassword"@mSnPassword);
if (MessagePW != "")
{
Broadcastmessage(MessagePW);
}
bPassworded = true;
}

function UnsetPW()
{
Level.ConsoleCommand("set engine.gameinfo GamePassword");
if (MessageUnPW != "")
{
Broadcastmessage(MessageUnPW);
}
bPassworded = false;
}

function string GetPW()
{
return Level.ConsoleCommand("get engine.gameinfo GamePassword");
}

defaultproperties
{
mSnPassword="XXXXXXXXXXXX"
MessagePW="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
MessageUnPW="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
PlayerLimit=2
}


if u guys can change it to make it that the spectator slots are pass-worded if it is possible then the help would be appreiated.

Cheers -=[mSn]=-Yawner
 

Nemephosis

Earning my Infrequent Flier miles
Aug 10, 2000
7,711
3
38
just password the server, that should do the trick. If it doesn't, let me know and I'll move this to the appropriate forum.

edit: Also, knowing what UT game this is for would help me ;)
 

-=[mSn]=-Yawner

New Member
Apr 10, 2004
10
0
0
Nemephosis said:
just password the server, that should do the trick. If it doesn't, let me know and I'll move this to the appropriate forum.

edit: Also, knowing what UT game this is for would help me ;)

lol sorry.. i play UT: Game of the Year Ed.

And i wanna keep the server open to the public.. but i dont want them to be allowed into the spectator slots.. but i still wanna keep some open for my clan mates... so i thought that id use my existing password protector(it kicks in after 10 players to allow for 2 slots to -=[mSn]=- members.) Then i could modify it to just password the spectator slots...

lol sorry for the confusion, -=[mSn]=-Yawner
 

Nemephosis

Earning my Infrequent Flier miles
Aug 10, 2000
7,711
3
38
okay so it's off to the Coding forum. Hope you get some help there.