Page 1 of 1

security system help plz

Posted: July 1st, 2010, 8:40 pm
by Levcek
am im making securty system door and my friend has idea that i could make security system but i need help now...

when i go to the trigger it dosent take my weapons and give me it

heres the script

Code: Select all

main()
{
thread door2_rotate();
}
door2_rotate()
{
door2 = getent("door, "targetname");
trig = getent("trig_door", "targetname");
while (1)
{
trig waittill("trigger",player);
player iprintlnbold ("^1Weapons ^2Taken!");
door2 playsound("dooropen");
door2 rotateyaw(90, 1.5, 0.7, 0.7);
door2 waittill("rotatedone");
level.player TakeAllWeapons ();
wait (3);
player iprintlnbold ("^1Weapons ^2Returned!");
door2 playsound("doorclose");
door2 rotateyaw(-90, 1.5, 0.7, 0.7);
door2 waittill("rotatedone");
player setWeaponSlotWeapon("primary","mp_m1garand");
}
}
and i replace

Code: Select all

setWeaponSlotWeapon("primary","mp_m1garand");
to

Code: Select all

level.player giveWeapon("m1garand");
and still dont work :S do any1 knoww plzz

Re: security system help plz

Posted: July 2nd, 2010, 7:59 am
by Rezil
If it's for multiplayer level.player won't work. You have to assign a name to the person who went through the door(i.e. triggered).

Code: Select all

main()
{
   thread door2_rotate();
}
door2_rotate()
{
   door2 = getent("door","targetname"); //This was wrong, surprised it didn't give an error
   trig = getent("trig_door", "targetname");
   while (1)
   {
      trig waittill("trigger",player); //Here you give the user who triggered a name with which you identify that user
      player iprintlnbold ("^1Weapons ^2Taken!");
      door2 playsound("dooropen");
      door2 rotateyaw(90, 1.5, 0.7, 0.7);
      door2 waittill("rotatedone");
      player TakeAllWeapons();
      wait (3);
      player iprintlnbold ("^1Weapons ^2Returned!");
      door2 playsound("doorclose");
      door2 rotateyaw(-90, 1.5, 0.7, 0.7);
      door2 waittill("rotatedone");
      player giveweapon("mp_m1garand");
	  player giveweapon("luger_mp");
      player switchtoweapon("mp_m1garand");
      wait 0.1;
   }
}
Try this.

Re: security system help plz

Posted: July 2nd, 2010, 1:02 pm
by Levcek
ok ill try

Re: security system help plz

Posted: July 2nd, 2010, 3:28 pm
by Levcek
dont work >.< :x :x :x :x :x :x :x :x :x :x :x :cry: :cry: