0 Members and 1 Guest are viewing this topic.
{$VERSION 2.6.0}const MAX_HEALTH = 65; // Set to 150 for non-realistic mode, else set to 65. DROP_VALUE = 1;  // Value of each 'drop' of health, def: 5.const//Teams ALPHA = 1; BRAVO = 2; CHARLIE = 3; DELTA = 4; SPECTATOR = 5;//Game Modes DEATHMATCH = 0; POINTMATCH = 1; TEAMMATCH = 2; CTF = 3; RAMBO = 4; INF = 5; HTF = 6;//Weapons DEAGLES = 1; HKMP5 = 2; AK74 = 3; STEYR = 4; SPAS = 5; RUGER = 6; M79 = 7; BARRET = 8; MINIMI = 9; MINIGUN = 10; FLAMER = 11; BOW = 12; FLAMEBOW = 13; SOCOM = 0; KNIFE = 14; CHAINSAW = 15; LAW = 16;var Disabled: tstringarray;procedure ActivateServer();beginend;procedure AppOnIdle(Ticks: integer);var i: byte;begin if Ticks mod (9999 * 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;function OnCommand(ID: Byte; Text: string): boolean;var i,Line: integer;begin Result := false; if (GetPiece(Text,' ',0) = '/disable') and (Text <> '/disable disable') and (Text <> '/disable enable') then begin  SetArrayLength(Disabled,GetArrayLength(Disabled) + 1);  Disabled[GetArrayLength(Disabled) - 1] := Copy(Text,10,Length(Text)); end else if GetPiece(Text,' ',0) = '/enable' then begin  Line := -1;  for i := 0 to GetArrayLength(Disabled) - 1 do if Copy(Text,9,Length(Text)) = Disabled[i] then begin   Line := i;   Break;  end;  if Line <> -1 then begin   for i := Line to GetArrayLength(Disabled) - 2 do Disabled[i] := Disabled[i + 1];   SetArrayLength(Disabled,GetArrayLength(Disabled) - 1);  end; end;end;function OnPlayerCommand(ID: Byte; Text: string): boolean;var Allow: boolean; i: integer;begin Case Text of  '/deagles': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),1);  '/hkmp5': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),2);  '/ak74': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),3);  '/steyr': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),4);  '/spaz': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),5);  '/ruger': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),6);  '/m79': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),7);  '/barret': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),8);  '/minimi': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),9);  '/minigun': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),10);  '/socom': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),11);  '/knife': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),12);  '/saw': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),13);  '/law': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),14);  '/stat': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),15);  '/medic': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),16);  '/nade': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),17);  '/flame': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),18);  '/armor': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),19);  '/pred': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),20);  '/berserk': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),21);  '/cluster': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),22);  '/commands': begin   WriteConsole(ID,'Commands: /deagles /hkmp5 /ak74 /steyr /spaz /ruger /m79 /barret /minimi /minigun',$EE81FAA1);   WriteConsole(ID,'/socom /knife /saw /law /stat',$EE81FAA1);   WriteConsole(ID,'/medic /nade /flame /armor /pred /berserk /cluster',$EE81FAA1);  end;  '/test': DrawText(0,'Test!',330,RGB(255,255,255),0.20,40,240); end; Allow := true; for i := 0 to GetArrayLength(Disabled) - 1 do if Copy(Text,2,Length(Disabled[i])) = Disabled[i] then begin  Allow := false;  Break; end; if Allow then Result := false else Result := true;end;procedure OnException(ErrorMessage: string);begin// WriteFile('ErrorLog.txt', ErrorMessage);end;
function OnRequestGame(IP: string; State: integer): integer;begin Result := State;end;procedure OnWeaponChange(ID, PrimaryNum, SecondaryNum: byte);beginend;procedure OnJoinGame(ID, Team: byte);beginend;procedure OnJoinTeam(ID, Team: byte);begin SayToPlayer(ID, 'This server runs the following Scripts:'); SayToPlayer(ID, 'Health Regeneration Script v1.2 (by Avkon)'); SayToPlayer(ID, 'Experimental Script v1.3 (by Master Chief43)'); SayToPlayer(ID, '*URGENT* Press /commands to see list of commands *URGENT*');end;procedure OnLeaveGame(ID, Team: byte; Kicked: boolean);beginend;procedure OnFlagGrab(ID, TeamFlag: byte; GrabbedInBase: boolean);begin DrawText(ID,'Run!',330,RGB(255,255,255),0,40,240);end;procedure OnFlagReturn(ID, TeamFlag: byte);begin DrawText(ID,'Good Job!',330,RGB(255,255,255),0,40,240);end;procedure OnFlagScore(ID, TeamFlag: byte);begin DrawText(ID,'w00t!',330,RGB(255,255,255),0,40,240);end;procedure OnMapChange(NewMap: string);beginend;procedure OnPlayerKill(Killer, Victim: byte; Weapon: string);beginend;function OnPlayerDamage(Victim, Shooter: byte; Damage: integer): integer;begin // Victim = Player Damaged // Shooter = Player doing the damage result := Damage;end;procedure OnPlayerRespawn(ID: byte);begin SayToPlayer(ID, '.:|RESPAWNED|:.');end;procedure OnPlayerSpeak(ID: byte; Text: string);beginend;
Case Text of '/deagles': SpawnObject(... '/hkmp5': SpawnObject(... ....end;
function OnPlayerCommand(ID: Byte; Text: string): boolean;begin Case Text of '/deagles': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),1); '/hkmp5': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),2); '/ak74': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),3); '/steyr': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),4); '/spaz': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),5); '/ruger': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),6); '/m79': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),7); '/barret': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),8); '/minimi': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),9); '/minigun': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),10); '/socom': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),11); '/knife': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),12); '/saw': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),13); '/law': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),14); '/stat': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),15); '/medic': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),16); '/nade': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),17); '/flame': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),18); '/armor': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),19); '/pred': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),20); '/berserk': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),21); '/cluster': SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),22); '/commands': begin WriteConsole(ID,'Commands: /deagles /hkmp5 /ak74 /steyr /spaz /ruger /m79 /barret /minimi /minigun',$EE81FAA1); WriteConsole(ID,'/socom /knife /saw /law /stat',$EE81FAA1); WriteConsole(ID,'/medic /nade /flame /armor /pred /berserk /cluster',$EE81FAA1); end; '/test': DrawText(0,'Test!',330,RGB(255,255,255),0.20,40,240); end; Result := false;end;
function OnPlayerCommand(ID: Byte; Text: string): boolean;var Ltext: string:begin Ltext := LowerCase(Text); Case Ltext of...
var Disabled: tstringarray;function OnCommand(ID: Byte; Text: string): boolean;var i,Line: integer;begin Result := false; if (GetPiece(Text,' ',0) = '/disable') and (Text <> '/disable disable') and (Text <> '/disable enable') then begin SetArrayLength(Disabled,GetArrayLength(Disabled) + 1); Disabled[GetArrayLength(Disabled) - 1] := Copy(Text,10,Length(Text)); end else if GetPiece(Text,' ',0) = '/enable' then begin Line := -1; for i := 0 to GetArrayLength(Disabled) - 1 do if Copy(Text,9,Length(Text)) = Disabled[i] then begin Line := i; Break; end; if Line <> -1 then begin for i := Line to GetArrayLength(Disabled) - 2 do Disabled[i] := Disabled[i + 1]; SetArrayLength(Disabled,GetArrayLength(Disabled) - 1); end; end;end;function OnPlayerCommand(ID: Byte; Text: string): boolean;var Allow: boolean; i: integer;begin Allow := true; for i := 0 to GetArrayLength(Disabled) - 1 do if Copy(Text,2,Length(Disabled[i])) = Disabled[i] then begin Allow := false; Break; end; if Allow then Result := false else Result := true;end;