Page 1 of 1

i want snipers only plz help me all

Posted: Tue Aug 19, 2003 12:15 pm
by LT.BARNES
hi

what do i put in the script for mp level to make it so all the players are only allowed to use the sniper only?

thanks

Posted: Wed Aug 20, 2003 2:58 pm
by LT.BARNES
can anyone help me?

i want to know what i need to put in the script so the players can only use a sniper in mp levels. plz help

Posted: Wed Aug 20, 2003 10:54 pm
by Parts
you need to replace all the weapons after they have spawned. Here's a script that gives all players a bolt action rifle, just adapt it to what you want.

There is one problem and that is that it isn't reliable on the first round of the map in spearhead, I haven't solved this porblem. It's due to the weapons selection screen

Code: Select all

//Script that assigns players weapons after they join a team
//could change it to be randomised or something

 level waittill roundstart

	//First set up an array of 44 to store the players status
	for (local.i = 1; local.i <= 44; local.i++)
	{
		level.PlayerGunsReplace[local.i] = 0
	}
	
	
RepeatTest:


	//Array initialised now loop
	for (local.y = 1; local.y <= $player.size; local.y++)
	{
		if (level.PlayerGunsReplace[local.y] == 0)
		{

			if ( isalive($player[local.y]) && ($player[local.y].health > 0) )
			{
			
				if( $player[local.y].dmteam == axis )
				{
					level.PlayerGunsReplace[local.y] = 1
					thread GiveAxisWeapons $player[local.y]

				}
				else if( $player[local.y].dmteam == allies )
				{
					level.PlayerGunsReplace[local.y] = 1
					thread GiveAlliedWeapons $player[local.y]
				}
				else
				{
					//not added to team yet
					//println (local.y + ": Found but not in team yet")
				}
			}
		}
	}
	
	wait 1
	goto RepeatTest

end

GiveAxisWeapons local.player:
	wait 2
	local.player takeall
	local.player item models/weapons/p38.tik
	local.player item models/weapons/kar98.tik	
	local.player item models/weapons/steilhandgranate.tik
	local.player ammo grenade 1
	local.player item models/weapons/nebelhandgranate.tik
	local.player ammo smokegrenade 1
	local.player useweaponclass "rifle"
	local.player iprint "You have been given a bolt action rifle"
	println "should have given player axis weapons" 	
end

GiveAlliedWeapons local.player:
	wait 2
	local.player takeall
	local.player item models/weapons/Webley_Revolver.tik
	local.player item models/weapons/enfield.tik
	local.player  item models/weapons/mills_grenade.tik
	local.player  ammo grenade 1
	local.player  item models/weapons/M18_smoke_grenade.tik
	local.player  ammo smokegrenade 1
	//local.player weapnext
	local.player useweaponclass "rifle"
	local.player iprint "You have been given a bolt action rifle"
		
	println "should have given player allied weapons" 
end

Posted: Thu Aug 21, 2003 1:48 am
by small_sumo
That looks great I would like to try it at my lan, but thing is I have no idea how to implement the code. How is it done?

Thanks

Posted: Thu Aug 21, 2003 2:08 am
by Alcoholic
Do you have a script already made? Just copy all that to where your 'level waittill roundstart' line is... if you do it right, you'll have 2 lines that say 'level waittill roundstart'... just delete one of them. (Only works on roundbased though) :D