Page 2 of 2

Posted: Thu Mar 23, 2006 7:17 pm
by Habsey


lol try this


Code: Select all


while(1)
{
	for(local.i=1;local.i<=$player.size;local.i++)
	{
                                local.myteam = $player[local.i].dmteam
		if!($player[local.i].fix)
		{
			if ($player[local.i].dmteam == "axis") 
			{ 
				$player[local.i] takeall 
				$player[local.i] item weapons/kar98sniper.tik 
				$player[local.i].fix = 1
			} 
			if ($player[local.i].dmteam == "allies") 
			{ 
				$player[local.i] takeall 
				$player[local.i] item weapons/springfield.tik 
				$player[local.i].fix = 1
			} 

		}
		else 
		{
			if($player[local.i].dmteam != local.myteam || (!(isalive $player[local.i])))
			{
				$player[local.i].fix = NIL
			}
		}
	}	
	waitframe
}

Posted: Thu Mar 23, 2006 7:43 pm
by Elgan
local.myteam = $player[local.i].dmteam

will always be the same, unless its changed inless than the frame;)

Posted: Thu Mar 23, 2006 8:04 pm
by Habsey
Elgan wrote:local.myteam = $player[local.i].dmteam

will always be the same, unless its changed inless than the frame;)
meh

here

lol

Code: Select all

while(1)
{
local.myteam = $player.dmteam
waitframe 
}

while(1) 
{ 
   for(local.i=1;local.i<=$player.size;local.i++) 
   { 
      if!($player[local.i].fix) 
      { 
         if ($player[local.i].dmteam == "axis") 
         { 
            $player[local.i] takeall 
            $player[local.i] item weapons/kar98sniper.tik 
            $player[local.i].fix = 1 
         } 
         if ($player[local.i].dmteam == "allies") 
         { 
            $player[local.i] takeall 
            $player[local.i] item weapons/springfield.tik 
            $player[local.i].fix = 1 
         } 

      } 
      else 
      { 
         if($player[local.i].dmteam != local.myteam || (!(isalive $player[local.i]))) 
         { 
            $player[local.i].fix = NIL 
         } 
      } 
   }    
   waitframe 
}

Posted: Thu Mar 23, 2006 8:18 pm
by Rookie One.pl
When they respawn, they'll get the weapon they chose anyway.

Posted: Thu Mar 23, 2006 8:46 pm
by Barttje
Rookie One.pl wrote:When they respawn, they'll get the weapon they chose anyway.
how can i stop that?

Posted: Thu Mar 23, 2006 9:32 pm
by Rookie One.pl
Use a script with proper spawn and death detection. :) AP's weapon limiter might really be a good choice. At least download it and see how it's done there. ;)

Posted: Fri Mar 24, 2006 7:02 am
by XenoPHoXx_NL
can't you just download the mod foloowing the next link and see how it was done?

http://www.moaclan.com/modules.php?name ... ostPopular

Posted: Fri Mar 24, 2006 1:56 pm
by Barttje
XenoPHoXx_NL wrote:can't you just download the mod foloowing the next link and see how it was done?

http://www.moaclan.com/modules.php?name ... ostPopular
That's the way I did it before, but now ive 2 maps and in one map Sniper-only and the other map All-weapons... :S

Posted: Fri Mar 24, 2006 5:33 pm
by Green Beret
I think your switch statements need tweaked, jus edit to your liking.

Code: Select all

local.mapname = getcvar(mapname)

switch local.mapname
{

case "dm/mohdm1":
 thread Sniper_only

break

case "dm/mohdm2":

break
I had a simular problem, And found a bit of code on the forums and added it to my script, and it worked perfect.

Code: Select all

local.mod2 = (int(getcvar dm2))

if(local.mod2 == 0 || local.mod2 == NIL)
exec maps/dm/mohdm2_v1.scr //stock

else
//{//not sure u need these lines?
//switch(local.mod2) 
{
case 1:
exec maps/dm/mohdm2_2.scr;break //your modded .scr with sniper only
case 2:
exec maps/dm/mohdm2_3.scr;break //your modded .scr with bla bla
case 3:
exec maps/dm/mohdm2_4.scr;break //your modded .scr another mod
case 4:
exec maps/dm/mohdm2_1.scr;break //your modded .scr bla bla
}

local.mod2++

if(local.mod2 > 4)
local.mod2 = 1

setcvar mod2 local.mod2
} 
Just make a .scr named mohdm2_2.scr with the sniper only script.

Posted: Fri Mar 24, 2006 6:24 pm
by lizardkid
yes you need those lines.

Code: Select all

else 
{//not sure u need these lines? 
switch(local.mod2) 
switch is a command to test multiple cases at once, it's where you need

Code: Select all

case x:    // stuff    
               break;
and the else bracket needs to be there otherwise you'll get syntax errors.