Page 2 of 2

Posted: Fri Feb 25, 2005 2:57 pm
by Green Beret
yes,i have this in my thread,but in a different thread i made to check for the player who triggered the trigger,to change his/her weapon.

will this still change the parm.other eventually?
i will post my script,that way no mistakes 8-)

EDIT**

Code: Select all

death_check:
            self waittill trigger
            local.player[i]=parm.other
            if(local.player[i].isdeath_check == 1)
end

local.player[i].isdeath_check = 1

while(1)
{   
for(local.i=1;local.i<=$player.size;local.i++)
{
   if(local.player[i].dmteam != allies)//want it to = the triggerer
   {
   local.team = local.player.dmteam
   while (isAlive(local.player[i]) && local.player[i].dmteam == local.team)
//want to exec this stuff when dies and respawns,only for triggerer
   wait .1 
   local.player[i] takeall
   local.player[i] give "models/weapons/silencedpistol.tik"
   local.player[i] give "models/weapons/kar98.tik"
   }
   else if(local.player[i].dmteam != spectator)
   waitframe
   {
      local.player[i] light 0 0 0 1
   }
  }
waitframe
break
}   
thread death_check 

end
 
now,i changed this around bout 50 times,because the parm.other did effect everyone.i know very little bout scripting like this.
so please hold nothing back....i wanna learn :P

Posted: Fri Feb 25, 2005 9:41 pm
by bdbodger
well you don't quite get it yet .
death_check:
self waittill trigger
local.player=parm.other // local.player ??? what is i and why are you making it an array ?
if(local.player.isdeath_check == 1)
end


and

for(local.i=1;local.i<=$player.size;local.i++)
{
if(local.player.dmteam != allies)//want it to = the triggerer


why are you useing a for statement to go through all the players when you only want to deal with the 1 player who triggered the trigger . Also the sytax is wrong it should have been like this

for(local.i=1;local.i<=$player.size;local.i++)
{
if($player.dmteam != allies)//want it to = the triggerer

I would say make local.player just local.player in the whole thread and get rid of that for statement you do not need that at all .Then take out the thread death_check line at the end and also the self waittill trigger line and use the setthread key on the trigger instead .

Posted: Sat Feb 26, 2005 12:46 am
by Green Beret
well i add the because the trigger would effect everyone until i changed it to ,then it only effected the triggerer.
i will make changes and see what happens :(

Posted: Sat Feb 26, 2005 11:38 am
by bdbodger
my mistake too should have been $player[local.i] not $player that would work in cod but not mohaa you need the local. in front of it . It was the for statement that made it effect everyone you don't need that.

I think you should do it this way . first give your trigger the key setthread and value death_check then try this .

Code: Select all

death_check:

	local.player=parm.other

	if(local.player.isdeath_check == 1)
		end

	local.player.isdeath_check = 1

	if(isAlive(local.player) && local.player.dmteam == axis)
	{

		local.player takeall
		local.player give "models/weapons/silencedpistol.tik"
		local.player give "models/weapons/kar98.tik"
    		local.player light 1 0 0 100 // r b g radius this is red light
    		local.player lighton

		while (isAlive(local.player) && local.player.dmteam == axis)
		{
			wait .1
		}

		local.player.isdeath_check = 0
    		local.player lightoff
	}
end

Posted: Sat Feb 26, 2005 10:37 pm
by Grassy
This is interesting not trying to steal the thread, only adding options:D

I have been scratching my head on this sort of thing for a while in a liberation scenario. People do all sorts of things in multiplayer to find glitches or script loopholes. In BD's example if that thread were watching a trigger_multiple in a jail would it also need to take into account players who go into spectate mode while in a jail, and maybe even players who try to swap teams, maybe this line might catch them
if(isAlive(local.player) && local.player.dmteam == axis)
or maybe it needs the third check added like so;

Code: Select all

if(isAlive(local.player) && local.player.dmteam == axis && local.player.dmteam != spectator) 
Is this overkill Bd? I note that in the original game scr's they have tried to cover all possible bases in multiplayer use.

Grassy

Posted: Sun Feb 27, 2005 9:32 am
by bdbodger
I think a players dmteam can only be one of these allies axis ffa or spectator at any time .

Posted: Tue Mar 01, 2005 3:29 pm
by Green Beret
Thanx bd,that script you made works perfect.
but i bet you knew that already :wink:

i know theres already medic mods out there,but this one is more basic but also fun to play :P