Posted: Sat Apr 09, 2005 10:24 am
Try this out tested in game . the distance was too small for the vector_within
Code: Select all
health_thread:
while(1)
{
for(local.i=1;local.i<=$player.size;local.i++)
{
if($player[local.i].health < 100 && $player[local.i].hasmodel != 1)
$player[local.i] thread waitheal
}
waitframe
}
end
waitheal:
self.hasmodel = 1
self attachmodel models/items/item_100_healthbox.tik "Bip01 R Forearm"
while(self.health < 100 && isalive self)
{
for(local.i=1;local.i<=$player.size;local.i++)
{
if($player[local.i] != self)
{
if(vector_within $player[local.i].origin self.origin 125 && $player[local.i].useheld == 1 && $player[local.i].dmteam == self.dmteam)
{
self fullheal
self playsound dfr_M1L2_thankyou
$player[local.i] iprint "YOU GET FULL HEALTH + 1 GRENADE FOR HEALING A TEAMMATE."
$player[local.i] fullheal
$player[local.i] ammo grenade 1
}
}
}
waitframe
}
self.hasmodel = 0
self removeattachedmodel "Bip01 R Forearm"
end