Advertisement
Guest User

Frosty

a guest
Sep 1st, 2010
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 54.40 KB | None | 0 0
  1. const  
  2.  ClBad  = $FFFF44;  
  3.  ClGood = $EE00FF;
  4.  PredTime = 25;
  5.  RankDamageMult = 3;
  6. //cash constants
  7.  predat = 225;
  8.  teampred = 600;
  9.  serk = 200;
  10.  teamserk= 600;
  11.  nades = 3000;
  12.  ally = 30000;
  13.  holycross = 50000;
  14.  speed = 200;
  15.  teamspeed = 900;
  16.  flagtele = 1000;
  17.  turret = 30000;
  18.  
  19.      
  20. Type  
  21.  Stats = Record  
  22.  LongTime: Boolean;  
  23. TSec,Tmin,BTSec,BTMin: Integer;  
  24. end;
  25.  
  26. type TSection = record
  27.     Name: string;
  28.     Keys: array of string;
  29. end;
  30.  
  31. type TINIFile = record
  32.     Sections: array of TSection;
  33. end;
  34.  
  35. var
  36. ini: TINIFile;
  37. Cash,DEC,DECC,EBNN,EBNND,EBNNT,EBNNTT,EDMM,EDMMT,EDMMD,Tcash,i,i2:Integer;
  38. BonusID,ID,EBN,EBNM,ED,EDM,DED,Dude,DEXN,Bottoset,SetBotTeam:Byte;
  39. OBFLX,OBFLY,NBFLX,NBFLY,PlayerID:Integer;
  40. HC,Shop: Boolean;
  41. PStat: String;
  42. deathexp,HBFT,TA,NTB,NTA,NTAN,TP,greatgahooka,yeahyeah,speedster,Boolvar,holyshit,FlagCaptured,catchme,SoloChaser,QuitTeasin,waiting4bot:Array[1..32] of Boolean;
  43. Killnum,NFT,NKS,BKS,TFC,TTCash,LongestTime,ntTimer,ntfTimer,trKills,tna,TUPred,TNA,deKills,barKills,LKills,FKills,knKills,mpKills,SpeedTimer,DamCalc,KBZombie,Flaghold: Array[1..32] of Integer;
  44.  Player: Array[1..32] of Stats;  
  45.  TSec,Tmin,BTSec,BTMin,ntPosX,ntPosY,RankNum,RankDam,DamagePerc: Array[1..32] of Integer;
  46.  nTurretPos:Integer;
  47. Timer:Integer;  
  48. Dist:Single;
  49. iniPFile:String;
  50. Accname,BotOwner:Array [1..32] of String;
  51.  
  52. function xsplit(const source: string; const delimiter: string):TStringArray;
  53. var
  54.     i,x,d:integer;
  55.     s:string;
  56. begin
  57.     d:=length(delimiter);
  58.     x:=0;
  59.     i:=1;
  60.     SetArrayLength(Result,1);
  61.     while(i<=length(source)) do begin
  62.         s:=Copy(source,i,d);    
  63.             if(s=delimiter) then begin
  64.                 inc(i,d);      
  65.                 inc(x,1);
  66.                 SetArrayLength(result,x+1);
  67.             end else begin           
  68.                 result[x]:= result[x]+Copy(s,1,1);
  69.                 inc(i,1);
  70.         end;
  71.     end;
  72. end;
  73.  
  74. function iniLoad(FileName: string): TINIFile;
  75. var
  76.     iSections, iKeys, i: integer;
  77.     lines: TStringArray;
  78. begin
  79.     lines := xsplit(ReadFile(FileName), chr(13) + chr(10));
  80.  
  81.     iSections := 0;
  82.     iKeys := 0;
  83.  
  84.     for i := 0 to GetArrayLength(lines) - 1 do
  85.     begin
  86.         if Length(lines[i]) > 0 then
  87.         begin
  88.             if (lines[i][1] = '[') and (lines[i][Length(lines[i])] = ']') then
  89.             begin
  90.                 iSections := iSections + 1;
  91.                 iKeys := 0;
  92.                 SetArraylength(Result.Sections, iSections);
  93.                 Result.Sections[iSections - 1].Name := Copy(lines[i], 2, Length(lines[i]) - 2);
  94.             end
  95.             else if (iSections > 0) and (StrPos('=', lines[i]) > 0) then
  96.             begin
  97.                 iKeys := iKeys + 1;
  98.                 SetArrayLength(Result.Sections[iSections - 1].Keys, iKeys);
  99.                 Result.Sections[iSections - 1].Keys[iKeys - 1] := lines[i];
  100.             end;
  101.         end;
  102.     end;
  103. end;
  104.  
  105. procedure iniSave(FileName: string; iniFile: TINIFile);
  106. var
  107.     i, j: integer;
  108.     data: string;
  109. begin
  110.     for i := 0 to GetArrayLength(iniFile.Sections) - 1 do
  111.     begin
  112.         if Length(iniFile.Sections[i].Name) > 0 then
  113.         begin
  114.             data := data + '[' + iniFile.Sections[i].Name + ']' + chr(13) + chr(10);
  115.  
  116.             for j := 0 to GetArrayLength(iniFile.Sections[i].Keys) - 1 do
  117.                 if Length(iniFile.Sections[i].Keys[j]) > 0 then
  118.                     data := data + iniFile.Sections[i].Keys[j] + chr(13) + chr(10);
  119.  
  120.             if i < GetArrayLength(iniFile.Sections) - 1 then
  121.                 data := data + chr(13) + chr(10);
  122.         end;
  123.     end;
  124.  
  125.     WriteFile(FileName, data);
  126. end;
  127.  
  128. function iniGetValue(var iniFile: TINIFile; section, key, errorResult: string): string;
  129. var
  130.     i, j, idx: integer;
  131. begin
  132.     Result := errorResult;
  133.  
  134.     if StrPos('=', key) > 0 then
  135.     begin
  136.         WriteLn('Error: the key can''t contain the character ''='' (asshole)');
  137.         exit;
  138.     end;
  139.  
  140.     for i := 0 to GetArrayLength(iniFile.Sections) - 1 do
  141.     begin
  142.         if LowerCase(iniFile.Sections[i].Name) = LowerCase(section) then
  143.         begin
  144.             for j := 0 to GetArrayLength(iniFile.Sections[i].Keys) - 1 do
  145.             begin
  146.                 if GetPiece(iniFile.Sections[i].Keys[j], '=', 0) = key then
  147.                 begin
  148.                     idx := StrPos('=', iniFile.Sections[i].Keys[j]);
  149.                     Result := Copy(iniFile.Sections[i].Keys[j], idx + 1, Length(iniFile.Sections[i].Keys[j]));
  150.                     break;
  151.                 end;
  152.             end;
  153.             break;
  154.         end;
  155.     end;
  156. end;
  157.  
  158. procedure iniSetValue(var iniFile: TINIFile; section, key, value: string);
  159. var
  160.     i, j: integer;
  161.     sectionFound, keyFound: boolean;
  162. begin
  163.     if StrPos('=', key) > 0 then
  164.     begin
  165.         WriteLn('Error: the key can''t contain the character ''='' (asshole)');
  166.         exit;
  167.     end;
  168.  
  169.     sectionFound := false;
  170.     keyFound := false;
  171.  
  172.     for i := 0 to GetArrayLength(iniFile.Sections) - 1 do
  173.     begin
  174.         if LowerCase(iniFile.Sections[i].Name) = LowerCase(section) then
  175.         begin
  176.             sectionFound := true;
  177.  
  178.             for j := 0 to GetArrayLength(iniFile.Sections[i].Keys) - 1 do
  179.             begin
  180.                 if GetPiece(iniFile.Sections[i].Keys[j], '=', 0) = key then
  181.                 begin
  182.                     keyFound := true;
  183.                     iniFile.Sections[i].Keys[j] := key + '=' + value;
  184.                     break;
  185.                 end;
  186.             end;
  187.  
  188.             if keyFound = false then
  189.             begin
  190.                 j := GetArrayLength(iniFile.Sections[i].Keys);
  191.                 SetArrayLength(iniFile.Sections[i].Keys, j + 1);
  192.                 iniFile.Sections[i].Keys[j] := key + '=' + value;
  193.             end;
  194.  
  195.             break;
  196.         end;
  197.     end;
  198.  
  199.     if sectionFound = false then
  200.     begin
  201.         i := GetArrayLength(iniFile.Sections);
  202.         SetArrayLength(iniFile.Sections, i + 1);
  203.         iniFile.Sections[i].Name := section;
  204.  
  205.         SetArrayLength(iniFile.Sections[i].Keys, 1);
  206.         iniFile.Sections[i].Keys[0] := key + '=' + value;
  207.     end;
  208. end;
  209.  
  210. procedure iniDeleteSection(var iniFile: TINIFile; section: string);
  211. var
  212.     i: integer;
  213. begin
  214.     for i := 0 to GetArrayLength(iniFile.Sections) - 1 do
  215.     begin
  216.         if LowerCase(iniFile.Sections[i].Name) = LowerCase(section) then
  217.         begin
  218.             iniFile.Sections[i].Name := '';
  219.             break;
  220.         end;
  221.     end;
  222. end;
  223.  
  224. procedure iniDeleteKey(var iniFile: TINIFile; section, key: string);
  225. var
  226.     i, j: integer;
  227. begin
  228.     if StrPos('=', key) > 0 then
  229.     begin
  230.         WriteLn('Error: the key can''t contain the character ''='' (asshole)');
  231.         exit;
  232.     end;
  233.  
  234.     for i := 0 to GetArrayLength(iniFile.Sections) - 1 do
  235.     begin
  236.         if LowerCase(iniFile.Sections[i].Name) = LowerCase(section) then
  237.         begin
  238.             for j := 0 to GetArrayLength(iniFile.Sections[i].Keys) - 1 do
  239.             begin
  240.                 if GetPiece(iniFile.Sections[i].Keys[j], '=', 0) = key then
  241.                 begin
  242.                     iniFile.Sections[i].Keys[j] := '';
  243.                     break;
  244.                 end;
  245.             end;
  246.             break;
  247.         end;
  248.     end;
  249. end;
  250.  
  251. procedure iniWrite(FileName, section, key, value: string);
  252. var
  253.     iniFile: TINIFile;
  254. begin
  255.     iniFile := iniLoad(FileName);
  256.     iniSetValue(iniFile, section, key, value);
  257.     iniSave(FileName, iniFile);
  258. end;
  259.  
  260. Procedure ResetStats(ID:Byte);  
  261.  begin  
  262.       Player[ID].LongTime := false;  
  263.     end;  
  264.      
  265. Procedure CheckTime(ID:Byte);    
  266.     begin  
  267.    if Player[ID].BTMin > LongestTime[1] then begin  
  268.           LongestTime[1] := Player[ID].BTMin;  
  269.         LongestTime[2] := Player[ID].BTSec;  
  270.         Player[ID].LongTime := true;  
  271.             WriteConsole(0,IDToName(ID) + ' beats the record! His surviving time is ' + inttostr(Player[ID].BTMin) + ' minutes and ' + inttostr(Player[ID].BTSec) + ' seconds!', ClGood);  
  272.         end else begin  
  273.      if Player[ID].BTMin = LongestTime[1] then  
  274.               if Player[ID].BTSec > LongestTime[2] then begin  
  275.               LongestTime[1] := Player[ID].BTMin;  
  276.                 LongestTime[2] := Player[ID].BTSec;  
  277.                 Player[ID].LongTime := true;  
  278.                     WriteConsole(0,IDToName(ID) + ' beats the record! His surviving time is ' + inttostr(Player[ID].BTMin) + ' minutes and ' + inttostr(Player[ID].BTSec) + ' seconds!', ClGood);  
  279.                 end;      
  280.      end;        
  281.  end;  
  282.  
  283. procedure ForceAchUpdate(ID:Byte; Ach:String);
  284. begin
  285. if ReadINI('Players/'+Accname[ID]+'.ini','achievements',Ach,'*ERROR*') = '*ERROR*' then iniWrite('Players/'+Accname[ID]+'.ini','achievements',Ach,'0');
  286.       if ReadINI('Players/'+Accname[ID]+'.ini','achievements',Ach,'*ERROR while loading achievement*') = '1' then Boolvar[ID]:=True;
  287.       if ReadINI('Players/'+Accname[ID]+'.ini','achievements',Ach,'*ERROR while loading achievement*') = '0' then Boolvar[ID]:=False;
  288. end;
  289.  
  290. Procedure NewLogin(ID:Byte;Name,Pass:String);
  291. begin
  292.  iniPFile :='Players/'+Name+'.ini';
  293.       ini:=iniLoad(iniPFile);
  294.       //WriteFile('Players/'+Name+'.txt',Name+':'+GetPlayerStat(ID,'IP'));
  295.       WriteFile('Players/'+Name+'.ini','');
  296.       iniPFile :='Players/'+Name+'.ini';
  297.       ini:=iniLoad(iniPFile);
  298.       IniWrite(IniPFile,'stats','IP', GetPlayerStat(ID,'IP'));
  299.       IniWrite(IniPFile,'stats','user', Name);
  300.       IniWrite(IniPFile,'stats','pass', Pass);
  301.       IniWrite(IniPFile,'stats','reg', '1');
  302.       IniWrite(IniPFile,'stats','kills', '0');
  303.       iniWrite('Players/'+Name+'.ini','stats','rank','1');
  304.        iniWrite('Players/'+Name+'.ini','stats','ranknum','0');
  305.       iniWrite('Players/'+Name+'.ini','stats','class','1');
  306.       IniWrite(IniPFile,'stats','tna', '0');
  307.       IniWrite(IniPFile,'stats','barkills', '0');
  308.        iniWrite('Players/'+Name+'.ini','stats','tupred','0');
  309.       iniWrite('Players/'+Name+'.ini','achievements','TP','0');
  310.       iniWrite('Players/'+Name+'.ini','achievements','greatgahooka','0');
  311.       iniWrite('Players/'+Name+'.ini','achievements','yeahyeah','0');
  312.       iniWrite('Players/'+Name+'.ini','achievements','speedster','0');
  313.       iniWrite('Players/'+Name+'.ini','achievements','holyshit','0');
  314.       iniWrite('Players/'+Name+'.ini','achievements','catchme','0');
  315.       iniWrite('Players/'+Name+'.ini','achievements','solochaser','0');
  316.       iniWrite('Players/'+Name+'.ini','achievements','quitteasin','0');
  317.       WriteConsole(ID,'login system Activated, new user creation detected',$EE81FAA1);
  318.       WriteConsole(ID,'you have been registered as: '+Name+' and your password has been recorded as: '+Pass+'!',$EE81FAA1);
  319.       WriteConsole(ID,'Remember to login to your account when you join game',$EE81FAA1);
  320.       WriteConsole(ID,'otherwise your stats will be recorded to your starter acc',$EE81FAA1);
  321.       WriteConsole(ID,'you can create as many accs as you wish',$EE81FAA1);
  322.       WriteConsole(ID,'if you need a password reset send an email to snowman533@gmail.com',$EE81FAA1);
  323.       WriteConsole(ID,'remember to include your username in your email',$EE81FAA1);
  324.       WriteConsole(ID,'unauthorized requests will be ignored and will get you banned',$EE81FAA1);
  325.       WriteConsole(ID,'Now recording your stats to your new account',$EE81FAA1);
  326.       WriteConsole(ID,'enjoy your stay :D',$EE81FAA1);
  327.       WriteConsole(ID,'as you rank, your hits will become more powerful',$EE81FAA1);
  328.       //WriteConsole(ID,'Admin will be notified if:',$EE81FAA1)
  329.       //WriteConsole(ID,'you access this server from a different IP address using your current name',$EE81FAA1)
  330.       //WriteConsole(ID,'should you have changed computers or ISPs resulting in IP change',$EE81FAA1)
  331.       //WriteConsole(ID,'please contact admin: snowman533@gmail.com',$EE81FAA1)
  332. end;
  333.  
  334. procedure ExistingLogin(ID:Byte;Name:String);
  335. begin
  336.  //PStat:= Name+':'+GetPlayerStat(ID,'IP');
  337.       trKills[ID]:= strtoint(ReadINI('Players/'+Name+'.ini','stats','kills','0'));
  338.       iniPFile :='Players/'+Name+'.ini';
  339.       ini:=iniLoad(iniPFile);
  340.       barKills[ID]:=strtoint(ReadINI('Players/'+Name+'.ini','stats','barkills','0'));
  341.       RankNum[ID]:=strtoint(ReadINI('Players/'+Name+'.ini','stats','ranknum','0'));
  342.       ForceAchUpdate(ID, 'TP');
  343.       TP[ID]:=Boolvar[ID];
  344.       ForceAchUpdate(ID, 'greatgahooka');
  345.       greatgahooka[ID]:=Boolvar[ID]
  346.       ForceAchUpdate(ID, 'yeahyeah');
  347.       yeahyeah[ID]:=Boolvar[ID];
  348.       ForceAchUpdate(ID, 'speedster');
  349.       speedster[ID]:=Boolvar[ID];
  350.       TNA[ID]:=strtoint(ReadINI('Players/'+Name+'.ini','stats','tna','0'));
  351.       DamagePerc[ID]:=(RankNum[ID]*RankDamageMult)+tna[ID];
  352.       ForceAchUpdate(ID, 'holyshit');
  353.       holyshit[ID]:=Boolvar[ID];
  354.       ForceAchUpdate(ID, 'catchme');
  355.       catchme[ID]:=Boolvar[ID];
  356.       ForceAchUpdate(ID, 'solochaser');
  357.       SoloChaser[ID]:=Boolvar[ID];
  358.       ForceAchUpdate(ID, 'quitteasin');
  359.       QuitTeasin[ID]:=Boolvar[ID];
  360. end;
  361.  
  362. procedure Nova(const X,Y,speed,decentralize,power: single; ID,style: byte; n: integer);
  363. var i: integer;
  364.   angle: single;
  365. begin
  366.   angle := 2*pi/n;
  367.   for i:=0 to n do
  368.     CreateBullet(X+cos(angle*i)*decentralize, Y+sin(angle*i)*decentralize, cos(angle*i)*speed, sin(angle*i)*speed, power,style , ID );
  369. end;
  370.  
  371. procedure Achievement(ID:Byte; BroadcastAch, WriteAch:String);
  372. begin
  373.   WriteConsole(ID,BroadcastAch+'!',$EE81FAA1);
  374.       WriteConsole(0,IdtoName(ID)+' has just completed the "'+BroadcastAch+'" achievement',$EE81FAA1);
  375.       WriteConsole(0,'and has earned 500 Cash + 1% DO as an achievement bonus',$EE81FAA1);
  376.       Cash:=Cash+500;
  377.       TNA[ID]:=TNA[ID]+1;
  378.       iniWrite('Players/'+Accname[ID]+'.ini','stats','tna',inttostr(TNA[ID]));
  379.       iniWrite('Players/'+Accname[ID]+'.ini','achievements',WriteAch,'1');
  380.       iniWrite('Players/'+Accname[ID]+'.ini','stats','tupred',inttostr(TUPred[ID]));
  381.       iniWrite('Players/'+Accname[ID]+'.ini','stats','barkills',inttostr(barKills[ID]));
  382. end;
  383.  
  384. procedure Shoot(x, y, x2, y2, speed, dmg: single; style, owner: byte);
  385. var dist: single;
  386. begin
  387.  dist := Distance(x, y, x2, y2) / speed;
  388.  x2 := (x2 - x) / dist;
  389.  y2 := (y2 - y) / dist;
  390.  createbullet(x, y, x2, y2, dmg, style, owner);
  391. end;
  392.  
  393. Procedure Setstats();
  394. begin
  395.   BonusID:=4;
  396.   //Cash:=0;
  397.   DEC:=3000;
  398.   EBN:=2;
  399.   EBNM:=1;
  400.   EDM:=1;
  401.   DED:=47;
  402.   Bottoset:=2;
  403.   DEXN:=1;
  404.   EBNN:=EBN*30;
  405.   EBNNTT:=45;
  406.   EBNNT:=EBNN/3;
  407.   EBNND:=EBNNT*2;
  408.   EDMM:=DED*EDM;
  409.   EDMMT:=EDMM/3;
  410.   EDMMD:=EDMMT*2;
  411.   SetBotTeam:=1;
  412.         OBFLX:=GetSpawnStat(6,'x');
  413.         OBFLY:=GetSpawnStat(6,'x');
  414.  Timer:= 300;
  415.  for i:= 1 to 32 do begin
  416.  if Getplayerstat(i,'Ping') > 0 then begin
  417.   trKills[i]:=strtoint(ReadINI('Players/'+IDtoname(i)+'.ini','stats','kills','0'));
  418.   TNA[i]:=strtoint(ReadINI('Players/'+IDtoname(i)+'.ini','stats','tna','0'));
  419.   TUPred[i]:=strtoint(ReadINI('Players/'+IDtoname(i)+'.ini','stats','tupred','0'));
  420.   RankNum[i]:=strtoint(ReadINI('Players/'+IDtoname(i)+'.ini','stats','ranknum','0'));
  421.   end;
  422.   end;
  423. end;
  424.  
  425. function CheckPlayerAdmin(ID:Byte):Boolean;
  426. begin
  427. if ReadINI('Players/'+IDtoname(ID)+'.ini','stats','admin','0') = '1' then Result:=True;
  428. end;
  429.  
  430. procedure ActivateServer();
  431. begin
  432.   Setstats();
  433.   Cash := strtoint(ReadINI('scripts/Shop/profit.ini','profit','cash','0'));
  434.   for i:= 1 to 32 do begin
  435.      ForceAchUpdate(i, 'TP');
  436.       TP[i]:=Boolvar[i];
  437.       ForceAchUpdate(i, 'greatgahooka');
  438.       greatgahooka[i]:=Boolvar[i]
  439.       ForceAchUpdate(i, 'yeahyeah');
  440.       yeahyeah[i]:=Boolvar[i];
  441.       ForceAchUpdate(i, 'speedster');
  442.       speedster[i]:=Boolvar[i];
  443. end;
  444.       if ReadINI('scripts/Shop/profit.ini','script','shop','*ERROR*') = '1' then shop := True;
  445.       if ReadINI('scripts/Shop/profit.ini','script','shop','*ERROR*') = '0' then shop := False;
  446. end;
  447.  
  448. function OnPlayerCommand(ID: Byte; Text: string): boolean;
  449. begin
  450.   if Lowercase(Text) = '/save' then begin
  451.       Writeconsole(ID,'Saved all accs, thanks for helping',$0000FFFF);
  452.     //Command('/save');
  453.    for i:= 1 to 32 do if Getplayerstat(i,'Ping') > 0 then begin
  454.    iniWrite('Players/'+Accname[i]+'.ini','stats','kills',inttostr(trKills[i]));
  455.    iniWrite('Players/'+Accname[i]+'.ini','stats','tupred',inttostr(TUPred[i]));
  456.    iniWrite('Players/'+Accname[i]+'.ini','stats','barkills',inttostr(barKills[i]));
  457.    iniWrite('Players/'+Accname[i]+'.ini','stats','ranknum',inttostr(RankNum[i]));
  458.    end;
  459.    iniWrite('scripts/Shop/profit.ini','profit','cash',inttostr(Cash));
  460.     if TP[ID] = False then begin
  461.     Achievement(ID,'Team Mate', 'TP');
  462.       TP[ID]:=True;
  463.     end;
  464.   end;
  465.  
  466.   if Lowercase(Text) = '/char' then begin
  467.     TNA[ID]:=strtoint(ReadINI('Players/'+Accname[ID]+'.ini','stats','tna','0'));
  468.     DamagePerc[ID]:=(RankNum[ID]*RankDamageMult)+tna[ID];
  469.     if checkplayeradmin(ID) = True then DamagePerc[ID]:=DamagePerc[ID]+10;
  470.     WriteConsole(ID,'Your stats',$EE81FAA1);
  471.     WriteConsole(ID,'Total Kills: '+inttostr(trKills[ID])+'!',$EE81FAA1);
  472.     WriteConsole(ID,'Rank: '+ReadINI('Players/'+Accname[ID]+'.ini','stats','rank','*ERROR while loading rank*')+'!',$EE81FAA1);
  473.     WriteConsole(ID,'Class: '+ReadINI('Players/'+Accname[ID]+'.ini','stats','class','*ERROR while loading class*')+'!',$EE81FAA1);
  474.     WriteConsole(ID,'Total Barret Kills: '+inttostr(barKills[ID])+'!',$EE81FAA1);
  475.     WriteConsole(ID,'Total number of Predators used: '+inttostr(TUPred[ID])+'!',$EE81FAA1);
  476.     WriteConsole(ID,'Total number of Achievements: '+ReadINI('Players/'+Accname[ID]+'.ini','stats','tna','*ERROR while loading achievements*')+'!',$EE81FAA1);
  477.     WriteConsole(ID,'Damage Output: +'+inttostr(DamagePerc[ID])+'%!',$EE81FAA1);
  478.   end;
  479.  
  480.  if shop = True then begin  
  481.  
  482.     if Lowercase(Text) = '/cash' then begin
  483.         WriteConsole(0,IdtoName(ID)+' has just requested Cash levels!',$EE81FAA1);
  484.     WriteConsole(0,'Global Player Cash: '+inttostr(Cash),$EE81FAA1);
  485.     end;
  486.  
  487. if Lowercase(Text) = '/buy pred' then begin    
  488.    if Cash < 200 then begin
  489.        WriteConsole(0,IdtoName(ID)+' just tried to purchase predator, not enough funds!',$EE81FAA1);    
  490.    end;    
  491.    if Cash >= 200 then begin    
  492.        Cash :=Cash-200;    
  493.        WriteConsole(0,IdtoName(ID)+' has just bought predator for 200 Cash',$EE81FAA1);  
  494.        GiveBonus(ID, 1);    
  495.        SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),20);    
  496.     TUPred[ID]:=TUPred[ID]+1;    
  497.    end;    
  498.   end;
  499.    
  500.     if Lowercase(Text) = '/buy tpred' then begin
  501.         if Cash < 600 then begin
  502.             WriteConsole(0,IdtoName(ID)+' just tried to purchase Team Predator, not enough funds!',$EE81FAA1);
  503.         end;
  504.         if Cash >= 600 then begin
  505.             Cash :=Cash-600;
  506.             WriteConsole(0,IdtoName(ID)+' has just bought Team Predator for 600 Cash',$EE81FAA1);
  507.             for i := 1 to 32 do
  508.             begin
  509.                 if GetPlayerStat(i,'Team') = 1 then if GetPlayerStat(i,'Alive') = true then
  510.                 begin
  511.                     GiveBonus(i, 1);
  512.           TUPred[ID]:=TUPred[ID]+1;
  513.                 end;
  514.             end;
  515.         end;
  516.   end;
  517.  
  518.     if Lowercase(Text) = '/buy serk' then begin
  519.         if Cash < 195 then begin
  520.             WriteConsole(0,IdtoName(ID)+' just tried to purchase berserker, not enough funds!',$EE81FAA1);
  521.         end;
  522.         if Cash >= 195 then begin
  523.             Cash :=Cash-195;
  524.             WriteConsole(0,IdtoName(ID)+' has just bought berserker for 195 Cash',$EE81FAA1);
  525.             GiveBonus(ID, 2);
  526.         end;
  527.     end;
  528.  
  529.              if Lowercase(Text) = '/buy bes' then begin
  530.         if Cash < 200 then begin
  531.             WriteConsole(0,IdtoName(ID)+' just tried to purchase The Beserker, not enough funds!',$EE81FAA1);
  532.         end;
  533.         if Cash >= 200 then begin
  534.             Cash :=Cash-200;
  535.             WriteConsole(0,IdtoName(ID)+' has just bought Beserker for 600 Cash',$EE81FAA1);
  536.             GiveBonus(i, 2);
  537.         end;
  538.   end;
  539.    
  540.     if Lowercase(Text) = '/buy tbes' then begin
  541.         if Cash < 600 then begin
  542.             WriteConsole(0,IdtoName(ID)+' just tried to purchase Team Beserker, not enough funds!',$EE81FAA1);
  543.         end;
  544.         if Cash >= 600 then begin
  545.             Cash :=Cash-600;
  546.             WriteConsole(0,IdtoName(ID)+' has just bought Team Beserker for 600 Cash',$EE81FAA1);
  547.             for i := 1 to 32 do
  548.             begin
  549.                 if GetPlayerStat(i,'Team') = 1 then if GetPlayerStat(i,'Alive') = true then
  550.                 begin
  551.                     GiveBonus(i, 2);
  552.                 end;
  553.             end;
  554.         end;
  555.   end;
  556.  
  557.     if Lowercase(Text) = '/buy clusters' then begin
  558.         if Cash < 3000 then begin
  559.             If BonusID <> 5 then begin
  560.                 WriteConsole(0,IdtoName(ID)+' just tried to purchase the clusters, not enough funds!',$EE81FAA1);
  561.             end;
  562.         end;
  563.         if BonusID = 5 then begin
  564.             WriteConsole(ID,'cluster grenades are already in affect, try normal nades!',$EE81FAA1);
  565.         end;
  566.         if Cash >= 3000 then begin
  567.             If BonusID <> 5 then begin
  568.                 Cash :=Cash-3000;
  569.                 BonusID:=5;
  570.                 WriteConsole(0,IdtoName(ID)+' has just bought the cluster grenade upgrade for 3000 Cash',$EE81FAA1);
  571.                 GiveBonus(ID,BonusID);
  572.             end;
  573.         end;
  574.     end;
  575.  
  576.     if Lowercase(Text) = '/buy nades' then begin
  577.         if Cash < 3000 then begin
  578.             If BonusID <> 4 then begin
  579.                 WriteConsole(0,IdtoName(ID)+' just tried to purchase the nades, not enough funds!',$EE81FAA1);
  580.             end;
  581.         end;
  582.         if BonusID = 4 then begin
  583.             WriteConsole(ID,'regular grenades are already in affect, try clusters!',$EE81FAA1);
  584.         end;
  585.         if Cash >= 3000 then begin
  586.             If BonusID <> 4 then begin
  587.                 Cash :=Cash-3000;
  588.                 BonusID:=4;
  589.                 WriteConsole(0,IdtoName(ID)+' has just bought the regular grenade upgrade for 3000 Cash',$EE81FAA1);
  590.                 GiveBonus(ID,BonusID);
  591.             end;
  592.         end;
  593.     end;
  594.  
  595.     if Lowercase(Text) = '/buy dex' then begin
  596.         if Cash < DEC then begin
  597.             WriteConsole(0,IdtoName(ID)+' just tried to purchase bigger bangs, not enough funds!',$EE81FAA1);
  598.         end;
  599.         if Cash >= DEC then begin
  600.             EBNM :=EBNM+1;
  601.             EBN :=3*EBNM;
  602.             EDM :=EDM+1;
  603.             ED := (5*EDM)+ED;
  604.             DEXN :=DEXN+1;
  605.             WriteConsole(0,IdtoName(ID)+' has just bought bigger bangs for '+inttostr(DEC)+' Cash',$EE81FAA1);
  606.             Cash :=Cash-DEC;
  607.             DECC :=DEC/3;
  608.             DEC :=(DEC+DECC)*3;
  609.         end;
  610.     end;
  611.  
  612.     if Lowercase(Text) = '/buy ally' then begin
  613.         if Cash < 30000 then begin
  614.             WriteConsole(0,IdtoName(ID)+' just tried to purchase an ally, not enough funds!',$EE81FAA1);
  615.         end;
  616.         if Cash >= 30000 then begin
  617.             Cash :=Cash-30000;
  618.             WriteConsole(0,IdtoName(ID)+' has just bought an ally for 30000 Cash',$EE81FAA1);
  619.             Command('/setteam1 '+IntToStr(Bottoset));
  620.             Bottoset:=Bottoset+1;
  621.         end;
  622.     end;
  623.  
  624.     if Lowercase(Text) = '/buy holycross' then begin
  625.         if Cash < 30000 then begin
  626.             WriteConsole(0,IdtoName(ID)+' just tried to purchase Holy Cross, not enough funds!',$EE81FAA1);
  627.         end;
  628.         if Cash >= 30000 then begin
  629.             HC:=true;
  630.             WriteConsole(0,IdtoName(ID)+' has just bought Holy Cross for 30000 Cash',$EE81FAA1);
  631.             Cash:=Cash-30000;
  632.         end;
  633.     end;
  634.    
  635.     if Lowercase(Text) = '/buy speed' then begin
  636.         if Cash < predat then begin
  637.             WriteConsole(0,IdtoName(ID)+' just tried to purchase the speed gun, not enough funds!',$EE81FAA1);
  638.         end;
  639.         if Cash >= predat then begin
  640.             WriteConsole(0,IdtoName(ID)+' has just bought the speed gun for '+inttostr(predat)+' Cash',$EE81FAA1);
  641.             WriteConsole(ID,'Server PM: '+IdtoName(ID)+': remember, when you die, you lose the gun',$EE81FAA1);
  642.             WriteConsole(ID,'Server PM: so use it wisely',$EE81FAA1);
  643.             Cash:=Cash-predat;
  644.             SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),18);
  645.         end;
  646.     end;
  647.    
  648.     if Lowercase(Text) = '/buy tspeed' then begin
  649.         if Cash < 900 then begin
  650.             WriteConsole(0,IdtoName(ID)+' just tried to purchase Team Speed, not enough funds!',$EE81FAA1);
  651.         end;
  652.         if Cash >= 900 then begin
  653.             Cash :=Cash-900;
  654.             WriteConsole(0,IdtoName(ID)+' has just bought Team Speed for 300 Cash',$EE81FAA1);
  655.             for i := 1 to 32 do
  656.             begin
  657.                 if GetPlayerStat(i,'Team') = 1 then if GetPlayerStat(i,'Alive') = true then
  658.                 begin
  659.                     SpawnObject(GetPlayerStat(i,'x'),GetPlayerStat(i,'y'),18);
  660.                 end;
  661.             end;
  662.         end;
  663.   end;
  664.  
  665.         if Lowercase(Text) = '/buy ftp' then begin
  666.         if Cash < 10000 then begin
  667.             WriteConsole(0,IdtoName(ID)+' just tried to purchase a Flag Teleport, not enough funds!',$EE81FAA1);
  668.         end;
  669.         if Cash >= 10000 then begin
  670.             Cash :=Cash-10000;
  671.             WriteConsole(0,IdtoName(ID)+' has just bought a Flag Teleport for 10000 Cash',$EE81FAA1);
  672.                         NFT[ID]:=NFT[ID]+1;
  673.                         WriteConsole(ID,'You now have '+inttostr(NFT[ID])+' teleports!',$EE81FAA1);
  674.         end;
  675.     end;
  676.  
  677.         if Lowercase(Text) = '/buy turret' then begin
  678.         if Cash < 30000 then begin
  679.             WriteConsole(0,IdtoName(ID)+' just tried to purchase a Turret, not enough funds!',$EE81FAA1);
  680.         end;
  681.         if Cash >= 30000 then begin
  682.                         SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y')-15,15);
  683.             Cash :=Cash-30000;
  684.             WriteConsole(0,IdtoName(ID)+' has just bought a Turret for 30000 Cash',$EE81FAA1)
  685.         end;
  686.     end;
  687.  
  688. if Lowercase(Text) = '/buy nuke turret' then begin
  689.         if Cash < 50000 then begin
  690.             WriteConsole(0,IdtoName(ID)+' just tried to purchase a Nuke Turret, not enough funds!',$EE81FAA1);
  691.         end;
  692.         if Cash >= 50000 then begin
  693.       SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y')-15,15);
  694.       ntPosX[ID]:=GetPlayerStat(ID,'x');
  695.       ntPosY[ID]:=GetPlayerStat(ID,'y');
  696.       ntTimer[ID]:= 10;
  697.       NTB[ID]:=True;
  698.             Cash :=Cash-50000;
  699.             WriteConsole(0,IdtoName(ID)+' has just bought a Nuke Turret for 50000 Cash',$EE81FAA1);
  700.       WriteConsole(ID,'Arming...stay close to arm it!',$EE81FAA1);
  701.         end;
  702.     end;  
  703.  
  704.      if Lowercase(Text) = '/buy assassin' then begin
  705.         waiting4bot[ID]:=True;
  706.         for i := 1 to 32 do begin
  707.           if idtoname(i) = 'Mr.Zombie' then begin
  708.             Command('/kick '+inttostr(i));
  709.             break;
  710.           end;
  711.         end;
  712.         Command('/addbot1 MRZOMBIEA');
  713.      end;
  714.  
  715.     if Lowercase(Text) = '/items' then begin
  716.         WriteConsole(0,'/buy pred - gives u pred bonus - '+inttostr(predat)+' cash',$EE81FAA1);
  717.         WriteConsole(0,'/buy tpred - gives all Alpha team pred bonus - 600 cash',$EE81FAA1);
  718.         WriteConsole(0,'/buy serk - gives u berserker bonus - 195 cash',$EE81FAA1);
  719.         WriteConsole(0,'/buy tbes - gives all Alpha team berserker bonus - 600 cash',$EE81FAA1);
  720.         WriteConsole(0,'/buy clusters - upgrades your nade bonus to clusters - 3000 cash',$EE81FAA1);
  721.         WriteConsole(0,'/buy nades - upgrades your cluster bonus to nades - 3000 cash',$EE81FAA1);
  722.         WriteConsole(0,'---->grenade upgrades affects whole team',$EE81FAA1);
  723.         WriteConsole(0,'/buy dex - upgrades normal death explosion size - '+inttostr(DEC)+' Cash',$EE81FAA1);
  724.         WriteConsole(0,'---->does not affect suicides',$EE81FAA1);
  725.         WriteConsole(0,'/buy holycross - Kills all zombies on Red Team score - 30000 cash',$EE81FAA1);
  726.         WriteConsole(0,'/buy ally - brainwash a zombie to join Alpha team - 30000 cash',$EE81FAA1);
  727.         WriteConsole(0,'/buy speed - gives you the flamer gun - 225 cash',$EE81FAA1);
  728.         WriteConsole(0,'/buy tspeed - gives all Alpha team the flamer gun - 900 cash',$EE81FAA1);
  729.                 WriteConsole(0,'/buy FTP - Teleports you to your flag on grab of other - 10000 cash',$EE81FAA1);
  730.                 WriteConsole(0,'/buy turret - gives you a turret - 30000 cash',$EE81FAA1);
  731.     end;
  732.  
  733.   if Lowercase(Text) = '/dex on' then begin
  734.     deathexp[ID]:=True;
  735.     WriteConsole(ID,'Death explosions enabled for your ID, have fun',$EE81FAA1);
  736.     WriteConsole(ID,'consider others, before you leave please use /dex off',$EE81FAA1);
  737.   end;
  738.  
  739.   if Lowercase(Text) = '/dex off' then begin
  740.     deathexp[ID]:=False;
  741.     WriteConsole(ID,'Death explosions disabled for your ID, I hope you enjoyed it',$EE81FAA1);
  742.   end;
  743.  end;
  744.  
  745. if GetPiece(Text,' ',0) = '/create' then begin
  746.   NewLogin(ID, GetPiece(Text,' ',1),GetPiece(Text,' ',2));
  747. end;
  748.  
  749. if GetPiece(Text,' ',0) = '/login' then begin
  750.   if FileExists('Players/'+GetPiece(Text,' ',1)+'.ini') = False then WriteConsole(ID,'This username does not exist or is incorrect, please try again',$EE81FAA1);
  751.   if FileExists('Players/'+GetPiece(Text,' ',1)+'.ini') then begin
  752.     if GetPiece(Text,' ',2) <> ReadINI('Players/'+GetPiece(Text,' ',1)+'.ini','stats','pass','*ERROR*') then WriteConsole(ID,'This password is incorrect, please try again',$EE81FAA1);
  753.     if GetPiece(Text,' ',2) = ReadINI('Players/'+GetPiece(Text,' ',1)+'.ini','stats','pass','*ERROR*') then begin
  754.       Accname[ID]:= GetPiece(Text,' ',1);
  755.       WriteConsole(ID,'Login Successful, Welcome Back '+GetPiece(Text,' ',1)+'!',$EE81FAA1);
  756.       ExistingLogin(ID,Accname[ID]);
  757.     end;
  758.   end;
  759. end;  
  760. end;
  761.  
  762. procedure OnMapChange(NewMap: string);
  763. begin
  764. for i:= 1 to 32 do if Getplayerstat(i,'Ping') > 0 then iniWrite('Players/'+GetPlayerStat(i,'Name')+'.ini','stats','kills',inttostr(trKills[i]));
  765. for i:= 1 to 32 do begin
  766. TFC[i]:=0;
  767. BKS[i]:=0;
  768. NKS[i]:=0;
  769. NTB[i]:=False;
  770. ntTimer[i]:=0;
  771. ntfTimer[i]:=0;
  772. KBZombie[i]:=0;
  773. iniPFile :='Players/'+Accname[i]+'.ini';
  774. IniWrite(IniPFile,'stats','kills', inttostr(trKills[i]));
  775. iniWrite('Players/'+Accname[i]+'.ini','stats','barkills',inttostr(barKills[i]));
  776. iniWrite('scripts/Shop/profit.ini','profit','cash',inttostr(Cash));
  777. iniWrite('Players/'+Accname[i]+'.ini','stats','ranknum',inttostr(RankNum[i]));
  778. end;
  779. OBFLX:=GetSpawnStat(6,'x');
  780. OBFLY:=GetSpawnStat(6,'x');
  781.     For i := 1 to 32 do
  782.         begin
  783.         if shop = true then GiveBonus(i, BonusID);
  784.     end;
  785.   Tcash:=0;
  786. end;
  787.  
  788. procedure OnPlayerRespawn(ID: byte);
  789. begin
  790.     if shop = true then GiveBonus(ID,BonusID);
  791. end;
  792.  
  793. Procedure NewPlayer(ID:Byte);
  794. begin
  795.  iniPFile :='Players/'+IDtoname(ID)+'.ini';
  796.       ini:=iniLoad(iniPFile);
  797.       //WriteFile('Players/'+GetPlayerStat(ID,'Name')+'.txt',IDtoname(ID)+':'+GetPlayerStat(ID,'IP'));
  798.       WriteFile('Players/'+IDtoname(ID)+'.ini','');
  799.       iniPFile :='Players/'+IDtoname(ID)+'.ini';
  800.       ini:=iniLoad(iniPFile);
  801.       IniWrite(IniPFile,'stats','IP', GetPlayerStat(ID,'IP'));
  802.       IniWrite(IniPFile,'stats','reg', '1');
  803.       IniWrite(IniPFile,'stats','kills', '0');
  804.       iniWrite('Players/'+IDtoname(ID)+'.ini','stats','rank','1');
  805.        iniWrite('Players/'+IDtoname(ID)+'.ini','stats','ranknum','0');
  806.       iniWrite('Players/'+IDtoname(ID)+'.ini','stats','class','1');
  807.       IniWrite(IniPFile,'stats','tna', '0');
  808.       IniWrite(IniPFile,'stats','barkills', '0');
  809.        iniWrite('Players/'+IDtoname(ID)+'.ini','stats','tupred','0');
  810.       iniWrite('Players/'+IDtoname(ID)+'.ini','achievements','TP','0');
  811.       iniWrite('Players/'+IDtoname(ID)+'.ini','achievements','greatgahooka','0');
  812.       iniWrite('Players/'+IDtoname(ID)+'.ini','achievements','yeahyeah','0');
  813.       iniWrite('Players/'+IDtoname(ID)+'.ini','achievements','speedster','0');
  814.       iniWrite('Players/'+IDtoname(ID)+'.ini','achievements','holyshit','0');
  815.       iniWrite('Players/'+IDtoname(ID)+'.ini','achievements','catchme','0');
  816.       iniWrite('Players/'+IDtoname(ID)+'.ini','achievements','solochaser','0');
  817.       iniWrite('Players/'+IDtoname(ID)+'.ini','achievements','quitteasin','0');
  818.       WriteConsole(ID,'Automated login system Activated, new/unregistered user detected',$EE81FAA1);
  819.       WriteConsole(ID,'Welcome '+idtoname(ID)+'!',$EE81FAA1);
  820.       WriteConsole(ID,'Your player name has been registered to your IP: '+getplayerstat(ID,'IP'),$EE81FAA1);
  821.       WriteConsole(ID,'should you need to change your name, ie add clan tags:',$EE81FAA1);
  822.       WriteConsole(ID,'admin will update your registration details',$EE81FAA1);
  823.       WriteConsole(ID,'remember you are allowed 3 different player names before being kicked',$EE81FAA1);
  824.       WriteConsole(ID,'Beginning stats collection for your account',$EE81FAA1);
  825.       WriteConsole(ID,'use !stats to see your current player stats',$EE81FAA1);
  826.       WriteConsole(ID,'You will now receive achievements',$EE81FAA1);
  827.       WriteConsole(ID,'enjoy your stay :D',$EE81FAA1);
  828.       WriteConsole(ID,'as you rank, your hits will become more powerful',$EE81FAA1);
  829.       //WriteConsole(ID,'Admin will be notified if:',$EE81FAA1)
  830.       //WriteConsole(ID,'you access this server from a different IP address using your current name',$EE81FAA1)
  831.       //WriteConsole(ID,'should you have changed computers or ISPs resulting in IP change',$EE81FAA1)
  832.       //WriteConsole(ID,'please contact admin: snowman533@gmail.com',$EE81FAA1)
  833. end;
  834.  
  835. procedure ExistingPlayer(ID:Byte);
  836. begin
  837.  //PStat:= Idtoname(id)+':'+GetPlayerStat(ID,'IP');
  838.       trKills[ID]:= strtoint(ReadINI('Players/'+IDtoname(ID)+'.ini','stats','kills','0'));
  839.       WriteConsole(ID,'Automated Login System Activated',$EE81FAA1);
  840.       WriteConsole(ID,'Welcome back '+idtoname(ID)+'!',$EE81FAA1);
  841.       iniPFile :='Players/'+IDtoname(ID)+'.ini';
  842.       ini:=iniLoad(iniPFile);
  843.       barKills[ID]:=strtoint(ReadINI('Players/'+IDtoname(ID)+'.ini','stats','barkills','0'));
  844.       RankNum[ID]:=strtoint(ReadINI('Players/'+IDtoname(ID)+'.ini','stats','ranknum','0'));
  845.       ForceAchUpdate(ID, 'TP');
  846.       TP[ID]:=Boolvar[ID];
  847.       //if ReadINI('Players/'+IDtoname(ID)+'.ini','achievements','TP','*ERROR*') = '*ERROR*' then iniWrite('Players/'+IDtoname(ID)+'.ini','achievements','TP','0');
  848.       //if ReadINI('Players/'+IDtoname(ID)+'.ini','achievements','TP','*ERROR while loading achievement*') = '1' then TP[ID]:=True;
  849.       //if ReadINI('Players/'+IDtoname(ID)+'.ini','achievements','TP','*ERROR while loading achievement*') = '0' then TP[ID]:=False;
  850.       ForceAchUpdate(ID, 'greatgahooka');
  851.       greatgahooka[ID]:=Boolvar[ID]
  852.       //if ReadINI('Players/'+IDtoname(ID)+'.ini','achievements','greatgahooka','*ERROR*') = '*ERROR*' then iniWrite('Players/'+IDtoname(ID)+'.ini','achievements','greatgahooka','0');
  853.       //if ReadINI('Players/'+IDtoname(ID)+'.ini','achievements','greatgahooka','*ERROR while loading achievement*') = '1' then greatgahooka[ID]:=True;
  854.       //if ReadINI('Players/'+IDtoname(ID)+'.ini','achievements','greatgahooka','*ERROR while loading achievement*') = '0' then greatgahooka[ID]:=False;
  855.       ForceAchUpdate(ID, 'yeahyeah');
  856.       yeahyeah[ID]:=Boolvar[ID];
  857.       //if ReadINI('Players/'+IDtoname(ID)+'.ini','achievements','yeahyeah','*ERROR*') = '*ERROR*' then iniWrite('Players/'+IDtoname(ID)+'.ini','achievements','yeahyeah','0');
  858.       //if ReadINI('Players/'+IDtoname(ID)+'.ini','achievements','yeahyeah','*ERROR while loading achievement*') = '1' then yeahyeah[ID]:=True;
  859.       //if ReadINI('Players/'+IDtoname(ID)+'.ini','achievements','yeahyeah','*ERROR while loading achievement*') = '0' then yeahyeah[ID]:=False;
  860.       ForceAchUpdate(ID, 'speedster');
  861.       speedster[ID]:=Boolvar[ID];
  862.       //if ReadINI('Players/'+IDtoname(ID)+'.ini','achievements','speedster','*ERROR*') = '*ERROR*' then iniWrite('Players/'+IDtoname(ID)+'.ini','achievements','speedster','0');
  863.       //if ReadINI('Players/'+IDtoname(ID)+'.ini','achievements','speedster','*ERROR while loading achievement*') = '1' then speedster[ID]:=True;
  864.       //if ReadINI('Players/'+IDtoname(ID)+'.ini','achievements','speedster','*ERROR while loading achievement*') = '0' then speedster[ID]:=False;
  865.       TNA[ID]:=strtoint(ReadINI('Players/'+IDtoname(i)+'.ini','stats','tna','0'));
  866.       DamagePerc[ID]:=(RankNum[ID]*RankDamageMult)+tna[ID];
  867.       ForceAchUpdate(ID, 'holyshit');
  868.       holyshit[ID]:=Boolvar[ID];
  869.       ForceAchUpdate(ID, 'catchme');
  870.       catchme[ID]:=Boolvar[ID];
  871.       ForceAchUpdate(ID, 'solochaser');
  872.       SoloChaser[ID]:=Boolvar[ID];
  873.       ForceAchUpdate(ID, 'quitteasin');
  874.       QuitTeasin[ID]:=Boolvar[ID];
  875. end;
  876.  
  877. procedure OnJoinTeam(ID, Team: byte);
  878. begin
  879. if idtoname(ID) = '[Assassin]Mr.Zombie' then begin
  880.   for i:=1 to 32 do begin
  881.     if waiting4bot[i] = True then begin
  882.       BotOwner[ID]:= idtoname(i);
  883.       waiting4bot[i]:= False;
  884.       break;
  885.     end;
  886.   end;
  887. end;
  888.  
  889.   if Team = 1 then begin
  890.     if FileExists('Players/'+IDtoname(ID)+'.ini') then begin
  891.      ExistingPlayer(ID);
  892.      Accname[ID] := idtoname(ID);
  893.     end;
  894.  
  895.     if FileExists('Players/'+IDtoname(ID)+'.ini') = False then begin
  896.     NewPlayer(ID);
  897.       if shop = true then GiveBonus(ID, BonusID);
  898.     end;
  899.   end;
  900. end;
  901.  
  902. Procedure OnJoinGame(ID,Team:Byte);
  903.  begin  
  904.       ResetStats(ID);  
  905.     end;  
  906.  
  907. procedure UpdateCharVars();
  908. begin
  909. for i := 1 to 32 do
  910.     begin
  911.       if GetPlayerStat(i,'Human') = true then begin
  912.         BKS[i]:= BKS[i];
  913.          Cash:=Cash+(Killnum[i]*BKS[i]);
  914.         TTCash[i]:=Killnum[i]*BKS[i];
  915.         WriteConsole(i,'Match Bonus!',$EE81FAA1);
  916.         WriteConsole(i,'Your performance this map:',$EE81FAA1);
  917.         WriteConsole(i,'Total Kills: '+Inttostr(Killnum[i])+'!',$EE81FAA1);
  918.         WriteConsole(i,'Total Flag Scores: '+inttostr(TFC[i])+'!',$EE81FAA1);
  919.         WriteConsole(i,'Best Kill-Streak: '+inttostr(BKS[i])+'!',$EE81FAA1);
  920.         WriteConsole(i,'Longest Time Survived: '+inttostr(BTMin[i])+':'+inttostr(BTSec[i])+' (M:S)!',$EE81FAA1);
  921.         if shop = true then begin
  922.           WriteConsole(i,'Congrats, you have earned your team: '+inttostr(Killnum[i]*BKS[I])+' bonus cash for kills this match',$EE81FAA1);
  923.           Tcash:=Tcash+Killnum[i];
  924.         end;
  925.       end;
  926.     end;
  927.     if shop = true then WriteConsole(0,'Alpha Team Match Bonus: '+inttostr(Tcash)+' (+'+inttostr(Tcash)+' Cash)!',$EE00FFFF);
  928.     Tcash:=0;
  929.   end;
  930.    
  931. procedure OnFlagScore(ID, TeamFlag: byte);
  932. begin
  933.  if (SpeedTimer[ID] > 0) AND (IDtoname(ID) <> 'Mr.Zombie') AND (speedster[ID]=False) then begin
  934.    Achievement(ID,'Speedster','speedster');
  935.    speedster[ID]:=True;
  936.    SpeedTimer[ID]:=-1;
  937.  end;
  938.  if shop = true then begin
  939.   i:=Random(1,2);
  940.   if i = 1 then if GetPlayerStat(ID,'Team') = 1 then begin
  941.     for i := 1 to 32 do begin
  942.       if GetPlayerStat(i,'Alive') = true then if GetPlayerStat(i,'Team') = 1 then
  943.             begin
  944.                 SpawnObject(GetPlayerStat(i,'x'),GetPlayerStat(i,'y'),18);
  945.             end;
  946.     end;
  947.   end;
  948.        
  949.   if i = 2 then for i := 1 to 32 do
  950.     begin
  951.     if GetPlayerStat(ID,'Team') = 1 then if GetPlayerStat(i,'Alive') = true then if GetPlayerStat(i,'Team') = 1 then
  952.         begin
  953.             GiveBonus(i, 1);
  954.             SpawnObject(GetPlayerStat(i,'x'),GetPlayerStat(i,'y'),20);
  955.       TUPred[i]:=TUPred[i]+1;
  956.         end;
  957.     end;
  958.    end;
  959.  
  960.   if shop = false then begin
  961.   for i := 1 to 32 do
  962.     begin
  963.     if GetPlayerStat(ID,'Team') = 1 then if GetPlayerStat(i,'Alive') = true then if GetPlayerStat(i,'Team') = 1 then
  964.         begin
  965.             GiveBonus(i, 1);
  966.             SpawnObject(GetPlayerStat(i,'x'),GetPlayerStat(i,'y'),20);
  967.       TUPred[i]:=TUPred[i]+1;
  968.     end;
  969.   end;
  970.  end;
  971.  
  972. TFC[ID]:=TFC[ID]+1;
  973.     if HC = true then begin
  974.         if GetPlayerStat(ID,'Human') = true then
  975.         begin
  976.             WriteConsole(0,'Holy Cross Activated, Alpha team has scored!',$EE81FAA1);
  977.             DrawText(0,'HULELUJA!',330,RGB(255,255,255),0.20,40,240);
  978.             for i := 1 to 32 do
  979.             begin
  980.                 if GetPlayerStat(i,'Human') = false then
  981.                 begin
  982. CreateBullet(GetPlayerStat(i,'x'), GetPlayerStat(i,'y') - 0, 0,-20,100, 3, ID);
  983. Sleep(20);
  984.                 end;
  985.             end;
  986.     Cash:=Cash+50
  987.     WriteConsole(0,IdtoName(ID)+' earned Alpha Team 50 Cash for scoring under the Cross!',$EE81FAA1);
  988.         end;
  989.     end;
  990.    
  991.     if GetPlayerStat(ID,'Human') = true then
  992.     begin
  993.         WriteConsole(0,'Human Cappers Bonus @ '+IDtoName(ID)+'! (+50 cash)',$EE81FAA1);
  994.         Cash:=Cash+50;
  995.     end
  996.    
  997.   if AlphaScore = 10 then begin
  998.   UpdateCharVars();  
  999.   end;
  1000.  
  1001.   if BravoScore = 10 then begin
  1002.   UpdateCharVars();
  1003.   end;
  1004. end;
  1005.  
  1006. function OnCommand(ID: Byte; Text: string): boolean;
  1007. begin
  1008.  
  1009.     if GetPiece(text,' ',0) = '/raisecash' then begin
  1010.         Cash := Cash + Strtoint(GetPiece(Text,' ',1));
  1011.         WriteConsole(0,'Admin has just deposited '+Getpiece(Text,' ',1)+' Global Player Cash!',$EE81FAA1);
  1012.     end;
  1013.  
  1014.     if Lowercase(Text) = '/deathexplode' then begin
  1015.         WriteConsole(0,'death explosions enabled', $00EE0000);
  1016.         WriteLn('death explosions have been enabled by ' + IntToStr(ID) + '!');
  1017.     for i := 1 to 32 do deathexp[i] := True;
  1018.         Command('/maxrespawntime 20');
  1019.     end;
  1020.  
  1021.     if Lowercase(Text) = '/nodeathexp' then begin
  1022.         WriteConsole(0,'death explosions disabled', $00EE0000);
  1023.         WriteLn('death explosions have been disabled by ' + IntToStr(ID) + '!');
  1024.         for i := 1 to 32 do deathexp[i] := False;
  1025.         Command('/maxrespawntime 2');
  1026.     end;
  1027.    
  1028.     if Lowercase(Text) = '/give apred' then begin
  1029.         for i := 1 to 32 do
  1030.         begin
  1031.             if GetPlayerStat(i,'Team') = 1 then if GetPlayerStat(i,'Alive') = true then
  1032.             begin
  1033.                 GiveBonus(i, 1);
  1034.                 SpawnObject(GetPlayerStat(i,'x'),GetPlayerStat(i,'y'),20);
  1035.             end;
  1036.         end;
  1037.         WriteConsole(0,'Admin has just given Alpha Team predator',$EE81FAA1);
  1038.     end;
  1039.    
  1040.     if Lowercase(Text) = '/give bpred' then begin
  1041.         for i := 1 to 32 do
  1042.         begin
  1043.             if GetPlayerStat(i,'Team') = 2 then if GetPlayerStat(i,'Alive') = true then
  1044.             begin
  1045.                 GiveBonus(i, 1);
  1046.                 SpawnObject(GetPlayerStat(i,'x'),GetPlayerStat(i,'y'),20);
  1047.             end;
  1048.         end;
  1049.         WriteConsole(0,'Admin has just given the zombies predator, Lookout!!',$EEEE0000);
  1050.     end;
  1051.    
  1052.     if Lowercase(Text) = '/give aspeed' then begin
  1053.         for i := 1 to 32 do
  1054.         begin
  1055.             if GetPlayerStat(i,'Team') = 1 then if GetPlayerStat(i,'Alive') = true then
  1056.             begin
  1057.                 SpawnObject(GetPlayerStat(i,'x'),GetPlayerStat(i,'y'),18);
  1058.             end;
  1059.         end;
  1060.         WriteConsole(0,'Admin has just given Alpha team the speed gun!',$EE81FAA1);
  1061.     end;
  1062.    
  1063.     if Lowercase(Text) = '/give bspeed' then begin
  1064.         for i := 1 to 32 do
  1065.         begin
  1066.             if GetPlayerStat(i,'Team') = 2 then if GetPlayerStat(i,'Alive') = true then
  1067.             begin
  1068.                 SpawnObject(GetPlayerStat(i,'x'),GetPlayerStat(i,'y'),18);
  1069.             end;
  1070.         end;
  1071.         WriteConsole(0,'Admin has just given the zombies the speed gun, Lookout!!',$EEEE0000);
  1072.     end;
  1073.  
  1074.   if Text = '/nextmap' then begin
  1075.     UpdateCharVars();
  1076.   end;
  1077.  
  1078.   if LowerCase(Text) = '/shopoff' then begin
  1079.      iniWrite('scripts/Shop/profit.ini','script','shop','0');
  1080.      shop := False;
  1081.   end;
  1082.  
  1083.   if LowerCase(Text) = '/shopon' then begin
  1084.      iniWrite('scripts/Shop/profit.ini','script','shop','1');
  1085.      shop := True;
  1086.    end;
  1087.  
  1088.      if Lowercase(Text) = '/bossbot' then begin;  
  1089.         for i := 1 to 32 do  
  1090.           if IDToName(i) = 'Mr.Zombie' then begin  
  1091.               Command('/kick '+inttostr(i)+'');  
  1092.               Command('/addbot2 MRZOMBIEW');  
  1093.               WriteConsole(0,'You Hear the distant roar of a warlord zombie, that cant be good...', $00FFEE22);  
  1094.               break;  
  1095.         end  
  1096.        end;  
  1097. end;
  1098.  
  1099. Function SetRank(ID:Byte; Rank, PlayerClass:String):String;
  1100. begin
  1101.   iniWrite('Players/'+Accname[ID]+'.ini','stats','rank',Rank);
  1102.   iniWrite('Players/'+Accname[ID]+'.ini','stats','class',PlayerClass);
  1103.   RankDam[ID]:=RankNum[ID]*RankDamageMult;
  1104.   WriteConsole(ID,'Congratulations on promotion soldier!',$EE81FAA1);
  1105.   WriteConsole(ID,'You are now: '+Rank,$EE81FAA1);
  1106.   WriteConsole(0,IDtoname(ID)+' has just ranked to '+Rank+'!',$EE81FAA1);
  1107. end;
  1108.  
  1109. procedure OnPlayerKill(Killer, Victim: byte; Weapon: string);
  1110. Var I: Integer;
  1111.     begin
  1112. //if idtoname(Victim) = '[Assassin]Mr.Zombie' then begin
  1113.   //trKills[nametoid(BotOwner)]:=trKills[nametoid(BotOwner
  1114. //if IDtoname(Killer) = '[Warlord]Mr.Zombie' then CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y'), 0, 0,1000, 9, Victim);
  1115. if IDtoname(Victim) = '[Warlord]Mr.Zombie' then Command('/kick '+inttostr(Victim));
  1116.  //Shoot(GetPlayerStat(Killer, 'x') - 10,Getplayerstat(Killer,'y') - 10, Getplayerstat(Victim,'x'), getplayerstat(Victim,'y'), 500, 1000, 4, Killer);
  1117.   trKills[Killer]:=trKills[Killer]+1;
  1118.   if Weapon = 'Barrett M82A1' then begin
  1119.     barKills[Killer]:=barKills[Killer]+1;
  1120.     if (Distance(GetPlayerStat(Killer,'x'),GetPlayerStat(Killer,'y'),GetPlayerStat(Victim,'x'),GetPlayerStat(Victim,'y')) >= 200) AND (greatgahooka[Killer] = False) then begin
  1121.       Achievement(Killer, 'Ya Great Gahooka', 'greatgahooka');
  1122.       greatgahooka[Killer]:=True;
  1123.     end;
  1124.  
  1125.     if (Distance(GetPlayerStat(Killer,'x'),GetPlayerStat(Killer,'y'),GetPlayerStat(Victim,'x'),GetPlayerStat(Victim,'y')) >= 50) AND (yeahyeah[Killer] = False) then begin
  1126.       Achievement(Killer, 'Yeah Yeah we get it', 'yeahyeah');
  1127.       yeahyeah[Killer]:=True;
  1128.     end;
  1129.   end;
  1130.  
  1131.   if trKills[Killer] = 50 then begin
  1132.     SetRank(Killer, 'Private', 'Player');
  1133.     RankNum[Killer]:=1;
  1134.     iniWrite('Players/'+IDtoname(Killer)+'.ini','stats','ranknum',inttostr(RankNum[Killer]));
  1135.     WriteConsole(0,'Looks like this one might stay',$EE81FAA1);
  1136.     WriteConsole(0,'Please make our newest Player feel welcome',$EE81FAA1);
  1137.   end;
  1138.  
  1139.   if trKills[Killer] = 200 then begin
  1140.     SetRank(Killer, 'Corporal', 'Player');
  1141.     RankNum[Killer]:=2;
  1142.     iniWrite('Players/'+IDtoname(Killer)+'.ini','stats','ranknum',inttostr(RankNum[Killer]));
  1143.   end;
  1144.  
  1145.   if trKills[Killer] = 500 then begin
  1146.     SetRank(Killer, 'Sergeant', 'Player');
  1147.     RankNum[Killer]:=3;
  1148.     iniWrite('Players/'+IDtoname(Killer)+'.ini','stats','ranknum',inttostr(RankNum[Killer]));
  1149.   end;
  1150.  
  1151.   if trKills[Killer] = 1000 then begin
  1152.     SetRank(Killer, 'Captain', 'Officer');
  1153.     WriteConsole(Killer,'Welcome to the ranks Rookie, great to have you with us',$EE81FAA1);
  1154.     WriteConsole(0,'Please welcome our newest Officer',$EE81FAA1);
  1155.     RankNum[Killer]:=4;
  1156.     iniWrite('Players/'+IDtoname(Killer)+'.ini','stats','ranknum',inttostr(RankNum[Killer]));
  1157.   end;
  1158.  
  1159.   if trKills[Killer] = 3000 then begin
  1160.     SetRank(Killer, 'Major', 'Officer');
  1161.     RankNum[Killer]:=5;
  1162.     iniWrite('Players/'+IDtoname(Killer)+'.ini','stats','ranknum',inttostr(RankNum[Killer]));
  1163.   end;
  1164.  
  1165.   if trKills[Killer] = 4500 then begin
  1166.     SetRank(Killer, 'Colonel', 'Officer');
  1167.     RankNum[Killer]:=6;
  1168.     iniWrite('Players/'+IDtoname(Killer)+'.ini','stats','ranknum',inttostr(RankNum[Killer]));
  1169.   end;
  1170.  
  1171.   if trKills[Killer] = 6000 then begin
  1172.     SetRank(Killer, 'General', 'Officer');
  1173.     RankNum[Killer]:=7;
  1174.     iniWrite('Players/'+IDtoname(Killer)+'.ini','stats','ranknum',inttostr(RankNum[Killer]));
  1175.   end;
  1176.  
  1177.   if trKills[Killer] = 10000 then begin
  1178.     SetRank(Killer, 'Knight', 'Noble');
  1179.     WriteConsole(0,'Please welcome our newest Noble',$EE81FAA1);
  1180.     RankNum[Killer]:=8;
  1181.     iniWrite('Players/'+IDtoname(Killer)+'.ini','stats','ranknum',inttostr(RankNum[Killer]));
  1182.   end;
  1183.  
  1184.   if trKills[Killer] = 20000 then begin
  1185.     SetRank(Killer, 'Baron', 'Elite');
  1186.     WriteConsole(0,'We have an Elite on the field, welcome to the Vet Ranks '+idtoname(Killer)+'!',$EE81FAA1);
  1187.     RankNum[Killer]:=9;
  1188.     iniWrite('Players/'+IDtoname(Killer)+'.ini','stats','ranknum',inttostr(RankNum[Killer]));
  1189.   end;
  1190.  
  1191.   if trKills[Killer] = 50000 then begin
  1192.     SetRank(Killer, 'Earl', 'Elite');
  1193.     RankNum[Killer]:=10;
  1194.     iniWrite('Players/'+IDtoname(Killer)+'.ini','stats','ranknum',inttostr(RankNum[Killer]));
  1195.   end;
  1196.  
  1197.   if trKills[Killer] = 100000 then begin
  1198.     SetRank(Killer, 'Warlord', 'FSG Veteran');
  1199.     WriteConsole(0,GetPlayerStat(Killer, 'Name')+' Truly is an FSG Veteran',$EE81FAA1);
  1200.     RankNum[Killer]:=12;
  1201.     iniWrite('Players/'+IDtoname(Killer)+'.ini','stats','ranknum',inttostr(RankNum[Killer]));
  1202.   end;
  1203.         NKS[Killer]:=NKS[Killer]+1;
  1204.         if NKS[Killer]=NKS[Victim] then begin
  1205.             if NKS[Victim]>BKS[Victim] then BKS[Victim]:=NKS[Victim];
  1206.             NKS[Victim]:=0;
  1207.         end;
  1208.            
  1209.     Killnum[Killer]:=Killnum[Killer]+1;
  1210.         if shop = true then begin
  1211.                         GiveBonus(Killer,BonusID);
  1212.         Cash :=Cash+1;
  1213.                         end;
  1214.         if deathexp[Killer] = true then begin
  1215.     {for i := 1 to 5 do}
  1216.             CreateBullet(GetPlayerStat(i,'x'), GetPlayerStat(i,'y') - 0, 0,-200,100, 10, Killer);
  1217.             Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,DED*EDM,25, Killer,10,EBN*2);
  1218.                                     Sleep(1);
  1219.         //WriteLn('Cash Updated');
  1220.         //WriteConsole(0,'Global Player Cash: '+inttostr(Cash),$EE81FAA1);
  1221.         //WriteLn('Cash Displayed');
  1222.    end;
  1223.    if Victim = Killer then begin //begin nova
  1224.         // This message will only happen for selfkilling bots, though.
  1225.         WriteConsole(0, IDtoName(Victim) + ' just annihilated himself', $00EE0000);
  1226.         Nova(GetPlayerstat(Killer,'X'),Getplayerstat(Killer,'Y'),0,35,0, Killer,10,5);
  1227.         Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,70,0, Killer,10,25);
  1228.         Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,105,0, Killer,10,25);
  1229.         Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,140,0, Killer,10,25);
  1230.         Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,175,0, Killer,10,25);
  1231.         Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,210,0, Killer,10,25);
  1232.         Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,245,0, Killer,10,25);
  1233.         Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,270,0, Killer,10,25);
  1234.         Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,305,0, Killer,10,25);
  1235.         Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,340,0, Killer,10,25);
  1236.         Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,375,0, Killer,10,75);
  1237.         Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,410,0, Killer,10,150);
  1238. sleep(30);
  1239.    end;
  1240.  
  1241.     if Getplayerstat(Killer,'Name') = 'Mr.Zombie' then begin
  1242.         for I := 1 to DEXN do
  1243.     begin
  1244.     Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,DED*I,25, Victim,10,EBNNTT*I);
  1245.         //Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,(DED*I)/2,25, Victim,10,EBNND);
  1246.         //Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,(DED*I)/3,25, Victim,10,EBNNT);
  1247. Sleep(1);
  1248. for i:= 1 to 32 do begin
  1249. //if GetPlayerStat(i,'Team') = 1 then CreateBullet(GetPlayerStat(i,'x'), GetPlayerStat(i,'y') - 0, 0,-20,100, 10, Killer);
  1250. end;
  1251.     end;
  1252.     end;
  1253.  
  1254.   if idtoname(Killer) = 'Mr.Zombie' then begin
  1255.     KBZombie[Victim] := KBZombie[Victim]+1;
  1256.  
  1257.     if KBZombie[Victim] = 50 then WriteConsole(0,''+idtoname(Victim)+' is getting owned, dats gotta hurt!',$00EEEE00);
  1258.  
  1259.     if KBZombie[Victim] = 100 then begin
  1260.       if holyshit[Victim] = False then begin
  1261.         Achievement(Victim, 'HOLY SHIT! Hes Still going!', 'holyshit');
  1262.         holyshit[Victim] := True;
  1263.       end;
  1264.       Writeconsole(0, 'holy shit, '+idtoname(Victim)+' is getting totally owned and is still going! o.0', $00EEEE00);
  1265.     end;
  1266.   end;
  1267.  
  1268. if FlagCaptured[Victim] = True then FlagCaptured[Victim] := False;
  1269. if Flaghold[Victim] > 0 then Flaghold[Victim] := 0;
  1270. end;
  1271.  
  1272. procedure AppOnIdle(Ticks: integer);
  1273. begin
  1274. Timer:=Timer - 1;
  1275. if Timer = 0 then begin
  1276. Writeconsole(0,'Saving all accounts...',$0000FFFF);
  1277. //Command('/save');
  1278. for i:= 1 to 32 do if Getplayerstat(i,'Ping') > 0 then begin
  1279. if SpeedTimer[i] > 0 then Speedtimer[i] := SpeedTimer[i] - 1;
  1280. iniWrite('Players/'+IDtoname(i)+'.ini','stats','kills',inttostr(trKills[i]));
  1281. iniWrite('Players/'+IDtoname(i)+'.ini','stats','tupred',inttostr(TUPred[i]));
  1282. iniWrite('Players/'+IDtoname(i)+'.ini','stats','barkills',inttostr(barKills[i]));
  1283. iniWrite('Players/'+IDtoname(i)+'.ini','stats','ranknum',inttostr(RankNum[i]));
  1284. end;
  1285. iniWrite('scripts/Shop/profit.ini','profit','cash',inttostr(Cash));
  1286. //Sleep(2000);
  1287. Timer:=300;
  1288. Writeconsole(0,'Done!',$0000FFFF);
  1289. end;
  1290. for i:= 1 to 32 do if (GetPlayerStat(i,'Active') = true) AND (GetPlayerStat(i,'Alive') = true) then begin  
  1291.             if GetPlayerStat(i,'Human') = true then begin
  1292.             if GetPlayerStat(i, 'Flagger') = False then FlagCaptured[i]:= False;
  1293.             if FlagCaptured[i] = true then Flaghold[i]:=Flaghold[i]+1;
  1294.             if (Flaghold[i] = 30) AND (catchme[i] = False) then begin
  1295.               Achievement(i,'Catch Me if you can! :-)', 'catchme');
  1296.               catchme[i] := True;
  1297.             end;
  1298.             if (Flaghold[i] = 60) AND (SoloChaser[i] = False) then begin
  1299.               Achievement(i,'Solo Zombie Flagger Chaser','solochaser');
  1300.               SoloChaser[i]:=True;
  1301.             end;
  1302.             if (Flaghold[i] = 120) AND (QuitTeasin[i] = False) then begin
  1303.               Achievement(i,'Hey! Quit Teasin!','quitteasin');
  1304.               QuitTeasin[i]:=True;
  1305.             end;
  1306.             TSec[i]:= TSec[i] + 1;  
  1307.             if TSec[i] = 60 then begin  
  1308.               TMin[i]:= TMin[i] + 1;  
  1309.               TSec[i]:= 0;  
  1310.                 end;  
  1311.         end else begin  
  1312.           if TSec[i] > 0 then BTSec[i] := TSec[i];  
  1313.           TSec[i] := 0;  
  1314.           if TMin[i] > 0 then BTMin[i]:= TMin[i];  
  1315.           TMin[i] := 0;  
  1316.                 CheckTime(i);  
  1317.      end;  
  1318.         end;  
  1319. if (GetPlayerStat(ID,'human') = true) AND (GetPlayerStat(ID,'Flagger') = true) AND (shop = True) then Cash:=Cash+2;
  1320.   if Timeleft = 1 then begin
  1321.     for i := 1 to 32 do
  1322.     begin
  1323.       if GetPlayerStat(i,'Human') = true then begin
  1324.         Cash:=Cash+Killnum[i];
  1325.         WriteConsole(i,'Match Bonus!',$EE81FAA1);
  1326.         WriteConsole(i,'Congrats, you have earned your team: '+inttostr(Killnum[i])+' bonus cash for kills this match',$EE81FAA1);
  1327.         Tcash:=Tcash+Killnum[i];
  1328.       end;
  1329.     end;
  1330.     WriteConsole(0,'Alpha Team Match Bonus: '+inttostr(Tcash)+' (+'+inttostr(Tcash)+' Cash)!',$EE00FFFF);
  1331.     Tcash:=0;
  1332.   end;
  1333.  
  1334.   For PlayerID := 1 To 32 Do begin
  1335.     if NTB[PlayerID] = True then begin
  1336.       if ntTimer[PlayerID] > 0 then ntTimer[PlayerID]:=ntTimer[PlayerID]-1;
  1337.       WriteConsole(PlayerID,''+inttostr(ntTimer[PlayerID])+'...',$EE00FFFF);
  1338.       if ntTimer[PlayerID] = 0 then begin
  1339.         WriteConsole(PlayerID,'Armed! keep your distance',$EE00FFFF);
  1340.         NTB[PlayerID]:=False;
  1341.       end;
  1342.       if (ntTimer[PlayerID] = 0) AND (ntfTimer[PlayerID] > 0) then ntfTimer[PlayerID]:=ntfTimer[PlayerID]-1;
  1343.       if ntfTimer[PlayerID] = 0 then for i := 1 to 32 do if (GetPlayerStat(i,'Name') = 'Mr.Zombie') AND (RayCast(GetPlayerStat(i,'x'),GetPlayerStat(i,'Y'),ntPosX[PlayerID],ntPosY[PlayerID],Dist,50)) then begin
  1344.         WriteLn('Novas should be triggering now');
  1345.         Nova(ntPosX[PlayerID],ntPosY[PlayerID],0,35,0, PlayerID,10,5);
  1346.         Nova(ntPosX[PlayerID],ntPosY[PlayerID],0,70,0, PlayerID,10,25);
  1347.         Nova(ntPosX[PlayerID],ntPosY[PlayerID],0,105,0, PlayerID,10,25);
  1348.         Nova(ntPosX[PlayerID],ntPosY[PlayerID],0,140,0, PlayerID,10,25);
  1349.         Nova(ntPosX[PlayerID],ntPosY[PlayerID],0,175,0, PlayerID,10,25);
  1350.         Nova(ntPosX[PlayerID],ntPosY[PlayerID],0,210,0, PlayerID,10,25);
  1351.         Nova(ntPosX[PlayerID],ntPosY[PlayerID],0,245,0, PlayerID,10,25);
  1352.         Nova(ntPosX[PlayerID],ntPosY[PlayerID],0,270,0, PlayerID,10,25);
  1353.         Nova(ntPosX[PlayerID],ntPosY[PlayerID],0,305,0, PlayerID,10,25);
  1354.         Nova(ntPosX[PlayerID],ntPosY[PlayerID],0,340,0, PlayerID,10,25);
  1355.         Nova(ntPosX[PlayerID],ntPosY[PlayerID],0,375,0, PlayerID,10,75);
  1356.         Nova(ntPosX[PlayerID],ntPosY[PlayerID],0,410,0, PlayerID,10,150);
  1357.         ntfTimer[PlayerID]:=30;
  1358.       end;
  1359.     end;
  1360.   end;
  1361. end;
  1362.  
  1363. procedure OnFlagGrab(ID, TeamFlag: byte; GrabbedInBase: boolean);
  1364. begin
  1365. if speedster[ID] = false then SpeedTimer[ID] := 5;
  1366. Cash:=Cash+5;
  1367. if NFT[ID] > 0 then begin
  1368. MovePlayer(ID,GetObjectStat(1,'X'), GetObjectStat(1, 'Y'));
  1369. WriteConsole(0,'Grab detected, I see you have a flag teleporter!',$EE81FAA1);
  1370. WriteConsole(0,'Teleporting you now '+IDtoName(ID)+'!',$EE81FAA1);
  1371. //i:=KillObject(2);
  1372. //SetSpawnStat(i,'x',GetPlayerStat(ID,'x'));
  1373. //SetSpawnStat(i,'y',GetPlayerStat(ID,'y'));
  1374. NFT[ID]:=NFT[ID]-1;
  1375. WriteConsole(ID,'You now have '+inttostr(NFT[ID])+' teleports remaining!',$EE81FAA1);
  1376. end;
  1377.  
  1378. if GetPlayerStat(ID, 'human') = true then FlagCaptured[ID] := True;
  1379. end;
  1380.  
  1381. function OnPlayerDamage(Victim, Shooter: byte; Damage: integer): integer;
  1382. //var result:Integer;
  1383. begin
  1384. //RankDam[Shooter]:=Damage+(Damage*(((RankNum[Shooter]+tna[Shooter])*RankDamageMult)/100));
  1385. TNA[Shooter]:=strtoint(ReadINI('Players/'+IDtoname(Shooter)+'.ini','stats','tna','0'));
  1386. DamagePerc[Shooter]:=(RankNum[Shooter]*RankDamageMult)+tna[Shooter];
  1387. if CheckPlayerAdmin(Shooter) = True then begin
  1388. if Getplayerstat(Victim,'alive') = True then Result:=CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y') - 0, 0,0,1, 10, Shooter);
  1389. end;
  1390. RankDam[Shooter]:=Damage+(Damage*(DamagePerc[Shooter]/100));
  1391. result:=Damage + Rankdam[Shooter];
  1392. //WriteLn('should be adding '+inttostr(RankDam[Shooter])+' damage');
  1393.  
  1394. if IDtoname(Shooter) = '[Warlord]Mr.Zombie' then begin
  1395.   DamCalc[Shooter]:=Damage+RankDam[Shooter];
  1396.   //Result:=DamCalc[Shooter]*(1/100);
  1397.   if Getplayerstat(Victim,'alive') = True then Result:=CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y'), 0,-10,100, 10, Shooter);
  1398.   //if Getplayerstat(Victim,'alive') = False then break;
  1399. end;
  1400. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement