Page 1 of 1

weapon swappage idea

Posted: Sat Mar 24, 2007 8:24 pm
by darksmaster923
okay, i got a scripted pickup and im trying to make it swap with weapons on the ground..... would this work:
i put if the player presses use key to swap his gun, theres other invisible guns inside the gun on the ground. when player swapps, he gets his gun and the gun he swapped invis gun becomes vis

Posted: Sun Mar 25, 2007 6:51 am
by darksmaster923
slash that idea.
okay, im doing drop weapon move a pickup next to player. it works, cept for the fact that if i drop it, pick it up and drop it i automatically pick it back up. heres my two scripts

Code: Select all

{
	Spawn[ ()
	{
		Console(true); //Turns on debug
		Gravity(false); //No grav
		SetNoCollision(); //No collision
		BoxHeight(75); //height of bounding box
		HideFromRadar(true); //uh... speaks for itself
		BoxWidth(75); //width of bounding box
		LowLevel("Setup");
	} ]

	Setup[ ()
	{
		PawnRender(false);
		self.think = "Wait";
	} ]

	Wait[ ()
	{
		self.ThinkTime = "0.1";
		if(IsKeyDown(30))
		{
			if(self.player_weapon = 10)
			{
				SetPosition("mg", self.player_X, self.player_Y, self.player_Y, true, true);	
			}
		}
	} ]
}

Code: Select all

{
	X	[0]
	Y	[0]
	Z	[0]

	Spawn[ ()
	{
		Console(true);
		BoxWidth(20);
		BoxHeight(20);
		SetCollision();
		AddCollisionOrder("Setup");
	} ]

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

	Idle[ ()
	{
		if(GetAttribute("galil","Player") < 1 and (GetAttribute("m16","Player") < 1))
		{
			if(GetAttribute("mp7","Player") < 1 and (GetAttribute("mac","Player") < 1))
			{
				if(GetAttribute("mg36","Player") < 1 and (GetAttribute("awp","Player") < 1))
				{
					if(GetAttribute("m3","Player") < 1)
					{
						ModifyAttribute("mg36", 1, "Player");
						ModifyAttribute("mg_shell", random(25,80), "Player");
						PlaySound("respawn.wav");
						TeleportEntity("mg" , "temp" );  
					}
				}
			}
		}
	} ]
}

Posted: Sat Mar 31, 2007 7:49 pm
by fps
i am not quite sure what this script exactly does.
could you elaborate on it a bit?
i would love to make picking up and droping weapons work but i am not sure how to properly define the pickups or how to bring them back.

thanks,
fps

Posted: Sat Mar 31, 2007 8:49 pm
by darksmaster923
err.. i fixed it. i just added a var to true when picked up