Medic
Moderator: Moderators
- MPowell1944
- Moderator
- Posts: 287
- Joined: Thu Jan 09, 2003 7:06 am
- Location: Woodstock, GA
- Contact:
- MPowell1944
- Moderator
- Posts: 287
- Joined: Thu Jan 09, 2003 7:06 am
- Location: Woodstock, GA
- Contact:
Ok this is what I have. I changed the 70 health to 100, changed the bone to Forearm, added some stuff to the heal area, and I changed the vector_within from 100 to 25. Now, healing does not happen at all. Have a look.
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)
continue
if(vector_within $player[local.i].origin self.origin 25 && $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 FOR HEALING A TEAMMATE!"
$player[local.i] fullheal
break
}
}
waitframe
}
self.hasmodel = 0
self removeattachedmodel "Bip01 R Forearm"
endcould I do something like self.health++
Code: Select all
self.health += 5Moderator
۞
Abyssus pro sapientia
Olympus pro Ignarus
۞
AND STUFF™ © 2006
۞
Abyssus pro sapientia
Olympus pro Ignarus
۞
AND STUFF™ © 2006
- MPowell1944
- Moderator
- Posts: 287
- Joined: Thu Jan 09, 2003 7:06 am
- Location: Woodstock, GA
- Contact:
This is very weird. The script didnt work at first. Then out of nowhere it worked. I made a few changes which made it not work again. So I copied and pasted BD's script to the T, and it will not work. This is what I have as of right now.
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)
continue
if(vector_within $player[local.i].origin self.origin 25 && $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
break
}
}
waitframe
}
self.hasmodel = 0
self removeattachedmodel "Bip01 R Forearm"
endall I can see right now is that this line
looks to be two lines and should be one line
Code: Select all
if(vector_within $player[local.i].origin self.origin 25 && $player[local.i].useheld == 1 &&
$player[local.i].dmteam == self.dmteam) - MPowell1944
- Moderator
- Posts: 287
- Joined: Thu Jan 09, 2003 7:06 am
- Location: Woodstock, GA
- Contact:
- MPowell1944
- Moderator
- Posts: 287
- Joined: Thu Jan 09, 2003 7:06 am
- Location: Woodstock, GA
- Contact:
Hmmm, this part looks like it contradicts..
for(local.i=1;local.i<=$player.size;local.i++)
{
if($player[local.i] == self) //<--this line
continue //<-- & this line
self is already established, the new $player[local.i] must be on the same team and pressing use key when inside 25 units of self..
Try remming them out and see what it does.
for(local.i=1;local.i<=$player.size;local.i++)
{
if($player[local.i] == self) //<--this line
continue //<-- & this line
self is already established, the new $player[local.i] must be on the same team and pressing use key when inside 25 units of self..
Try remming them out and see what it does.
An ambiguous question will get a similar answer...
- MPowell1944
- Moderator
- Posts: 287
- Joined: Thu Jan 09, 2003 7:06 am
- Location: Woodstock, GA
- Contact:
That just keeps you from healing yourself . This thread is run by all the players and in each instance of this thread self it that player who is running this thread so when you check all the players you have to skip yourself .for(local.i=1;local.i<=$player.size;local.i++)
{
if($player[local.i] == self) //<--this line
continue //<-- & this line
- MPowell1944
- Moderator
- Posts: 287
- Joined: Thu Jan 09, 2003 7:06 am
- Location: Woodstock, GA
- Contact:
