Total Members Voted: 9
0 Members and 1 Guest are viewing this topic.
const EchoDamage=true;var Active: array[1..32] of boolean; Health: array[1..32] of integer; PHealth: array[1..32] of integer; i: integer;begin for i:=1 to 32 do begin Active[i]:=GetPlayerStat(i,'active'); Health[i]:=GetPlayerStat(i,'health'); if ReadINI('Soldat.ini','GAME','Realistic_Mode','0') = '1' then begin PHealth[i]:=Round((60/100)*Health[i]); end else PHealth[i]:=Round((150/100)*Health[i]); end;end.function OnPlayerDamage(Victim, Shooter: byte; Damage: integer):integer;begin Case PHealth[Victim] of 75 to 100: begin Result:=Round(Damage*1.00); if EchoDamage then WriteLn(Result); end; 50 to 74: begin Result:=Round(Damage*0.75); if EchoDamage then WriteLn(Result); end; 25 to 49: begin Result:=Round(Damage*0.50); if EchoDamage then WriteLn(Result); end; 0 to 24: begin SayToPlayer(Victim,'Your shields are down, get to cover!'); Result:=Round(Damage*0.25); if EchoDamage then WriteLn(Result); end; end;end;
If you die out there, I'll kill you.
const EchoDamage=true;var Active: array[1..32] of boolean; Health: array[1..32] of integer; PHealth: array[1..32] of integer; RealisticMode: boolean;procedure ActivateServer();begin if ReadINI('Soldat.ini','GAME','Realistic_Mode','0')='1' then RealisticMode:=true else RealisticMode:=false;end; procedure AppOnIdle(Ticks: integer);var i: byte;begin for i:=1 to 32 do begin Active[i]:=GetPlayerStat(i,'active'); if Active[i]=false then continue; Health[i]:=GetPlayerStat(i,'health'); if RealisticMode then PHealth[i]:=Round((60/100)*Health[i]) else PHealth[i]:=Round((150/100)*Health[i]); end;end;function OnPlayerDamage(Victim, Shooter: byte; Damage: integer):integer;begin Result:=Damage; if PHealth[Victim]>=75 then begin Result:=Round(Damage*1.00); if EchoDamage then WriteLn(inttostr(Result)); end else if PHealth[Victim]>=50 then begin Result:=Round(Damage*0.75); if EchoDamage then WriteLn(inttostr(Result)); end else if PHealth[Victim]>=25 then begin Result:=Round(Damage*0.50); if EchoDamage then WriteLn(inttostr(Result)); end else begin SayToPlayer(Victim,'Your shields are down, get to cover!'); Result:=Round(Damage*0.25); if EchoDamage then WriteLn(inttostr(Result)); end;end;
You don't have AppOnIdle in there at all, and there's full stop instead of a semicolon after "end".
Here's a fixed version:[ ... code ... ]Now, I don't know if this works as you intended it to or not [...]
const EchoDamage=true;var Active: array[1..32] of boolean; Health: array[1..32] of integer; PHealth: array[1..32] of integer; max_health: single;procedure ActivateServer();begin if ReadINI('Soldat.ini','GAME','Realistic_Mode','0')='1' then max_health:=0.65 else max_health:=1.5;end;procedure AppOnIdle(Ticks: integer);var i: byte;begin for i:=1 to 32 do begin Active[i]:=GetPlayerStat(i,'active'); if Active[i]=false then continue; Health[i]:=GetPlayerStat(i,'health'); PHealth[i]:=Round(Health[i]/max_health); end;end;function OnPlayerDamage(Victim, Shooter: byte; Damage: integer):integer;var multiplier: single;begin if PHealth[victim] < 0 then exit; multiplier := 0.25 * ((PHealth[victim] div 25) +1); if multiplier > 1.0 then multiplier:=1.0; Result:=round(damage*multiplier); if EchoDamage then WriteLn(inttostr(Result)); if multiplier = 0.25 then SayToPlayer(Victim,'Your shields are down, get to cover!'); {uncomment below for finer time granularity than 1 second in AppOnIdle} { Health[victim] = getplayerstat(victim,'health') - result; PHealth[victim]:=Round(Health[victim]/max_health); }end;
it's an overshields script (yes I am a halo-fanatic/worshiper/forerunner enthusiast)
Case PHealth[Victim] of 75..100: begin Result:=Round(Damage*1.00); if EchoDamage then WriteLn(Result); end; 50..74: begin Result:=Round(Damage*0.75); if EchoDamage then WriteLn(Result); end; 25..49: begin Result:=Round(Damage*0.50); if EchoDamage then WriteLn(Result); end; 0..24: begin SayToPlayer(Victim,'Your shields are down, get to cover!'); Result:=Round(Damage*0.25); if EchoDamage then WriteLn(Result); end; end;
const EchoDamage=true;var Active, Nocall: array[1..32] of boolean; Health: array[1..32] of integer; PHealth: array[1..32] of integer; MHealth: single; HealTime: array[1..32] of integer; i: integer;procedure AppOnIdle(Ticks: integer);begin for i:=1 to 32 do begin if HealTime[i]>0 then HealTime[i]:=HealTime[i]-1; if HealTime[i]=0 then begin NoCall[i]:=true; DoDamage(i,Round(GetPlayerStat(i,'Health')/3)); NoCall[i]:=false; end; end;end;procedure ActivateServer();begin if ReadINI('Soldat.ini','GAME','Realistic_Mode','0')='1' then begin MHealth:=0.65; end else MHealth:=1.5;end;function OnPlayerDamage(Victim, Shooter: byte; Damage: integer):integer;var Flip: integer;begin if not NoCall then begin for i:=1 to 32 do begin Health[i]:=GetPlayerStat(i,'health'); PHealth[i]:=Round(MHealth*Health[i]) end; Case PHealth[Victim] of 75..100: begin Result:=Round(Damage*1.00); if EchoDamage then WriteLn(Result); end; 50..74: begin Result:=Round(Damage*0.75); if EchoDamage then WriteLn(Result); end; 25..49: begin Result:=Round(Damage*0.50); if EchoDamage then WriteLn(Result); end; 2..24: begin SayToPlayer(Victim,'Your shields are down, get to cover!'); Result:=Round(Damage*0.25); if EchoDamage then WriteLn(Result); end; 0..1: begin Flip:=Random(0,100); if Flip < 80 then Result:=0 else Result:=Damage; end; end; end else if NoCall then exit;end;
const EchoDamage=true;var Active, Nocall: array[1..32] of boolean; Health: array[1..32] of integer; PHealth: array[1..32] of integer; MHealth: single; HealTime: array[1..32] of integer; i: integer;procedure OnJoinGame(ID, Team: Byte);begin HealTime[ID]:=-1;end;procedure AppOnIdle(Ticks: integer);begin for i:=1 to 32 do begin if (NumPlayers>0) and (HealTime[i]>0) then HealTime[i]:=HealTime[i]-1; if (NumPlayers>0) and (HealTime[i]=0) then begin NoCall[i]:=true; DoDamage(i,Round(GetPlayerStat(i,'Health')/3)); NoCall[i]:=false; end; if (NumPlayers>0) and (HealTime[i]<0) then exit; end;end;procedure ActivateServer();begin if ReadINI('Soldat.ini','GAME','Realistic_Mode','0')='1' then begin MHealth:=0.65; end else MHealth:=1.5;end;function OnPlayerDamage(Victim, Shooter: byte; Damage: integer):integer;var Flip: integer;begin for i:=1 to 32 do begin Active[i]:=GetPlayerStat(i,'Active'); Health[i]:=GetPlayerStat(i,'health'); PHealth[i]:=Round(MHealth*Health[i]); if (Active[Victim]) and (NumPlayers > 0) and (not NoCall[i]) then begin if (PHealth[Victim] > 75) and (PHealth[Victim] < 100) then begin Result:=Round(Damage*1.00); if EchoDamage then WriteLn(inttostr(Result)); end; if (PHealth[Victim] > 50) and (PHealth[Victim] < 75) then begin Result:=Round(Damage*0.75); if EchoDamage then WriteLn(inttostr(Result)); end; if (PHealth[Victim] > 25) and (PHealth[Victim] < 50) then begin Result:=Round(Damage*0.50); if EchoDamage then WriteLn(inttostr(Result)); end; if (PHealth[Victim] > 1) and (PHealth[Victim] < 25) then begin SayToPlayer(Victim,'Your shields are down, get to cover!'); Result:=Round(Damage*0.25); if EchoDamage then WriteLn(inttostr(Result)); end; if (PHealth[Victim] = 1) then begin Flip:=Random(0,100); if Flip < 80 then Result:=0 else Result:=Damage; end; end else if NoCall[i] then exit; end;end;