i want snipers only plz help me all

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
LT.BARNES
Major
Posts: 288
Joined: Mon Dec 30, 2002 4:37 pm
Location: london

i want snipers only plz help me all

Post 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
...prepare for your finest hour...
LT.BARNES
Major
Posts: 288
Joined: Mon Dec 30, 2002 4:37 pm
Location: london

Post 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
...prepare for your finest hour...
Parts
Sergeant
Posts: 72
Joined: Thu Apr 10, 2003 12:35 pm
Location: UK
Contact:

Post 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
[VS-UK]Capt.Parts[BnHQ]
User avatar
small_sumo
Lieutenant General
Posts: 953
Joined: Mon Jul 01, 2002 4:17 pm
Contact:

Post 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
Image

www.smallsumo.tk

Yeah Truth above Honor Man ;)
User avatar
Alcoholic
General
Posts: 1470
Joined: Sat May 17, 2003 5:57 am
Location: California
Contact:

Post 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
Post Reply