What do i write if waittill death doesnt work?

Post your scripting questions / solutions here

Moderator: Moderators

Grassy
First Lieutenant
Posts: 221
Joined: Sun Aug 22, 2004 11:36 am

Post by Grassy »

Master-Of-Fungus-Foo-D wrote:crap it didnt work :evil:
heres the whole enchilada... heres the setthread....
airborne:
if (level.axishasspy != 3)
{
println "Be the otherteam... BE the other team :) "
local.lt = parm.other
if (local.pvt.dmteam == "axis" )
//should be local.lt.dmteam == axis ??
{
level.axishasspy++
setcvar "cg_3rd_person" "1" //debug
local.lt takeall
local.lt model "player/allied_airborne.tik"
local.lt item weapons/colt45.tik
local.lt item weapons/BAR.tik
local.lt ammo mg 60
local.lt ammo pistol 4
local.lt useweaponclass mg
while(level.axishasspy>0)
{
if (! isAlive local.lt )
{
setcvar "cg_3rd_person" "0"
level.axishasspy--
break
}
}
}
}
end[/code]
An ambiguous question will get a similar answer...
Green Beret
Major General
Posts: 746
Joined: Mon Apr 19, 2004 12:21 pm
Contact:

Post by Green Beret »

yea,its kinda like counterdicting yourself

if you have local.lt = parm.other then it would have to be
if (local.lt.dmteam == "axis" ) where does the pvt
come from?
local.lt = parm.other
if (local.pvt.dmteam == "axis" )
Image
Master-Of-Fungus-Foo-D
Muffin Man
Posts: 1544
Joined: Tue Jan 27, 2004 12:33 am
Location: cali, United States

Post by Master-Of-Fungus-Foo-D »

oops,copy+past is where it came from..... seems as if i meissed something :oops:
sry for diging up your time... fixing :D
Image
The Fungus Theme song!!!

Code: Select all

while (local.player istouching self)
Master-Of-Fungus-Foo-D
Muffin Man
Posts: 1544
Joined: Tue Jan 27, 2004 12:33 am
Location: cali, United States

Post by Master-Of-Fungus-Foo-D »

fixed that error, still when i kill myself, i dot get the axishasspy--.. its stays the same :(
Image
The Fungus Theme song!!!

Code: Select all

while (local.player istouching self)
Grassy
First Lieutenant
Posts: 221
Joined: Sun Aug 22, 2004 11:36 am

Post by Grassy »

Strange, try these small changes to got a better idea of what's happening.

Code: Select all

println "level.axishasspy = :" level.axishasspy

while(level.axishasspy>0) 
{ 
    if (! isAlive local.lt ) 
    { 
       setcvar "cg_3rd_person" "0" 
       level.axishasspy--
       println "[player died] level.axishasspy = :" level.axishasspy
       break 
    }
  wait 1  //you should have a small pause in a while loop 
} 
An ambiguous question will get a similar answer...
Master-Of-Fungus-Foo-D
Muffin Man
Posts: 1544
Joined: Tue Jan 27, 2004 12:33 am
Location: cali, United States

Post by Master-Of-Fungus-Foo-D »

k.. thx... (stupid programming wont et me use waittill death and make life easy :evil: )
Image
The Fungus Theme song!!!

Code: Select all

while (local.player istouching self)
Master-Of-Fungus-Foo-D
Muffin Man
Posts: 1544
Joined: Tue Jan 27, 2004 12:33 am
Location: cali, United States

Post by Master-Of-Fungus-Foo-D »

oh MAN grassy youre the best ever :D !!!!!
IT worked! if i was over 21 id buy you a beer (if youre over 21 :P )... amybe a fine wine or liquor.... or maybe a cash prize is best!
THX... now, im off to face another dilemma:
trying to only allow the player to trigger it once :P
Image
The Fungus Theme song!!!

Code: Select all

while (local.player istouching self)
Grassy
First Lieutenant
Posts: 221
Joined: Sun Aug 22, 2004 11:36 am

Post by Grassy »

Hehe, maye I'm WELL over 21 more than twice that actually :)

For the trigger once by the tagged player try this option:

Code: Select all

airborne: 
if (level.axishasspy != 3)
{ 
 println "Be the otherteam... BE the other team :) " 
 local.lt = parm.other
 
  if ((local.lt.dmteam == "axis") && (local.lt.istagged !=1)) 
  { 
   level.axishasspy++ 
   setcvar "cg_3rd_person" "1" //debug 
   local.lt takeall 
   local.lt model "player/allied_airborne.tik" 
   local.lt item weapons/colt45.tik 
   local.lt item weapons/BAR.tik 
   local.lt ammo mg 60 
   local.lt ammo pistol 4 
   local.lt useweaponclass mg
   local.lt.istagged = 1  //new variable to track tagged player
 
     while(level.axishasspy>0) 
     { 
       if (! isAlive local.lt ) 
       { 
         setcvar "cg_3rd_person" "0" 
         level.axishasspy-- 
         break 
       }
      wait 1 
     } 
  } 
} 
end
An ambiguous question will get a similar answer...
Post Reply