Author Topic: Healing with a vest -~ SOLVED ~-  (Read 591 times)

0 Members and 1 Guest are viewing this topic.

Offline Hacktank

  • Camper
  • ***
  • Posts: 462
  • Soldat Scripter
    • HTZRPG
Healing with a vest -~ SOLVED ~-
« on: March 15, 2009, 09:36:46 pm »
I am having some trouble getting healing to work if you have a vest. I have it do a loop trying to max out the vest and health but it only heals a little bit of your health and vest per running.

Here is the code: (vesthp is 100 if the players vest is > 0, otherwise it is 0)
Code: [Select]
repeat
if getplayerstat(ID,'health') < 150 then dodamage(ID,-2);
if getplayerstat(ID,'health') > 150 then dodamage(ID,2);
if getplayerstat(ID,'vest') < vesthp then dodamage(ID,-1);
until (getplayerstat(ID,'health') = 150) AND (getplayerstat(ID,'vest') = vesthp);

I dont get why this isnt working. What is the % of the damage done to the vest and the health when damage is done? Why isnt this working?

Thank You.
« Last Edit: March 16, 2009, 01:14:03 pm by Hacktank »


Offline chutem

  • Veteran
  • *****
  • Posts: 1119
Re: Healing with a vest
« Reply #1 on: March 15, 2009, 11:00:38 pm »
You need to spawn a vest kit on them using give bonus.

If you want vesthp to be less than the max vest, I think doing 2 damage takes away 1 vest hp
1NK3FbdNtH6jNH4dc1fzuvd4ruVdMQABvs

Offline danmer

  • Camper
  • ***
  • Posts: 466
  • crabhead
Re: Healing with a vest
« Reply #2 on: March 16, 2009, 04:07:54 am »
its something like 1/3 of the damage goes into vest and 1/4 to health. Just do some testing with writeln's in onplayerdamage

Offline Hacktank

  • Camper
  • ***
  • Posts: 462
  • Soldat Scripter
    • HTZRPG
Re: Healing with a vest
« Reply #3 on: March 16, 2009, 01:13:45 pm »
Thanks danmer. It works now. Im starting to feel stupid.. :P