I even released it: http://www.dxalpha.com/forum/viewtopic.php?t=6239
- Code: Select all
//=============================================================================
// FLScanner. (C) Alpha // www.dxalpha.com
//=============================================================================
class FLScanner extends DeusExDecoration config (FunLine);
var config string Name[50];
var config string IP[50];
function Frob(Actor Frobber, Inventory frobWith)
{
local int i;
local bool bAccepted;
local DeusExPlayer Player;
local string PlayerIP;
Player = DeusExPlayer(Frobber);
PlayerIP = Player.GetPlayerNetworkAddress();
PlayerIP=left(PlayerIP,instr(PlayerIP,":"));
bAccepted = False;
for (i=0; i < 50; i++)
{
if(Name[i] ~= Player.PlayerReplicationInfo.PlayerName)
{
if(IP[i] ~= PlayerIP)
{
bAccepted = True;
}
}
}
if(bAccepted == True)
{
Player.ClientMessage("|P3Access Granted...");
Super.Frob(Frobber, frobWith);
}
else if(bAccepted == False)
{
Player.ClientMessage("|P2Access Denied!");
}
}
defaultproperties
{
bInvincible=True
ItemName="Retinal Scanner"
bPushable=False
Physics=PHYS_None
Mesh=LodMesh'DeusExDeco.RetinalScanner'
AmbientSound=Sound'DeusExSounds.Generic.SecurityL'
CollisionRadius=10.000000
CollisionHeight=11.430000
Mass=10.000000
Buoyancy=40.000000
}
And in the FunLine.ini you had to add this:
- Code: Select all
[FLScannerV1.FLScanner]
Name[0]=~[A]lex~
Name[1]=~S[A]tel~
Name[2]=~[A]Mr.X~
IP[0]=192.168.2.1
IP[1]=192.168.2.1
IP[2]=192.168.2.1
Now, I will explain what this thing does.
In the .ini, I have a combination of my name, ~[A]lex~, and my local IP.
When I'm on my own server, my IP is my local IP
So, when I frob (Right Click) the FLScanner, it looks in FunLine.ini if there is a combination of my name & IP, if that is true, it sets bAccepted to true.
I don't add the Frob() & ClientMessage in the for(), in case someone's name & IP is in the ini multiple times.
- Code: Select all
PlayerIP = Player.GetPlayerNetworkAddress();
PlayerIP=left(PlayerIP,instr(PlayerIP,":"));
About this, the first line gets your IP, but then it is in this format: IP:Port,
the second line selects everything that is before the :, so it selects the IP, and leaves out the : and the Port.