Page 1 of 1

messed up pickup script

Posted: Mon Apr 09, 2007 5:34 am
by darksmaster923
ok, i have multiple pickup scripts for guns. but the pp19 script doesnt work. when i pick it up with no gun, i dont get the pp19.
if i pick up with a gun, i get the ammo.
SCRIPT

Code: Select all

{
	pickup		[false]

	Spawn[ ()
	{
		Console(false);
		BoxWidth(80);
		BoxHeight(50);
		SetCollision();
		AddCollisionOrder("Setup");
	} ]

	Setup[ ()
	{
		LowLevel("Idle");
	} ]

	Idle[ ()
	{
		if(GetAttribute("galil","Player") < 1 and (GetAttribute("m16","Player") < 1) and (GetAttribute("famas","Player") < 1) and (GetAttribute("ak47","Player") < 1))
		{
			if(GetAttribute("mp7","Player") < 1 and (GetAttribute("mac","Player") < 1) and GetAttribute("ump","Player") < 1 and (GetAttribute("pp19","Player") < 1))
			{
				if(GetAttribute("mg36","Player") < 1 and (GetAttribute("awp","Player") < 1))
				{
					if(GetAttribute("m3","Player") < 1)
					{
						if(pickup = false)
						{
							ModifyAttribute("pp19", 1, "Player");
							ModifyAttribute("smg_shell", random(25,80), "Player");
							PlaySound("respawn.wav");
							pickup = true;
							TeleportEntity("pp19" , "temp" );
							HighLevel("Wait");
						}
					}
					else
					{
						HighLevel("Spawn");
					}
				}
				else
				{
					HighLevel("Spawn");
				}
			}
			else
			{
				ModifyAttribute("smg_shell", random(55,120), "Player");
				PlaySound("respawn.wav");
				TeleportEntity("pp19" , "temp" );
			}
		}
		else
		{
			HighLevel("Spawn");
		}
	} ]

	Wait[ ()
	{
		Delay("", 1, "");
		pickup = false;
		NewOrder("Spawn");
	} ]
} 

Posted: Mon Apr 09, 2007 9:04 am
by Juutis
I'm not sure if this will fix anything, but I recommend adding a couple of brackets in the if-statements.
For example:

Code: Select all

if(GetAttribute("mg36","Player") < 1 and (GetAttribute("awp","Player") < 1))
should be

Code: Select all

if((GetAttribute("mg36","Player") < 1) and (GetAttribute("awp","Player") < 1))

Apart from that, I don't see anything wrong with your script. :?

Posted: Tue Apr 10, 2007 3:07 am
by darksmaster923
that doesnt do anything

Posted: Tue Apr 10, 2007 1:28 pm
by Jay
Try to set Console(true) instead of Console(false) and look what the console says...

Posted: Wed Apr 11, 2007 12:43 am
by darksmaster923
the consoles completely normal....