Name Searching Switch

The best and quickest support by a group of top-notch editing specialists, guaranteed!

Moderator: Forum Guards

Name Searching Switch

Postby Allan » Sun Mar 05, 06 7:11 pm

Ok, i've decided to move into the exiting world of stuff involving the PlayerReplicationInfo (For those who dont know, it controlles scoreboard, Name, ID number, anything to do with MP practically :) ), and i decided to make a switch only allowing those who have their name on the list to enter.

However, i have come across a problem. The code has a list of players in, but i can't get the code to check the list of players, so only the ones entered manually in the code can enter(Just me). I want it so the button reads the whole list of people, and if it finds the person who pushes it's name on the list, opens the door or whatever it's event is. But in the codes current state, it cannot accept the list where it needs to go, and i have no idea how to fix it. Any help here, Top Notch Editing Specialists?

(Oh, here's the code :P )
Code: Select all
//===================
// NameTestSwitch.
//===================
class NameTestSwitch expands Switch2;

Var(Names) String PlayerList[32];

function Frob(Actor Frobber, Inventory frobWith)
{
      local DeusExPlayer Player;
Player = DeusExPlayer(Frobber); 
If(Player.PlayerReplicationInfo.PlayerName=="Allan")
{
   Super.Frob(Frobber, frobWith);
}
}
User avatar
Allan
Alpha
 
Posts: 4545
Joined: Wed Dec 21, 05 1:41 pm
Location: Northamptonshire, England.

Re: Name Searching Switch

Postby MainMan » Sun Mar 05, 06 7:53 pm

Code: Select all
//===================
// NameTestSwitch.
//===================
class NameTestSwitch expands Switch2;

Var(Names) String PL[32];

function Frob(Actor Frobber, Inventory frobWith)
{
      local DeusExPlayer Player;
      local int i;

      Player = DeusExPlayer(Frobber);

      for (i=0; i<32; i++)
      {
           If(Player.PlayerReplicationInfo.PlayerName==PL[i])
           {
                Super.Frob(Frobber, frobWith);
           }
      }
}

defaultproperties
{
     PL(0)="MainMan"
     PL(1)="Allan"
     PL(2)=
     PL(3)=
     PL(4)=
     PL(5)=
}


I don't know if this will work, I just thought it off the top of my head.
<center>ty m7
</center>
User avatar
MainMan
<i>Tru' Playa' Fer Defs</i>
 
Posts: 4655
Joined: Sun Jun 05, 05 7:38 am
Location: London, UK

Postby Allan » Sun Mar 05, 06 9:06 pm

Well, thank the top of your head, it works like a charm :)
User avatar
Allan
Alpha
 
Posts: 4545
Joined: Wed Dec 21, 05 1:41 pm
Location: Northamptonshire, England.

Postby MainMan » Sun Mar 05, 06 9:50 pm

Lol no problem Allan, happy to help 8)
<center>ty m7
</center>
User avatar
MainMan
<i>Tru' Playa' Fer Defs</i>
 
Posts: 4655
Joined: Sun Jun 05, 05 7:38 am
Location: London, UK

Postby ~ô¿ô~Nobody~ » Mon Mar 06, 06 6:30 pm

the code itself will work but it would screw up in the case that the name is in the list 2 times
so i'd suggest a action-after-check

Code: Select all
//===================
// NameTestSwitch.
//===================
class NameTestSwitch expands Switch2;

Var(Names) String PL[32];

function Frob(Actor Frobber, Inventory frobWith)
{
      local DeusExPlayer Player;
      local int i;
      local bool bFound;

      Player = DeusExPlayer(Frobber);

      for (i=0; i<32; i++)
      {
           If(Player.PlayerReplicationInfo.PlayerName==PL[i])
           {
                bFound=true;
           }
      }
      if(bFound)
        Super.Frob(Frobber, frobWith);
}

defaultproperties
{
     PL(1)="Nobody"
     PL(1)="MainMan"
     PL(2)="Allan"
     PL(3)=
     PL(4)=
     PL(5)=
}
Nobody is perfect...
------------------------------
Longc[A]t wrote:I still think Dae is a russian spambot.

~[A]Daedalus~ wrote:There will be a day when my patience goes away and you, along with all who rant with you, will get banned.

ô¿ô¥[GODZ]¥NOCHANC wrote:I can ban any one I want ANY time I want. You have no rights here.
User avatar
~ô¿ô~Nobody~
Alpha
 
Posts: 2520
Joined: Fri Dec 31, 04 3:20 pm
Location: Proclarush Taonas

Postby MainMan » Mon Mar 06, 06 6:32 pm

Always the perfectionist :P
<center>ty m7
</center>
User avatar
MainMan
<i>Tru' Playa' Fer Defs</i>
 
Posts: 4655
Joined: Sun Jun 05, 05 7:38 am
Location: London, UK

Postby Allan » Mon Mar 06, 06 8:11 pm

Better a perfectionist than an idiot (Not that i'm calling anyone an idiot).

TY Main & Nobody :P (I see you keep adding your names to the Default properties list, i suppose you want the access from it, as you made it :P, PM me your main used names in game, and i'll add you to the list :) )
User avatar
Allan
Alpha
 
Posts: 4545
Joined: Wed Dec 21, 05 1:41 pm
Location: Northamptonshire, England.

Postby Spiderbot01 » Mon Mar 06, 06 8:38 pm

Spiderbot01... :P (Well I did make a map for his mods to be hostified soon) (And hes a buddy of mine) (And hes cool) (And he made the all time most splendiforous map ever) (I am reffering to, of course, evillab).
<center>------</center><center>
Image</center>
<center>Image</center><
User avatar
Spiderbot01
Alpha
 
Posts: 5363
Joined: Wed Nov 30, 05 8:24 pm
Location: LONDON!!!!

Postby Wasted » Mon Mar 06, 06 8:43 pm

Sheesh, Ill pm u mine l8er dont worry.. :)

P.S. WHat is some aliases :s
FFS
User avatar
Wasted
Forum Hero
 
Posts: 2861
Joined: Sun Oct 30, 05 6:29 pm
Location: 1337 14ND


Return to Editing issues

Who is online

Users browsing this forum: No registered users and 2 guests