Original Author(s): Gizd
Core Version: 2.7.0
Description: This procedure sets player's vest health to a value.
ID - ID of player
HP - vest health value(0-100)
If player had no vest before this procedure will erase default texts on screen(you killed.. etc).
procedure SetVest(ID, HP: byte);
var
sHP, sV: byte;
begin
sHP:= GetPlayerStat(ID,'Health');
sV:= GetPlayerStat(ID,'Vest');
while sV <> HP do begin
if sV = 0 then begin
GiveBonus(ID, 3);
DrawText(ID,1,' ',1,$000000,1,0,0);
sV:= 100;
end;
SetPlayerStat(ID,'Health', 200);
DoDamage(ID,ID,(sV - HP)*3);
sV:= GetPlayerStat(ID,'Vest');
end;
SetPlayerStat(ID,'Health', sHP);
end;