Author Topic: BootPC wand?  (Read 379 times)

Legacy_Knight_Shield

  • Hero Member
  • *****
  • Posts: 812
  • Karma: +0/-0
BootPC wand?
« on: September 13, 2010, 10:36:42 pm »


               I just want a wand for a DM so they can boot a player if necessary.I know this is a simple script but being cut n paste guy I cannot seem to get it right .<><>

               
            

Legacy_Knight_Shield

  • Hero Member
  • *****
  • Posts: 812
  • Karma: +0/-0
BootPC wand?
« Reply #1 on: September 13, 2010, 11:21:11 pm »


               Waht I tried and didnt work.



#include "x2_inc_switches"

void main()

{

int nEvent = GetUserDefinedItemEventNumber();

if(nEvent != X2_ITEM_EVENT_ACTIVATE) return;

object oUser = GetItemActivator();

if (!GetIsDM(oUser)) return;

object oPlayer = GetItemActivatedTarget();

if (!GetIsPC(oPlayer))

   

BootPC(oPlayer);

}



               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
BootPC wand?
« Reply #2 on: September 13, 2010, 11:32:41 pm »


               You are telling it to boot the PC if it is not a player.   

Try removing the ! form your last check.  

if (GetIsPC(oPlayer)) 
BootPC(oPlayer);


or if you leave the ! in the check add a return after the check.  

if (!GetIsPC(oPlayer))  return;
BootPC(oPlayer);
               
               

               
            

Legacy_Knight_Shield

  • Hero Member
  • *****
  • Posts: 812
  • Karma: +0/-0
BootPC wand?
« Reply #3 on: September 14, 2010, 09:47:50 am »


               Thanks Lightfoot8, it works great.