Official Soldat Forums

Server Talk => Scripting Discussions and Help => Topic started by: dominikkk26 on November 16, 2013, 12:15:10 pm

Title: Treatment without repair vest and repair vest
Post by: dominikkk26 on November 16, 2013, 12:15:10 pm
You may have guessed that this is a treatment by the physician.
How to do that during of this treatment when a player has a vest, not healed him less and do not repair the vest?
And how repair vest, not curing the player?
If setplayerstat this acted I would not the problem, but that does not work?
Code: [Select]
procedure Heal(Team: byte);
var
  HP: integer;
  i: byte;
begin
  for i:= 1 to 32 do if GetPlayerStat(i,'Active') = true then if GetPlayerStat(i,'Alive') = true then if GetPlayerStat(i,'Health') < MaxHP then
   if Team = GetPlayerStat(i,'Team') then if
    Distance(GetPlayerStat(Medic[Team],'X'),GetPlayerStat(Medic[Team],'Y'),GetPlayerStat(i,'X'),GetPlayerStat(i,'Y')) <= HealDistance then begin

    if GetPlayerStat(i,'Health') <= (MaxHP-HpHealed) then HP:= 5 else HP:= MaxHP-GetPlayerStat(i,'Health');
    DoDamage(i,-HP);
    if Medic[Team] <> i then begin
      inc(Healed[Team],HP);
      if Healed[Team] > HealForPoint then begin
        WriteConsole(Medic[Team],'You got 1 point for healing.',Color);
        SetScore(Medic[Team],GetPlayerStat(Medic[Team],'Kills')+1);
        Healed[Team]:= 0;
      end;
    end;
  end;
end;
Title: Re: Treatment without repair vest and repair vest
Post by: DarkCrusade on November 16, 2013, 01:16:12 pm
Google Translate. It's like cancer, just on the internet.
Title: Re: Treatment without repair vest and repair vest
Post by: dominikkk26 on November 16, 2013, 04:27:16 pm
How to heal a player of vest, by means of DoDamage, not repairing vest. And not to waste treatment values by vest.