security system help plz

Have questions about CoD2 mapping that aren't covered in the tutorials section? Post here!

Moderator: Core Staff

Post Reply
Levcek
CJ Fan
CJ Fan
Posts: 129
Joined: March 7th, 2010, 11:37 am
Location: sLOVEnia, stajerska FTW

security system help plz

Post by Levcek » July 1st, 2010, 8:40 pm

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
__________________________________________________________

Image THE MAPPER
__________________________________________________________

Image

User avatar
Rezil
Core Staff
Core Staff
Posts: 2030
Joined: July 24th, 2006, 11:21 am
Location: Cramped in a small cubicle/making another jump map

Re: security system help plz

Post by Rezil » July 2nd, 2010, 7:59 am

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.
Drofder2004: Drofder's rules for reviewing a map
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.

Levcek
CJ Fan
CJ Fan
Posts: 129
Joined: March 7th, 2010, 11:37 am
Location: sLOVEnia, stajerska FTW

Re: security system help plz

Post by Levcek » July 2nd, 2010, 1:02 pm

ok ill try
__________________________________________________________

Image THE MAPPER
__________________________________________________________

Image

Levcek
CJ Fan
CJ Fan
Posts: 129
Joined: March 7th, 2010, 11:37 am
Location: sLOVEnia, stajerska FTW

Re: security system help plz

Post by Levcek » July 2nd, 2010, 3:28 pm

dont work >.< :x :x :x :x :x :x :x :x :x :x :x :cry: :cry:
__________________________________________________________

Image THE MAPPER
__________________________________________________________

Image

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests