Weapon Spawn - Code bug?

Posts 1–6 of 6 · Page 1 of 1
Weapon Spawn - Code bug?
Why I can only spawn one weapon? My other weapons [see Code], are not there.




Code:
SpawnWeapons(WFunc,Weapon,WeaponName,Location,TakeOnce,angle,gun)
{
	self endon("disconnect");
	gun delete();
	weapon_model=getWeaponModel(Weapon);
	if(weapon_model=="")weapon_model=Weapon;
	Wep=spawn("script_model",Location+(0,0,0));
	Wep setModel(weapon_model);
	Wep.angles=angle;
	for(;;)
	{
		foreach(player in level.players)
		{
			Radius=distance(Location,player.origin);
			if(Radius<80)
			{
				player setLowerMessage(WeaponName,"Press ^3[{+activate}]^7 to swap for "+WeaponName);
				if(player UseButtonPressed())wait 0.2;
				if(player UseButtonPressed())
				{
					if(!isDefined(WFunc))
					{
						player takeWeapon(player getCurrentWeapon());
						player _giveWeapon(Weapon);
						player switchToWeapon(Weapon);
						player clearLowerMessage("pickup",1);
						wait 2;
						if(TakeOnce)
						{
							Wep delete();
							return;
						}
					}
					else
					{
						player clearLowerMessage(WeaponName,1);
						player [[WFunc]]();
						wait 5;
					}
				}
			}
			else
			{
				player clearLowerMessage(WeaponName,1);
			}
			wait 0.1;
		}
		wait 0.5;
	}
}

Code:
Rust()
{
	CreateBlocks((773, 1080, 258), (0, 90, 0));
	CreateRamps((745, 1570, 383), (745, 1690, 273));
	CreateDoors((565, 1540, 295), (653, 1540, 295), (90, 90, 0), 3, 2, 15, 60);
	CreateGrids((773, 1135, 258), (533, 1795, 258), (0, 0, 0));
	CreateGrids((695, 1795, 378), (533, 1540, 378), (0, 0, 0));
	CreateGrids((773, 1540, 498), (533, 1795, 498), (0, 0, 0));
	CreateWalls((533, 1795, 278), (773, 1795, 498));
	CreateWalls((790, 1795, 278), (790, 1540, 498));
	CreateWalls((515, 1540, 278), (515, 1795, 498));
	CreateWalls((773, 1540, 278), (715, 1540, 378));
	CreateWalls((590, 1540, 278), (533, 1540, 378));
	CreateWalls((773, 1540, 398), (533, 1540, 428));
	CreateWalls((773, 1540, 458), (740, 1540, 498));
	CreateWalls((566, 1540, 458), (533, 1540, 498));

	SpawnWeapons(undefined, "cheytac_fmj_xmags_mp","Intervention",(-1525.24, -618.255, -181.442),0,(0, 12.4805, 2));
	SpawnWeapons(undefined, "cheytac_fmj_xmags_mp","Intervention",(-1570.5, -426.009, -191.707),0,(0, 13.8098, 2));
	SpawnWeapons(undefined, "cheytac_fmj_xmags_mp","Intervention",(-1616.33, -257.707, -198.371),0,(0, 16.6003, 2));
	SpawnWeapons(undefined, "cheytac_fmj_xmags_mp","Intervention",(-1679.32, -71.8425, -205.547),0,(0, 17.4078, 2));

	CreateRamps((761.496, 1082.41, 268.125),(1487.17, 1004.01, -132.729));
	CreateRamps((1196.07, 1200, -103.875),(1385.72, 1189.4, -235.665));
	CreateRamps((-269.467, 803.671, -132.875),(-255.766, 1039.92, -235.517));
	CreateElevator((-756.23, -5357.28, -231.667),(-4114.06, -5353.85, 1223.66));
	CreateElevator((-1948.55, 5347.99, -50.1143),(-9901.73, 304.533, 1315.93));
	CreateElevator((1636.57, -222.69, -224.475),(1690.81, -279.993, -209.872));
	CreateElevator((-523.164, -280.326, -219.107),(-468.875, -224.875, -208.082));
	CreateElevator((1685.62, 1860.73, -216.46),(1629.07, 1797.74, -215.573));
	CreateElevator((707.904, 965.688, -200.893),(676.526, 1672.43, 392.625));
}
can you use mods without AtrlWnet?
Quote Originally Posted by frandaman View Post
can you use mods without AtrlWnet?
Write only for Mod's alteriw and use only alteriw
Quote Originally Posted by frandaman View Post
can you use mods without AtrlWnet?
on steam you can
if take once wep delete??
im not good modder
but maybe its that?
In SP works this, and I think that in MP too:

Code:
SpawnWeap(weapon,location,angles)
{
Wep = spawn(weapon,location);
Wep.angles = (angles);
}
Posts 1–6 of 6 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?