Advertisement
Guest User

Untitled

a guest
Jun 13th, 2017
590
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 54.52 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 not keyFound 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 not sectionFound 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 not TP[ID] 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) 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 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') 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') 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. for i := 1 to 32 do begin
  620. if idtoname(i) = 'Mr.Zombie' then begin
  621. Command('/setteam1 '+IntToStr(i));
  622. break;
  623. end;
  624. end;
  625. end;
  626. end;
  627.  
  628. if Lowercase(Text) = '/buy holycross' then begin
  629. if Cash < 30000 then begin
  630. WriteConsole(0,IdtoName(ID)+' just tried to purchase Holy Cross, not enough funds!',$EE81FAA1);
  631. end;
  632. if Cash >= 30000 then begin
  633. HC:=true;
  634. WriteConsole(0,IdtoName(ID)+' has just bought Holy Cross for 30000 Cash',$EE81FAA1);
  635. Cash:=Cash-30000;
  636. end;
  637. end;
  638.  
  639. if Lowercase(Text) = '/buy speed' then begin
  640. if Cash < predat then begin
  641. WriteConsole(0,IdtoName(ID)+' just tried to purchase the speed gun, not enough funds!',$EE81FAA1);
  642. end;
  643. if Cash >= predat then begin
  644. WriteConsole(0,IdtoName(ID)+' has just bought the speed gun for '+inttostr(predat)+' Cash',$EE81FAA1);
  645. WriteConsole(ID,'Server PM: '+IdtoName(ID)+': remember, when you die, you lose the gun',$EE81FAA1);
  646. WriteConsole(ID,'Server PM: so use it wisely',$EE81FAA1);
  647. Cash:=Cash-predat;
  648. SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),18);
  649. end;
  650. end;
  651.  
  652. if Lowercase(Text) = '/buy tspeed' then begin
  653. if Cash < 900 then begin
  654. WriteConsole(0,IdtoName(ID)+' just tried to purchase Team Speed, not enough funds!',$EE81FAA1);
  655. end;
  656. if Cash >= 900 then begin
  657. Cash :=Cash-900;
  658. WriteConsole(0,IdtoName(ID)+' has just bought Team Speed for 300 Cash',$EE81FAA1);
  659. for i := 1 to 32 do
  660. begin
  661. if GetPlayerStat(i,'Team') = 1 then if GetPlayerStat(i,'Alive') then
  662. begin
  663. SpawnObject(GetPlayerStat(i,'x'),GetPlayerStat(i,'y'),18);
  664. end;
  665. end;
  666. end;
  667. end;
  668.  
  669. if Lowercase(Text) = '/buy ftp' then begin
  670. if Cash < 10000 then begin
  671. WriteConsole(0,IdtoName(ID)+' just tried to purchase a Flag Teleport, not enough funds!',$EE81FAA1);
  672. end;
  673. if Cash >= 10000 then begin
  674. Cash :=Cash-10000;
  675. WriteConsole(0,IdtoName(ID)+' has just bought a Flag Teleport for 10000 Cash',$EE81FAA1);
  676. NFT[ID]:=NFT[ID]+1;
  677. WriteConsole(ID,'You now have '+inttostr(NFT[ID])+' teleports!',$EE81FAA1);
  678. end;
  679. end;
  680.  
  681. if Lowercase(Text) = '/buy turret' then begin
  682. if Cash < 30000 then begin
  683. WriteConsole(0,IdtoName(ID)+' just tried to purchase a Turret, not enough funds!',$EE81FAA1);
  684. end;
  685. if Cash >= 30000 then begin
  686. SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y')-15,15);
  687. Cash :=Cash-30000;
  688. WriteConsole(0,IdtoName(ID)+' has just bought a Turret for 30000 Cash',$EE81FAA1)
  689. end;
  690. end;
  691.  
  692. if Lowercase(Text) = '/buy nuke turret' then begin
  693. if Cash < 50000 then begin
  694. WriteConsole(0,IdtoName(ID)+' just tried to purchase a Nuke Turret, not enough funds!',$EE81FAA1);
  695. end;
  696. if Cash >= 50000 then begin
  697. SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y')-15,15);
  698. ntPosX[ID]:=GetPlayerStat(ID,'x');
  699. ntPosY[ID]:=GetPlayerStat(ID,'y');
  700. ntTimer[ID]:= 10;
  701. NTB[ID]:=True;
  702. Cash :=Cash-50000;
  703. WriteConsole(0,IdtoName(ID)+' has just bought a Nuke Turret for 50000 Cash',$EE81FAA1);
  704. WriteConsole(ID,'Arming...stay close to arm it!',$EE81FAA1);
  705. end;
  706. end;
  707.  
  708. if Lowercase(Text) = '/buy assassin' then begin
  709. waiting4bot[ID]:=True;
  710. for i := 1 to 32 do begin
  711. if idtoname(i) = 'Mr.Zombie' then begin
  712. Command('/kick '+inttostr(i));
  713. break;
  714. end;
  715. end;
  716. Command('/addbot1 MRZOMBIEA');
  717. end;
  718.  
  719. if Lowercase(Text) = '/items' then begin
  720. WriteConsole(0,'/buy pred - gives u pred bonus - '+inttostr(predat)+' cash',$EE81FAA1);
  721. WriteConsole(0,'/buy tpred - gives all Alpha team pred bonus - 600 cash',$EE81FAA1);
  722. WriteConsole(0,'/buy serk - gives u berserker bonus - 195 cash',$EE81FAA1);
  723. WriteConsole(0,'/buy tbes - gives all Alpha team berserker bonus - 600 cash',$EE81FAA1);
  724. WriteConsole(0,'/buy clusters - upgrades your nade bonus to clusters - 3000 cash',$EE81FAA1);
  725. WriteConsole(0,'/buy nades - upgrades your cluster bonus to nades - 3000 cash',$EE81FAA1);
  726. WriteConsole(0,'---->grenade upgrades affects whole team',$EE81FAA1);
  727. WriteConsole(0,'/buy dex - upgrades normal death explosion size - '+inttostr(DEC)+' Cash',$EE81FAA1);
  728. WriteConsole(0,'---->does not affect suicides',$EE81FAA1);
  729. WriteConsole(0,'/buy holycross - Kills all zombies on Red Team score - 30000 cash',$EE81FAA1);
  730. WriteConsole(0,'/buy ally - brainwash a zombie to join Alpha team - 30000 cash',$EE81FAA1);
  731. WriteConsole(0,'/buy speed - gives you the flamer gun - 225 cash',$EE81FAA1);
  732. WriteConsole(0,'/buy tspeed - gives all Alpha team the flamer gun - 900 cash',$EE81FAA1);
  733. WriteConsole(0,'/buy FTP - Teleports you to your flag on grab of other - 10000 cash',$EE81FAA1);
  734. WriteConsole(0,'/buy turret - gives you a turret - 30000 cash',$EE81FAA1);
  735. end;
  736.  
  737. if Lowercase(Text) = '/dex on' then begin
  738. deathexp[ID]:=True;
  739. WriteConsole(ID,'Death explosions enabled for your ID, have fun',$EE81FAA1);
  740. WriteConsole(ID,'consider others, before you leave please use /dex off',$EE81FAA1);
  741. end;
  742.  
  743. if Lowercase(Text) = '/dex off' then begin
  744. deathexp[ID]:=False;
  745. WriteConsole(ID,'Death explosions disabled for your ID, I hope you enjoyed it',$EE81FAA1);
  746. end;
  747. end;
  748.  
  749. if GetPiece(Text,' ',0) = '/create' then begin
  750. NewLogin(ID, GetPiece(Text,' ',1),GetPiece(Text,' ',2));
  751. end;
  752.  
  753. if GetPiece(Text,' ',0) = '/login' then begin
  754. if not FileExists('Players/'+GetPiece(Text,' ',1)+'.ini') then WriteConsole(ID,'This username does not exist or is incorrect, please try again',$EE81FAA1);
  755. if FileExists('Players/'+GetPiece(Text,' ',1)+'.ini') then begin
  756. if GetPiece(Text,' ',2) <> ReadINI('Players/'+GetPiece(Text,' ',1)+'.ini','stats','pass','*ERROR*') then WriteConsole(ID,'This password is incorrect, please try again',$EE81FAA1);
  757. if GetPiece(Text,' ',2) = ReadINI('Players/'+GetPiece(Text,' ',1)+'.ini','stats','pass','*ERROR*') then begin
  758. Accname[ID]:= GetPiece(Text,' ',1);
  759. WriteConsole(ID,'Login Successful, Welcome Back '+GetPiece(Text,' ',1)+'!',$EE81FAA1);
  760. ExistingLogin(ID,Accname[ID]);
  761. end;
  762. end;
  763. end;
  764. end;
  765.  
  766. procedure OnMapChange(NewMap: string);
  767. begin
  768. for i:= 1 to 32 do begin
  769. if Getplayerstat(i,'Ping') > 0 then iniWrite('Players/'+GetPlayerStat(i,'Name')+'.ini','stats','kills',inttostr(trKills[i]));
  770. TFC[i]:=0;
  771. BKS[i]:=0;
  772. NKS[i]:=0;
  773. NTB[i]:=False;
  774. ntTimer[i]:=0;
  775. ntfTimer[i]:=0;
  776. KBZombie[i]:=0;
  777. iniPFile :='Players/'+Accname[i]+'.ini';
  778. IniWrite(IniPFile,'stats','kills', inttostr(trKills[i]));
  779. iniWrite('Players/'+Accname[i]+'.ini','stats','barkills',inttostr(barKills[i]));
  780. iniWrite('scripts/Shop/profit.ini','profit','cash',inttostr(Cash));
  781. iniWrite('Players/'+Accname[i]+'.ini','stats','ranknum',inttostr(RankNum[i]));
  782. end;
  783. OBFLX:=GetSpawnStat(6,'x');
  784. OBFLY:=GetSpawnStat(6,'x');
  785. For i := 1 to 32 do
  786. begin
  787. if shop then GiveBonus(i, BonusID);
  788. end;
  789. Tcash:=0;
  790. end;
  791.  
  792. procedure OnPlayerRespawn(ID: byte);
  793. begin
  794. if shop then GiveBonus(ID,BonusID);
  795. end;
  796.  
  797. Procedure NewPlayer(ID:Byte);
  798. begin
  799. iniPFile :='Players/'+IDtoname(ID)+'.ini';
  800. ini:=iniLoad(iniPFile);
  801. //WriteFile('Players/'+GetPlayerStat(ID,'Name')+'.txt',IDtoname(ID)+':'+GetPlayerStat(ID,'IP'));
  802. WriteFile('Players/'+IDtoname(ID)+'.ini','');
  803. iniPFile :='Players/'+IDtoname(ID)+'.ini';
  804. ini:=iniLoad(iniPFile);
  805. IniWrite(IniPFile,'stats','IP', GetPlayerStat(ID,'IP'));
  806. IniWrite(IniPFile,'stats','reg', '1');
  807. IniWrite(IniPFile,'stats','kills', '0');
  808. iniWrite('Players/'+IDtoname(ID)+'.ini','stats','rank','1');
  809. iniWrite('Players/'+IDtoname(ID)+'.ini','stats','ranknum','0');
  810. iniWrite('Players/'+IDtoname(ID)+'.ini','stats','class','1');
  811. IniWrite(IniPFile,'stats','tna', '0');
  812. IniWrite(IniPFile,'stats','barkills', '0');
  813. iniWrite('Players/'+IDtoname(ID)+'.ini','stats','tupred','0');
  814. iniWrite('Players/'+IDtoname(ID)+'.ini','achievements','TP','0');
  815. iniWrite('Players/'+IDtoname(ID)+'.ini','achievements','greatgahooka','0');
  816. iniWrite('Players/'+IDtoname(ID)+'.ini','achievements','yeahyeah','0');
  817. iniWrite('Players/'+IDtoname(ID)+'.ini','achievements','speedster','0');
  818. iniWrite('Players/'+IDtoname(ID)+'.ini','achievements','holyshit','0');
  819. iniWrite('Players/'+IDtoname(ID)+'.ini','achievements','catchme','0');
  820. iniWrite('Players/'+IDtoname(ID)+'.ini','achievements','solochaser','0');
  821. iniWrite('Players/'+IDtoname(ID)+'.ini','achievements','quitteasin','0');
  822. WriteConsole(ID,'Automated login system Activated, new/unregistered user detected',$EE81FAA1);
  823. WriteConsole(ID,'Welcome '+idtoname(ID)+'!',$EE81FAA1);
  824. WriteConsole(ID,'Your player name has been registered to your IP: '+getplayerstat(ID,'IP'),$EE81FAA1);
  825. WriteConsole(ID,'should you need to change your name, ie add clan tags:',$EE81FAA1);
  826. WriteConsole(ID,'admin will update your registration details',$EE81FAA1);
  827. WriteConsole(ID,'remember you are allowed 3 different player names before being kicked',$EE81FAA1);
  828. WriteConsole(ID,'Beginning stats collection for your account',$EE81FAA1);
  829. WriteConsole(ID,'use !stats to see your current player stats',$EE81FAA1);
  830. WriteConsole(ID,'You will now receive achievements',$EE81FAA1);
  831. WriteConsole(ID,'enjoy your stay :D',$EE81FAA1);
  832. WriteConsole(ID,'as you rank, your hits will become more powerful',$EE81FAA1);
  833. //WriteConsole(ID,'Admin will be notified if:',$EE81FAA1)
  834. //WriteConsole(ID,'you access this server from a different IP address using your current name',$EE81FAA1)
  835. //WriteConsole(ID,'should you have changed computers or ISPs resulting in IP change',$EE81FAA1)
  836. //WriteConsole(ID,'please contact admin: snowman533@gmail.com',$EE81FAA1)
  837. end;
  838.  
  839. procedure ExistingPlayer(ID:Byte);
  840. begin
  841. //PStat:= Idtoname(id)+':'+GetPlayerStat(ID,'IP');
  842. trKills[ID]:= strtoint(ReadINI('Players/'+IDtoname(ID)+'.ini','stats','kills','0'));
  843. WriteConsole(ID,'Automated Login System Activated',$EE81FAA1);
  844. WriteConsole(ID,'Welcome back '+idtoname(ID)+'!',$EE81FAA1);
  845. iniPFile :='Players/'+IDtoname(ID)+'.ini';
  846. ini:=iniLoad(iniPFile);
  847. barKills[ID]:=strtoint(ReadINI('Players/'+IDtoname(ID)+'.ini','stats','barkills','0'));
  848. RankNum[ID]:=strtoint(ReadINI('Players/'+IDtoname(ID)+'.ini','stats','ranknum','0'));
  849. ForceAchUpdate(ID, 'TP');
  850. TP[ID]:=Boolvar[ID];
  851. //if ReadINI('Players/'+IDtoname(ID)+'.ini','achievements','TP','*ERROR*') = '*ERROR*' then iniWrite('Players/'+IDtoname(ID)+'.ini','achievements','TP','0');
  852. //if ReadINI('Players/'+IDtoname(ID)+'.ini','achievements','TP','*ERROR while loading achievement*') = '1' then TP[ID]:=True;
  853. //if ReadINI('Players/'+IDtoname(ID)+'.ini','achievements','TP','*ERROR while loading achievement*') = '0' then TP[ID]:=False;
  854. ForceAchUpdate(ID, 'greatgahooka');
  855. greatgahooka[ID]:=Boolvar[ID]
  856. //if ReadINI('Players/'+IDtoname(ID)+'.ini','achievements','greatgahooka','*ERROR*') = '*ERROR*' then iniWrite('Players/'+IDtoname(ID)+'.ini','achievements','greatgahooka','0');
  857. //if ReadINI('Players/'+IDtoname(ID)+'.ini','achievements','greatgahooka','*ERROR while loading achievement*') = '1' then greatgahooka[ID]:=True;
  858. //if ReadINI('Players/'+IDtoname(ID)+'.ini','achievements','greatgahooka','*ERROR while loading achievement*') = '0' then greatgahooka[ID]:=False;
  859. ForceAchUpdate(ID, 'yeahyeah');
  860. yeahyeah[ID]:=Boolvar[ID];
  861. //if ReadINI('Players/'+IDtoname(ID)+'.ini','achievements','yeahyeah','*ERROR*') = '*ERROR*' then iniWrite('Players/'+IDtoname(ID)+'.ini','achievements','yeahyeah','0');
  862. //if ReadINI('Players/'+IDtoname(ID)+'.ini','achievements','yeahyeah','*ERROR while loading achievement*') = '1' then yeahyeah[ID]:=True;
  863. //if ReadINI('Players/'+IDtoname(ID)+'.ini','achievements','yeahyeah','*ERROR while loading achievement*') = '0' then yeahyeah[ID]:=False;
  864. ForceAchUpdate(ID, 'speedster');
  865. speedster[ID]:=Boolvar[ID];
  866. //if ReadINI('Players/'+IDtoname(ID)+'.ini','achievements','speedster','*ERROR*') = '*ERROR*' then iniWrite('Players/'+IDtoname(ID)+'.ini','achievements','speedster','0');
  867. //if ReadINI('Players/'+IDtoname(ID)+'.ini','achievements','speedster','*ERROR while loading achievement*') = '1' then speedster[ID]:=True;
  868. //if ReadINI('Players/'+IDtoname(ID)+'.ini','achievements','speedster','*ERROR while loading achievement*') = '0' then speedster[ID]:=False;
  869. TNA[ID]:=strtoint(ReadINI('Players/'+IDtoname(i)+'.ini','stats','tna','0'));
  870. DamagePerc[ID]:=(RankNum[ID]*RankDamageMult)+tna[ID];
  871. ForceAchUpdate(ID, 'holyshit');
  872. holyshit[ID]:=Boolvar[ID];
  873. ForceAchUpdate(ID, 'catchme');
  874. catchme[ID]:=Boolvar[ID];
  875. ForceAchUpdate(ID, 'solochaser');
  876. SoloChaser[ID]:=Boolvar[ID];
  877. ForceAchUpdate(ID, 'quitteasin');
  878. QuitTeasin[ID]:=Boolvar[ID];
  879. end;
  880.  
  881. procedure OnJoinTeam(ID, Team: byte);
  882. begin
  883. if idtoname(ID) = '[Assassin]Mr.Zombie' then begin
  884. for i:=1 to 32 do begin
  885. if waiting4bot[i] then begin
  886. BotOwner[ID]:= idtoname(i);
  887. waiting4bot[i]:= False;
  888. break;
  889. end;
  890. end;
  891. end;
  892.  
  893. if Team = 1 then begin
  894. if FileExists('Players/'+IDtoname(ID)+'.ini') then begin
  895. ExistingPlayer(ID);
  896. Accname[ID] := idtoname(ID);
  897. end;
  898.  
  899. if not FileExists('Players/'+IDtoname(ID)+'.ini') then begin
  900. NewPlayer(ID);
  901. if shop then GiveBonus(ID, BonusID);
  902. end;
  903. end;
  904. end;
  905.  
  906. Procedure OnJoinGame(ID,Team:Byte);
  907. begin
  908. ResetStats(ID);
  909. end;
  910.  
  911. procedure UpdateCharVars();
  912. begin
  913. for i := 1 to 32 do
  914. begin
  915. if GetPlayerStat(i,'Human') then begin
  916. BKS[i]:= BKS[i];
  917. Cash:=Cash+(Killnum[i]*BKS[i]);
  918. TTCash[i]:=Killnum[i]*BKS[i];
  919. WriteConsole(i,'Match Bonus!',$EE81FAA1);
  920. WriteConsole(i,'Your performance this map:',$EE81FAA1);
  921. WriteConsole(i,'Total Kills: '+Inttostr(Killnum[i])+'!',$EE81FAA1);
  922. WriteConsole(i,'Total Flag Scores: '+inttostr(TFC[i])+'!',$EE81FAA1);
  923. WriteConsole(i,'Best Kill-Streak: '+inttostr(BKS[i])+'!',$EE81FAA1);
  924. WriteConsole(i,'Longest Time Survived: '+inttostr(BTMin[i])+':'+inttostr(BTSec[i])+' (M:S)!',$EE81FAA1);
  925. if shop then begin
  926. WriteConsole(i,'Congrats, you have earned your team: '+inttostr(Killnum[i]*BKS[I])+' bonus cash for kills this match',$EE81FAA1);
  927. Tcash:=Tcash+Killnum[i];
  928. end;
  929. end;
  930. end;
  931. if shop then WriteConsole(0,'Alpha Team Match Bonus: '+inttostr(Tcash)+' (+'+inttostr(Tcash)+' Cash)!',$EE00FFFF);
  932. Tcash:=0;
  933. end;
  934.  
  935. procedure OnFlagScore(ID, TeamFlag: byte);
  936. begin
  937. if (SpeedTimer[ID] > 0) AND (IDtoname(ID) <> 'Mr.Zombie') AND (speedster[ID]=False) then begin
  938. Achievement(ID,'Speedster','speedster');
  939. speedster[ID]:=True;
  940. SpeedTimer[ID]:=-1;
  941. end;
  942. if shop then begin
  943. i:=Random(1,2);
  944. if i = 1 then if GetPlayerStat(ID,'Team') = 1 then begin
  945. for i := 1 to 32 do begin
  946. if GetPlayerStat(i,'Alive') then if GetPlayerStat(i,'Team') = 1 then
  947. begin
  948. SpawnObject(GetPlayerStat(i,'x'),GetPlayerStat(i,'y'),18);
  949. end;
  950. end;
  951. end;
  952.  
  953. if i = 2 then for i := 1 to 32 do
  954. begin
  955. if GetPlayerStat(ID,'Team') = 1 then if GetPlayerStat(i,'Alive') then if GetPlayerStat(i,'Team') = 1 then
  956. begin
  957. GiveBonus(i, 1);
  958. SpawnObject(GetPlayerStat(i,'x'),GetPlayerStat(i,'y'),20);
  959. TUPred[i]:=TUPred[i]+1;
  960. end;
  961. end;
  962. end;
  963.  
  964. if not shop then begin
  965. for i := 1 to 32 do
  966. begin
  967. if GetPlayerStat(ID,'Team') = 1 then if GetPlayerStat(i,'Alive') then if GetPlayerStat(i,'Team') = 1 then
  968. begin
  969. GiveBonus(i, 1);
  970. SpawnObject(GetPlayerStat(i,'x'),GetPlayerStat(i,'y'),20);
  971. TUPred[i]:=TUPred[i]+1;
  972. end;
  973. end;
  974. end;
  975.  
  976. TFC[ID]:=TFC[ID]+1;
  977. if HC then begin
  978. if GetPlayerStat(ID,'Human') then
  979. begin
  980. WriteConsole(0,'Holy Cross Activated, Alpha team has scored!',$EE81FAA1);
  981. DrawText(0,'HULELUJA!',330,RGB(255,255,255),0.20,40,240);
  982. for i := 1 to 32 do
  983. begin
  984. if not GetPlayerStat(i,'Human') then
  985. begin
  986. CreateBullet(GetPlayerStat(i,'x'), GetPlayerStat(i,'y') - 0, 0,-20,100, 3, ID);
  987. Sleep(20);
  988. end;
  989. end;
  990. Cash:=Cash+50
  991. WriteConsole(0,IdtoName(ID)+' earned Alpha Team 50 Cash for scoring under the Cross!',$EE81FAA1);
  992. end;
  993. end;
  994.  
  995. if GetPlayerStat(ID,'Human') then
  996. begin
  997. WriteConsole(0,'Human Cappers Bonus @ '+IDtoName(ID)+'! (+50 cash)',$EE81FAA1);
  998. Cash:=Cash+50;
  999. end
  1000.  
  1001. if AlphaScore = 10 then begin
  1002. UpdateCharVars();
  1003. end;
  1004.  
  1005. if BravoScore = 10 then begin
  1006. UpdateCharVars();
  1007. end;
  1008. end;
  1009.  
  1010. function OnCommand(ID: Byte; Text: string): boolean;
  1011. begin
  1012.  
  1013. if GetPiece(text,' ',0) = '/raisecash' then begin
  1014. Cash := Cash + Strtoint(GetPiece(Text,' ',1));
  1015. WriteConsole(0,'Admin has just deposited '+Getpiece(Text,' ',1)+' Global Player Cash!',$EE81FAA1);
  1016. end;
  1017.  
  1018. if Lowercase(Text) = '/deathexplode' then begin
  1019. WriteConsole(0,'death explosions enabled', $00EE0000);
  1020. WriteLn('death explosions have been enabled by ' + IntToStr(ID) + '!');
  1021. for i := 1 to 32 do deathexp[i] := True;
  1022. Command('/maxrespawntime 20');
  1023. end;
  1024.  
  1025. if Lowercase(Text) = '/nodeathexp' then begin
  1026. WriteConsole(0,'death explosions disabled', $00EE0000);
  1027. WriteLn('death explosions have been disabled by ' + IntToStr(ID) + '!');
  1028. for i := 1 to 32 do deathexp[i] := False;
  1029. Command('/maxrespawntime 2');
  1030. end;
  1031.  
  1032. if Lowercase(Text) = '/give apred' then begin
  1033. for i := 1 to 32 do
  1034. begin
  1035. if GetPlayerStat(i,'Team') = 1 then if GetPlayerStat(i,'Alive') then
  1036. begin
  1037. GiveBonus(i, 1);
  1038. SpawnObject(GetPlayerStat(i,'x'),GetPlayerStat(i,'y'),20);
  1039. end;
  1040. end;
  1041. WriteConsole(0,'Admin has just given Alpha Team predator',$EE81FAA1);
  1042. end;
  1043.  
  1044. if Lowercase(Text) = '/give bpred' then begin
  1045. for i := 1 to 32 do
  1046. begin
  1047. if GetPlayerStat(i,'Team') = 2 then if GetPlayerStat(i,'Alive') then
  1048. begin
  1049. GiveBonus(i, 1);
  1050. SpawnObject(GetPlayerStat(i,'x'),GetPlayerStat(i,'y'),20);
  1051. end;
  1052. end;
  1053. WriteConsole(0,'Admin has just given the zombies predator, Lookout!!',$EEEE0000);
  1054. end;
  1055.  
  1056. if Lowercase(Text) = '/give aspeed' then begin
  1057. for i := 1 to 32 do
  1058. begin
  1059. if GetPlayerStat(i,'Team') = 1 then if GetPlayerStat(i,'Alive') then
  1060. begin
  1061. SpawnObject(GetPlayerStat(i,'x'),GetPlayerStat(i,'y'),18);
  1062. end;
  1063. end;
  1064. WriteConsole(0,'Admin has just given Alpha team the speed gun!',$EE81FAA1);
  1065. end;
  1066.  
  1067. if Lowercase(Text) = '/give bspeed' then begin
  1068. for i := 1 to 32 do
  1069. begin
  1070. if GetPlayerStat(i,'Team') = 2 then if GetPlayerStat(i,'Alive') then
  1071. begin
  1072. SpawnObject(GetPlayerStat(i,'x'),GetPlayerStat(i,'y'),18);
  1073. end;
  1074. end;
  1075. WriteConsole(0,'Admin has just given the zombies the speed gun, Lookout!!',$EEEE0000);
  1076. end;
  1077.  
  1078. if Text = '/nextmap' then begin
  1079. UpdateCharVars();
  1080. end;
  1081.  
  1082. if LowerCase(Text) = '/shopoff' then begin
  1083. iniWrite('scripts/Shop/profit.ini','script','shop','0');
  1084. shop := False;
  1085. end;
  1086.  
  1087. if LowerCase(Text) = '/shopon' then begin
  1088. iniWrite('scripts/Shop/profit.ini','script','shop','1');
  1089. shop := True;
  1090. end;
  1091.  
  1092. if Lowercase(Text) = '/bossbot' then begin;
  1093. for i := 1 to 32 do
  1094. if IDToName(i) = 'Mr.Zombie' then begin
  1095. Command('/kick '+inttostr(i)+'');
  1096. Command('/addbot2 MRZOMBIEW');
  1097. WriteConsole(0,'You Hear the distant roar of a warlord zombie, that cant be good...', $00FFEE22);
  1098. break;
  1099. end
  1100. end;
  1101. end;
  1102.  
  1103. Function SetRank(ID:Byte; Rank, PlayerClass:String):String;
  1104. begin
  1105. iniWrite('Players/'+Accname[ID]+'.ini','stats','rank',Rank);
  1106. iniWrite('Players/'+Accname[ID]+'.ini','stats','class',PlayerClass);
  1107. RankDam[ID]:=RankNum[ID]*RankDamageMult;
  1108. WriteConsole(ID,'Congratulations on promotion soldier!',$EE81FAA1);
  1109. WriteConsole(ID,'You are now: '+Rank,$EE81FAA1);
  1110. WriteConsole(0,IDtoname(ID)+' has just ranked to '+Rank+'!',$EE81FAA1);
  1111. end;
  1112.  
  1113. procedure OnPlayerKill(Killer, Victim: byte; Weapon: string);
  1114. Var I: Integer;
  1115. begin
  1116. if CheckPlayerAdmin(Killer) then CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y') - 0, 0,0,1, 9, Killer);
  1117. //if idtoname(Victim) = '[Assassin]Mr.Zombie' then begin
  1118. //trKills[nametoid(BotOwner)]:=trKills[nametoid(BotOwner
  1119. //if IDtoname(Killer) = '[Warlord]Mr.Zombie' then CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y'), 0, 0,1000, 9, Victim);
  1120. if IDtoname(Victim) = '[Warlord]Mr.Zombie' then Command('/kick '+inttostr(Victim));
  1121. //Shoot(GetPlayerStat(Killer, 'x') - 10,Getplayerstat(Killer,'y') - 10, Getplayerstat(Victim,'x'), getplayerstat(Victim,'y'), 500, 1000, 4, Killer);
  1122. trKills[Killer]:=trKills[Killer]+1;
  1123. if Weapon = 'Barrett M82A1' then begin
  1124. barKills[Killer]:=barKills[Killer]+1;
  1125. if (Distance(GetPlayerStat(Killer,'x'),GetPlayerStat(Killer,'y'),GetPlayerStat(Victim,'x'),GetPlayerStat(Victim,'y')) >= 200) AND (greatgahooka[Killer] = False) then begin
  1126. Achievement(Killer, 'Ya Great Gahooka', 'greatgahooka');
  1127. greatgahooka[Killer]:=True;
  1128. end;
  1129.  
  1130. if (Distance(GetPlayerStat(Killer,'x'),GetPlayerStat(Killer,'y'),GetPlayerStat(Victim,'x'),GetPlayerStat(Victim,'y')) >= 50) AND (yeahyeah[Killer] = False) then begin
  1131. Achievement(Killer, 'Yeah Yeah we get it', 'yeahyeah');
  1132. yeahyeah[Killer]:=True;
  1133. end;
  1134. end;
  1135.  
  1136. if trKills[Killer] = 50 then begin
  1137. SetRank(Killer, 'Private', 'Player');
  1138. RankNum[Killer]:=1;
  1139. iniWrite('Players/'+IDtoname(Killer)+'.ini','stats','ranknum',inttostr(RankNum[Killer]));
  1140. WriteConsole(0,'Looks like this one might stay',$EE81FAA1);
  1141. WriteConsole(0,'Please make our newest Player feel welcome',$EE81FAA1);
  1142. end;
  1143.  
  1144. if trKills[Killer] = 200 then begin
  1145. SetRank(Killer, 'Corporal', 'Player');
  1146. RankNum[Killer]:=2;
  1147. iniWrite('Players/'+IDtoname(Killer)+'.ini','stats','ranknum',inttostr(RankNum[Killer]));
  1148. end;
  1149.  
  1150. if trKills[Killer] = 500 then begin
  1151. SetRank(Killer, 'Sergeant', 'Player');
  1152. RankNum[Killer]:=3;
  1153. iniWrite('Players/'+IDtoname(Killer)+'.ini','stats','ranknum',inttostr(RankNum[Killer]));
  1154. end;
  1155.  
  1156. if trKills[Killer] = 1000 then begin
  1157. SetRank(Killer, 'Captain', 'Officer');
  1158. WriteConsole(Killer,'Welcome to the ranks Rookie, great to have you with us',$EE81FAA1);
  1159. WriteConsole(0,'Please welcome our newest Officer',$EE81FAA1);
  1160. RankNum[Killer]:=4;
  1161. iniWrite('Players/'+IDtoname(Killer)+'.ini','stats','ranknum',inttostr(RankNum[Killer]));
  1162. end;
  1163.  
  1164. if trKills[Killer] = 3000 then begin
  1165. SetRank(Killer, 'Major', 'Officer');
  1166. RankNum[Killer]:=5;
  1167. iniWrite('Players/'+IDtoname(Killer)+'.ini','stats','ranknum',inttostr(RankNum[Killer]));
  1168. end;
  1169.  
  1170. if trKills[Killer] = 4500 then begin
  1171. SetRank(Killer, 'Colonel', 'Officer');
  1172. RankNum[Killer]:=6;
  1173. iniWrite('Players/'+IDtoname(Killer)+'.ini','stats','ranknum',inttostr(RankNum[Killer]));
  1174. end;
  1175.  
  1176. if trKills[Killer] = 6000 then begin
  1177. SetRank(Killer, 'General', 'Officer');
  1178. RankNum[Killer]:=7;
  1179. iniWrite('Players/'+IDtoname(Killer)+'.ini','stats','ranknum',inttostr(RankNum[Killer]));
  1180. end;
  1181.  
  1182. if trKills[Killer] = 10000 then begin
  1183. SetRank(Killer, 'Knight', 'Noble');
  1184. WriteConsole(0,'Please welcome our newest Noble',$EE81FAA1);
  1185. RankNum[Killer]:=8;
  1186. iniWrite('Players/'+IDtoname(Killer)+'.ini','stats','ranknum',inttostr(RankNum[Killer]));
  1187. end;
  1188.  
  1189. if trKills[Killer] = 20000 then begin
  1190. SetRank(Killer, 'Baron', 'Elite');
  1191. WriteConsole(0,'We have an Elite on the field, welcome to the Vet Ranks '+idtoname(Killer)+'!',$EE81FAA1);
  1192. RankNum[Killer]:=9;
  1193. iniWrite('Players/'+IDtoname(Killer)+'.ini','stats','ranknum',inttostr(RankNum[Killer]));
  1194. end;
  1195.  
  1196. if trKills[Killer] = 50000 then begin
  1197. SetRank(Killer, 'Earl', 'Elite');
  1198. RankNum[Killer]:=10;
  1199. iniWrite('Players/'+IDtoname(Killer)+'.ini','stats','ranknum',inttostr(RankNum[Killer]));
  1200. end;
  1201.  
  1202. if trKills[Killer] = 100000 then begin
  1203. SetRank(Killer, 'Warlord', 'FSG Veteran');
  1204. WriteConsole(0,GetPlayerStat(Killer, 'Name')+' Truly is an FSG Veteran',$EE81FAA1);
  1205. RankNum[Killer]:=12;
  1206. iniWrite('Players/'+IDtoname(Killer)+'.ini','stats','ranknum',inttostr(RankNum[Killer]));
  1207. end;
  1208. NKS[Killer]:=NKS[Killer]+1;
  1209. if NKS[Killer]=NKS[Victim] then begin
  1210. if NKS[Victim]>BKS[Victim] then BKS[Victim]:=NKS[Victim];
  1211. NKS[Victim]:=0;
  1212. end;
  1213.  
  1214. Killnum[Killer]:=Killnum[Killer]+1;
  1215. if shop then begin
  1216. GiveBonus(Killer,BonusID);
  1217. Cash :=Cash+1;
  1218. end;
  1219. if deathexp[Killer] then begin
  1220. {for i := 1 to 5 do}
  1221. CreateBullet(GetPlayerStat(i,'x'), GetPlayerStat(i,'y') - 0, 0,-200,100, 10, Killer);
  1222. Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,DED*EDM,25, Killer,10,EBN*2);
  1223. Sleep(1);
  1224. //WriteLn('Cash Updated');
  1225. //WriteConsole(0,'Global Player Cash: '+inttostr(Cash),$EE81FAA1);
  1226. //WriteLn('Cash Displayed');
  1227. end;
  1228. if Victim = Killer then begin //begin nova
  1229. // This message will only happen for selfkilling bots, though.
  1230. WriteConsole(0, IDtoName(Victim) + ' just annihilated himself', $00EE0000);
  1231. Nova(GetPlayerstat(Killer,'X'),Getplayerstat(Killer,'Y'),0,35,0, Killer,10,5);
  1232. Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,70,0, Killer,10,25);
  1233. Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,105,0, Killer,10,25);
  1234. Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,140,0, Killer,10,25);
  1235. Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,175,0, Killer,10,25);
  1236. Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,210,0, Killer,10,25);
  1237. Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,245,0, Killer,10,25);
  1238. Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,270,0, Killer,10,25);
  1239. Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,305,0, Killer,10,25);
  1240. Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,340,0, Killer,10,25);
  1241. Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,375,0, Killer,10,75);
  1242. Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,410,0, Killer,10,150);
  1243. sleep(30);
  1244. end;
  1245.  
  1246. if Getplayerstat(Killer,'Name') = 'Mr.Zombie' then begin
  1247. for I := 1 to DEXN do
  1248. begin
  1249. Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,DED*I,25, Victim,10,EBNNTT*I);
  1250. //Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,(DED*I)/2,25, Victim,10,EBNND);
  1251. //Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,(DED*I)/3,25, Victim,10,EBNNT);
  1252. Sleep(1);
  1253. for i:= 1 to 32 do begin
  1254. //if GetPlayerStat(i,'Team') = 1 then CreateBullet(GetPlayerStat(i,'x'), GetPlayerStat(i,'y') - 0, 0,-20,100, 10, Killer);
  1255. end;
  1256. end;
  1257. end;
  1258.  
  1259. if idtoname(Killer) = 'Mr.Zombie' then begin
  1260. KBZombie[Victim] := KBZombie[Victim]+1;
  1261.  
  1262. if KBZombie[Victim] = 50 then WriteConsole(0,''+idtoname(Victim)+' is getting owned, dats gotta hurt!',$00EEEE00);
  1263.  
  1264. if KBZombie[Victim] = 100 then begin
  1265. if not holyshit[Victim] then begin
  1266. Achievement(Victim, 'HOLY SHIT! Hes Still going!', 'holyshit');
  1267. holyshit[Victim] := True;
  1268. end;
  1269. Writeconsole(0, 'holy shit, '+idtoname(Victim)+' is getting totally owned and is still going! o.0', $00EEEE00);
  1270. end;
  1271. end;
  1272.  
  1273. if FlagCaptured[Victim] then FlagCaptured[Victim] := False;
  1274. if Flaghold[Victim] > 0 then Flaghold[Victim] := 0;
  1275. end;
  1276.  
  1277. procedure AppOnIdle(Ticks: integer);
  1278. begin
  1279. Timer:=Timer - 1;
  1280. if Timer = 0 then begin
  1281. Writeconsole(0,'Saving all accounts...',$0000FFFF);
  1282. //Command('/save');
  1283. for i:= 1 to 32 do if Getplayerstat(i,'Ping') > 0 then begin
  1284. if SpeedTimer[i] > 0 then Speedtimer[i] := SpeedTimer[i] - 1;
  1285. iniWrite('Players/'+IDtoname(i)+'.ini','stats','kills',inttostr(trKills[i]));
  1286. iniWrite('Players/'+IDtoname(i)+'.ini','stats','tupred',inttostr(TUPred[i]));
  1287. iniWrite('Players/'+IDtoname(i)+'.ini','stats','barkills',inttostr(barKills[i]));
  1288. iniWrite('Players/'+IDtoname(i)+'.ini','stats','ranknum',inttostr(RankNum[i]));
  1289. end;
  1290. iniWrite('scripts/Shop/profit.ini','profit','cash',inttostr(Cash));
  1291. //Sleep(2000);
  1292. Timer:=300;
  1293. Writeconsole(0,'Done!',$0000FFFF);
  1294. end;
  1295. for i:= 1 to 32 do if GetPlayerStat(i,'Active') AND GetPlayerStat(i,'Alive') then begin
  1296. if GetPlayerStat(i,'Human') then begin
  1297. if GetPlayerStat(i, 'Flagger') = False then FlagCaptured[i]:= False;
  1298. if FlagCaptured[i] then Flaghold[i]:=Flaghold[i]+1;
  1299. if (Flaghold[i] = 30) AND (catchme[i] = False) then begin
  1300. Achievement(i,'Catch Me if you can! :-)', 'catchme');
  1301. catchme[i] := True;
  1302. end;
  1303. if (Flaghold[i] = 60) AND (SoloChaser[i] = False) then begin
  1304. Achievement(i,'Solo Zombie Flagger Chaser','solochaser');
  1305. SoloChaser[i]:=True;
  1306. end;
  1307. if (Flaghold[i] = 120) AND (QuitTeasin[i] = False) then begin
  1308. Achievement(i,'Hey! Quit Teasin!','quitteasin');
  1309. QuitTeasin[i]:=True;
  1310. end;
  1311. TSec[i]:= TSec[i] + 1;
  1312. if TSec[i] = 60 then begin
  1313. TMin[i]:= TMin[i] + 1;
  1314. TSec[i]:= 0;
  1315. end;
  1316. end else begin
  1317. if TSec[i] > 0 then BTSec[i] := TSec[i];
  1318. TSec[i] := 0;
  1319. if TMin[i] > 0 then BTMin[i]:= TMin[i];
  1320. TMin[i] := 0;
  1321. CheckTime(i);
  1322. end;
  1323. end;
  1324. if GetPlayerStat(ID,'human') AND GetPlayerStat(ID,'Flagger') AND shop then Cash:=Cash+2;
  1325. if Timeleft = 1 then begin
  1326. for i := 1 to 32 do
  1327. begin
  1328. if GetPlayerStat(i,'Human') then begin
  1329. Cash:=Cash+Killnum[i];
  1330. WriteConsole(i,'Match Bonus!',$EE81FAA1);
  1331. WriteConsole(i,'Congrats, you have earned your team: '+inttostr(Killnum[i])+' bonus cash for kills this match',$EE81FAA1);
  1332. Tcash:=Tcash+Killnum[i];
  1333. end;
  1334. end;
  1335. WriteConsole(0,'Alpha Team Match Bonus: '+inttostr(Tcash)+' (+'+inttostr(Tcash)+' Cash)!',$EE00FFFF);
  1336. Tcash:=0;
  1337. end;
  1338.  
  1339. For PlayerID := 1 To 32 Do begin
  1340. if NTB[PlayerID] then begin
  1341. if ntTimer[PlayerID] > 0 then ntTimer[PlayerID]:=ntTimer[PlayerID]-1;
  1342. WriteConsole(PlayerID,''+inttostr(ntTimer[PlayerID])+'...',$EE00FFFF);
  1343. if ntTimer[PlayerID] = 0 then begin
  1344. WriteConsole(PlayerID,'Armed! keep your distance',$EE00FFFF);
  1345. NTB[PlayerID]:=False;
  1346. end;
  1347. if (ntTimer[PlayerID] = 0) AND (ntfTimer[PlayerID] > 0) then ntfTimer[PlayerID]:=ntfTimer[PlayerID]-1;
  1348. 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
  1349. WriteLn('Novas should be triggering now');
  1350. Nova(ntPosX[PlayerID],ntPosY[PlayerID],0,35,0, PlayerID,10,5);
  1351. Nova(ntPosX[PlayerID],ntPosY[PlayerID],0,70,0, PlayerID,10,25);
  1352. Nova(ntPosX[PlayerID],ntPosY[PlayerID],0,105,0, PlayerID,10,25);
  1353. Nova(ntPosX[PlayerID],ntPosY[PlayerID],0,140,0, PlayerID,10,25);
  1354. Nova(ntPosX[PlayerID],ntPosY[PlayerID],0,175,0, PlayerID,10,25);
  1355. Nova(ntPosX[PlayerID],ntPosY[PlayerID],0,210,0, PlayerID,10,25);
  1356. Nova(ntPosX[PlayerID],ntPosY[PlayerID],0,245,0, PlayerID,10,25);
  1357. Nova(ntPosX[PlayerID],ntPosY[PlayerID],0,270,0, PlayerID,10,25);
  1358. Nova(ntPosX[PlayerID],ntPosY[PlayerID],0,305,0, PlayerID,10,25);
  1359. Nova(ntPosX[PlayerID],ntPosY[PlayerID],0,340,0, PlayerID,10,25);
  1360. Nova(ntPosX[PlayerID],ntPosY[PlayerID],0,375,0, PlayerID,10,75);
  1361. Nova(ntPosX[PlayerID],ntPosY[PlayerID],0,410,0, PlayerID,10,150);
  1362. ntfTimer[PlayerID]:=30;
  1363. end;
  1364. end;
  1365. end;
  1366. end;
  1367.  
  1368. procedure OnFlagGrab(ID, TeamFlag: byte; GrabbedInBase: boolean);
  1369. begin
  1370. if not speedster[ID] then SpeedTimer[ID] := 5;
  1371. Cash:=Cash+5;
  1372. if NFT[ID] > 0 then begin
  1373. MovePlayer(ID,GetObjectStat(1,'X'), GetObjectStat(1, 'Y'));
  1374. WriteConsole(0,'Grab detected, I see you have a flag teleporter!',$EE81FAA1);
  1375. WriteConsole(0,'Teleporting you now '+IDtoName(ID)+'!',$EE81FAA1);
  1376. //i:=KillObject(2);
  1377. //SetSpawnStat(i,'x',GetPlayerStat(ID,'x'));
  1378. //SetSpawnStat(i,'y',GetPlayerStat(ID,'y'));
  1379. NFT[ID]:=NFT[ID]-1;
  1380. WriteConsole(ID,'You now have '+inttostr(NFT[ID])+' teleports remaining!',$EE81FAA1);
  1381. end;
  1382.  
  1383. if GetPlayerStat(ID, 'human') then FlagCaptured[ID] := True;
  1384. end;
  1385.  
  1386. function OnPlayerDamage(Victim, Shooter: byte; Damage: integer): integer;
  1387. //var result:Integer;
  1388. begin
  1389. //RankDam[Shooter]:=Damage+(Damage*(((RankNum[Shooter]+tna[Shooter])*RankDamageMult)/100));
  1390. TNA[Shooter]:=strtoint(ReadINI('Players/'+IDtoname(Shooter)+'.ini','stats','tna','0'));
  1391. DamagePerc[Shooter]:=(RankNum[Shooter]*RankDamageMult)+tna[Shooter];
  1392. if CheckPlayerAdmin(Shooter) then begin
  1393. if Getplayerstat(Victim,'alive') then CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y') - 0, 0,0,1, 9, Shooter);
  1394. //if Getplayerstat(Victim,'alive') then CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y') - 0, 0,0,1, 4, Shooter);
  1395. end;
  1396. RankDam[Shooter]:=Damage+(Damage*(DamagePerc[Shooter]/100));
  1397. result:=Damage + Rankdam[Shooter];
  1398. //WriteLn('should be adding '+inttostr(RankDam[Shooter])+' damage');
  1399.  
  1400. if IDtoname(Shooter) = '[Warlord]Mr.Zombie' then begin
  1401. DamCalc[Shooter]:=Damage+RankDam[Shooter];
  1402. //Result:=DamCalc[Shooter]*(1/100);
  1403. if Getplayerstat(Victim,'alive') then Result:=CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y'), 0,-10,100, 10, Shooter);
  1404. //if Getplayerstat(Victim,'alive') = False then break;
  1405. end;
  1406. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement