Advertisement
Guest User

Untitled

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