Author Topic: Small little help required : ]  (Read 724 times)

0 Members and 1 Guest are viewing this topic.

Offline Bolt

  • Major
  • *
  • Posts: 64
  • {MLP}
    • http://www.darkdemon.org/bolt/
Small little help required : ]
« on: September 15, 2008, 06:36:33 am »
http://forums.soldat.pl/index.php?topic=17162.0

This script here is great, however, I need it to work with a negative value, so the health decreaces over time. Could someone make the health decrease by -1 instead of increasing by 5.

Also, I accept links to other scripts which perform what I'm talking about properly : P

Offline Norbo

  • Camper
  • ***
  • Posts: 338
Re: Small little help required : ]
« Reply #1 on: September 15, 2008, 06:42:22 am »
Code: [Select]
// Health Regeneration Script v1.2 by Avkon
// This script automatically replenishes lost health of all players at a specified pace.

// Declare a couple of essential values:
const
  MAX_HEALTH = 150; // Set to 150 for non-realistic mode, else set to 65.
  DROP_VALUE = 1;   // Value of each 'drop' of health, def: 5.

// Incorporate main health regen code into AppOnIdle procedure:
procedure AppOnIdle(Ticks: integer);
var i: byte;
begin
  if Ticks mod (60 * 1) = 0 then begin
  for  i := 1 to 32 do
    if (GetPlayerStat(i,'Health') < (MAX_HEALTH - (DROP_VALUE - 1))) then begin
      DoDamage(i,DROP_VALUE);
    end else begin
      DoDamage(i,(MAX_HEALTH - (GetPlayerStat(i,'Health'))));
    end;
  end;
end;

// Inform players of health regen modification:
procedure OnJoinTeam(ID, Team: byte);
begin
  SayToPlayer(ID, 'This server runs the following mod:');
  SayToPlayer(ID, '! Health Regeneration Script v1.2 (by Avkon)');
end;

i guess delating the + in onPlayerDamage and setting drop value to 1 will do
not tested

Offline Bolt

  • Major
  • *
  • Posts: 64
  • {MLP}
    • http://www.darkdemon.org/bolt/
Re: Small little help required : ]
« Reply #2 on: September 15, 2008, 02:46:56 pm »
So you think that if I changed my script with that it should work?

Offline Norbo

  • Camper
  • ***
  • Posts: 338
Re: Small little help required : ]
« Reply #3 on: September 15, 2008, 03:05:33 pm »
So you think that if I changed my script with that it should work?
i guess

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Small little help required : ]
« Reply #4 on: September 16, 2008, 05:30:11 am »
MAX_HEALTH should be 65 when realistic is enabled