0 Members and 2 Guests are viewing this topic.
const//-----Default----- Default_Enabled=true; Default_Command='/toggle'; Default_Name='OverShields'; Default_On=$FF20FF20; Default_Off=$FFFF8020; Default_Error=$FFFF2020;//-----Shield----- Shield_Echo=true; Shield_Time=5; Shield_Rate=5; Shield_Chance=75; Shield_Vamp=true;type PlayerType = record Name: string; Health: integer; Time: integer; Dmg: integer; Flip: integer;// Skip: integer; end;var Enabled: boolean; Player: array[1..32] of PlayerType; MHealth: integer; i: integer;procedure PVarReset(ID: byte);begin if Player[ID].Time > -1 then Player[ID].Time:=-1; if Player[ID].Dmg > 0 then Player[ID].Dmg:=0; if Player[ID].Flip > 0 then Player[ID].Flip:=0;// if Player[ID].Skip > 0 then Player[ID].Skip:=0;end;procedure ActivateServer();var RMode: string;begin//-----Initialization----- Enabled:=Default_Enabled; RMode:=ReadINI('Soldat.ini','GAME','Realistic_Mode','0'); MHealth:=iif(RMode='1',65,150); for i:=1 to 32 do begin Player[i].Time:=-1;// Player[i].Skip:=0; Player[i].Dmg:=0; end;end;function OnCommand(ID: Byte; Text: string):boolean;var Temp0, Temp1: string;begin Result:=false;//-----Toggle----- Temp0:=GetPiece(LowerCase(Text), ' ', 0); //command Temp1:=GetPiece(LowerCase(Text), ' ', 1); //value if Temp0 = Default_Command then begin Case Temp1 of 'enable','true','on','1': begin if Enabled <> true then begin Enabled:=true; WriteConsole(0,Default_Name+' script enabled by '+Player[ID].Name+'.',Default_On); end else WriteConsole(ID,Default_Name+' script is already enabled.',Default_Error); end; 'disable','false','off','0': begin if Enabled <> false then begin Enabled:=false; WriteConsole(0,Default_Name+' script disabled by '+Player[ID].Name+'.',Default_Off); end else WriteConsole(ID,Default_Name+' script is already disabled.',Default_Error); end; end; end; if Temp0 = '/bon' then begin GiveBonus(ID,strtoint(Temp1)); end;end;procedure OnJoinGame(ID, Team: byte);begin//-----Join Stuff----- if Enabled then begin for i:=1 to 32 do begin Player[i].Name:=GetPlayerStat(i,'Name'); end; end;end;procedure OnJoinTeam(ID, Team: byte);begin//-----Switch Stuff----- if Enabled then begin PVarReset(ID); end else exit;end;procedure AppOnIdle(Ticks: integer);begin//-----Time Stuff----- if Enabled then begin for i:=1 to 32 do begin if Player[i].Time > 0 then begin Player[i].Time:=Player[i].Time-1; end else if Player[i].Time = 0 then begin if Player[i].Health < MHealth then begin// Player[i].Skip:=1; DoDamage(i,Player[i].Dmg); Player[i].Time:=1; end else if Player[i].Health = MHealth then begin Player[i].Time:=-1; Player[i].Dmg:=0; end else if Player[i].Health < MHealth then begin DoDamage(i,Player[i].Health-MHealth); end; end else if Player[i].Time < 0 then exit; end; end else exit;end;function OnPlayerDamage(Victim, Shooter: Byte; Damage: integer):integer;begin//-----Damage Stuff----- if Enabled then begin// if Player[Victim].Skip = 0 then begin if Player[Victim].Health < 10 then begin WriteConsole(Victim,'Your shields are down, Get to cover!',$FFFF2020); Player[Victim].Flip:=Random(1,100); if Player[Victim].Flip > Shield_Chance then Result:=0 else Result:=Damage; end else Result:=Damage; if Shield_Echo then WriteLn(inttostr(Damage)); Player[Victim].Time:=Shield_Time; Player[Victim].Health:=GetPlayerStat(Victim,'Health'); if Player[Victim].Dmg = 0 then Player[Victim].Dmg:=(MHealth/Player[Victim].Health)/Shield_Rate;// end else if Player[Victim].Skip > 0 then Player[Victim].Skip:=Player[Victim].Skip-1; end else exit;end;procedure OnPlayerKill(Killer, Victim: byte; Weapon: string);begin//-----Death Stuff----- if Enabled then begin PVarReset(Victim); if Shield_Vamp then begin if Player[Killer].Health <> MHealth then begin WriteConsole(Killer,'Healed for killing an enemy.',$FF20FF20); DoDamage(Killer,Player[Killer].Health-MHealth); PVarReset(Killer); end else exit; end else exit; end else exit;end;procedure OnLeaveGame(ID, Team: byte; Kicked: boolean);begin//-----Leave Stuff----- if Enabled then begin PVarReset(ID); end else exit;end;
Are you 9 years old? Or is that just your mental age.