Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const
- ClBad = $FFFF44;
- ClGood = $EE00FF;
- PredTime = 25;
- RankDamageMult = 3;
- //cash constants
- predat = 225;
- teampred = 600;
- serk = 200;
- teamserk= 600;
- nades = 3000;
- ally = 30000;
- holycross = 50000;
- speed = 200;
- teamspeed = 900;
- flagtele = 1000;
- turret = 30000;
- Type
- Stats = Record
- LongTime: Boolean;
- TSec,Tmin,BTSec,BTMin: Integer;
- end;
- type TSection = record
- Name: string;
- Keys: array of string;
- end;
- type TINIFile = record
- Sections: array of TSection;
- end;
- var
- ini: TINIFile;
- Cash,DEC,DECC,EBNN,EBNND,EBNNT,EBNNTT,EDMM,EDMMT,EDMMD,Tcash,i,i2:Integer;
- BonusID,ID,EBN,EBNM,ED,EDM,DED,Dude,DEXN,Bottoset,SetBotTeam:Byte;
- OBFLX,OBFLY,NBFLX,NBFLY,PlayerID:Integer;
- HC,Shop: Boolean;
- PStat: String;
- deathexp,HBFT,TA,NTB,NTA,NTAN,TP,greatgahooka,yeahyeah,speedster,Boolvar,holyshit,FlagCaptured,catchme,SoloChaser,QuitTeasin,waiting4bot:Array[1..32] of Boolean;
- 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;
- Player: Array[1..32] of Stats;
- TSec,Tmin,BTSec,BTMin,ntPosX,ntPosY,RankNum,RankDam,DamagePerc: Array[1..32] of Integer;
- nTurretPos:Integer;
- Timer:Integer;
- Dist:Single;
- iniPFile:String;
- Accname,BotOwner:Array [1..32] of String;
- function xsplit(const source: string; const delimiter: string):TStringArray;
- var
- i,x,d:integer;
- s:string;
- begin
- d:=length(delimiter);
- x:=0;
- i:=1;
- SetArrayLength(Result,1);
- while(i<=length(source)) do begin
- s:=Copy(source,i,d);
- if(s=delimiter) then begin
- inc(i,d);
- inc(x,1);
- SetArrayLength(result,x+1);
- end else begin
- result[x]:= result[x]+Copy(s,1,1);
- inc(i,1);
- end;
- end;
- end;
- function iniLoad(FileName: string): TINIFile;
- var
- iSections, iKeys, i: integer;
- lines: TStringArray;
- begin
- lines := xsplit(ReadFile(FileName), chr(13) + chr(10));
- iSections := 0;
- iKeys := 0;
- for i := 0 to GetArrayLength(lines) - 1 do
- begin
- if Length(lines[i]) > 0 then
- begin
- if (lines[i][1] = '[') and (lines[i][Length(lines[i])] = ']') then
- begin
- iSections := iSections + 1;
- iKeys := 0;
- SetArraylength(Result.Sections, iSections);
- Result.Sections[iSections - 1].Name := Copy(lines[i], 2, Length(lines[i]) - 2);
- end
- else if (iSections > 0) and (StrPos('=', lines[i]) > 0) then
- begin
- iKeys := iKeys + 1;
- SetArrayLength(Result.Sections[iSections - 1].Keys, iKeys);
- Result.Sections[iSections - 1].Keys[iKeys - 1] := lines[i];
- end;
- end;
- end;
- end;
- procedure iniSave(FileName: string; iniFile: TINIFile);
- var
- i, j: integer;
- data: string;
- begin
- for i := 0 to GetArrayLength(iniFile.Sections) - 1 do
- begin
- if Length(iniFile.Sections[i].Name) > 0 then
- begin
- data := data + '[' + iniFile.Sections[i].Name + ']' + chr(13) + chr(10);
- for j := 0 to GetArrayLength(iniFile.Sections[i].Keys) - 1 do
- if Length(iniFile.Sections[i].Keys[j]) > 0 then
- data := data + iniFile.Sections[i].Keys[j] + chr(13) + chr(10);
- if i < GetArrayLength(iniFile.Sections) - 1 then
- data := data + chr(13) + chr(10);
- end;
- end;
- WriteFile(FileName, data);
- end;
- function iniGetValue(var iniFile: TINIFile; section, key, errorResult: string): string;
- var
- i, j, idx: integer;
- begin
- Result := errorResult;
- if StrPos('=', key) > 0 then
- begin
- WriteLn('Error: the key can''t contain the character ''='' (asshole)');
- exit;
- end;
- for i := 0 to GetArrayLength(iniFile.Sections) - 1 do
- begin
- if LowerCase(iniFile.Sections[i].Name) = LowerCase(section) then
- begin
- for j := 0 to GetArrayLength(iniFile.Sections[i].Keys) - 1 do
- begin
- if GetPiece(iniFile.Sections[i].Keys[j], '=', 0) = key then
- begin
- idx := StrPos('=', iniFile.Sections[i].Keys[j]);
- Result := Copy(iniFile.Sections[i].Keys[j], idx + 1, Length(iniFile.Sections[i].Keys[j]));
- break;
- end;
- end;
- break;
- end;
- end;
- end;
- procedure iniSetValue(var iniFile: TINIFile; section, key, value: string);
- var
- i, j: integer;
- sectionFound, keyFound: boolean;
- begin
- if StrPos('=', key) > 0 then
- begin
- WriteLn('Error: the key can''t contain the character ''='' (asshole)');
- exit;
- end;
- sectionFound := false;
- keyFound := false;
- for i := 0 to GetArrayLength(iniFile.Sections) - 1 do
- begin
- if LowerCase(iniFile.Sections[i].Name) = LowerCase(section) then
- begin
- sectionFound := true;
- for j := 0 to GetArrayLength(iniFile.Sections[i].Keys) - 1 do
- begin
- if GetPiece(iniFile.Sections[i].Keys[j], '=', 0) = key then
- begin
- keyFound := true;
- iniFile.Sections[i].Keys[j] := key + '=' + value;
- break;
- end;
- end;
- if not keyFound then
- begin
- j := GetArrayLength(iniFile.Sections[i].Keys);
- SetArrayLength(iniFile.Sections[i].Keys, j + 1);
- iniFile.Sections[i].Keys[j] := key + '=' + value;
- end;
- break;
- end;
- end;
- if not sectionFound then
- begin
- i := GetArrayLength(iniFile.Sections);
- SetArrayLength(iniFile.Sections, i + 1);
- iniFile.Sections[i].Name := section;
- SetArrayLength(iniFile.Sections[i].Keys, 1);
- iniFile.Sections[i].Keys[0] := key + '=' + value;
- end;
- end;
- procedure iniDeleteSection(var iniFile: TINIFile; section: string);
- var
- i: integer;
- begin
- for i := 0 to GetArrayLength(iniFile.Sections) - 1 do
- begin
- if LowerCase(iniFile.Sections[i].Name) = LowerCase(section) then
- begin
- iniFile.Sections[i].Name := '';
- break;
- end;
- end;
- end;
- procedure iniDeleteKey(var iniFile: TINIFile; section, key: string);
- var
- i, j: integer;
- begin
- if StrPos('=', key) > 0 then
- begin
- WriteLn('Error: the key can''t contain the character ''='' (asshole)');
- exit;
- end;
- for i := 0 to GetArrayLength(iniFile.Sections) - 1 do
- begin
- if LowerCase(iniFile.Sections[i].Name) = LowerCase(section) then
- begin
- for j := 0 to GetArrayLength(iniFile.Sections[i].Keys) - 1 do
- begin
- if GetPiece(iniFile.Sections[i].Keys[j], '=', 0) = key then
- begin
- iniFile.Sections[i].Keys[j] := '';
- break;
- end;
- end;
- break;
- end;
- end;
- end;
- procedure iniWrite(FileName, section, key, value: string);
- var
- iniFile: TINIFile;
- begin
- iniFile := iniLoad(FileName);
- iniSetValue(iniFile, section, key, value);
- iniSave(FileName, iniFile);
- end;
- Procedure ResetStats(ID:Byte);
- begin
- Player[ID].LongTime := false;
- end;
- Procedure CheckTime(ID:Byte);
- begin
- if Player[ID].BTMin > LongestTime[1] then begin
- LongestTime[1] := Player[ID].BTMin;
- LongestTime[2] := Player[ID].BTSec;
- Player[ID].LongTime := true;
- WriteConsole(0,IDToName(ID) + ' beats the record! His surviving time is ' + inttostr(Player[ID].BTMin) + ' minutes and ' + inttostr(Player[ID].BTSec) + ' seconds!', ClGood);
- end else begin
- if Player[ID].BTMin = LongestTime[1] then
- if Player[ID].BTSec > LongestTime[2] then begin
- LongestTime[1] := Player[ID].BTMin;
- LongestTime[2] := Player[ID].BTSec;
- Player[ID].LongTime := true;
- WriteConsole(0,IDToName(ID) + ' beats the record! His surviving time is ' + inttostr(Player[ID].BTMin) + ' minutes and ' + inttostr(Player[ID].BTSec) + ' seconds!', ClGood);
- end;
- end;
- end;
- procedure ForceAchUpdate(ID:Byte; Ach:String);
- begin
- if ReadINI('Players/'+Accname[ID]+'.ini','achievements',Ach,'*ERROR*') = '*ERROR*' then iniWrite('Players/'+Accname[ID]+'.ini','achievements',Ach,'0');
- if ReadINI('Players/'+Accname[ID]+'.ini','achievements',Ach,'*ERROR while loading achievement*') = '1' then Boolvar[ID]:=True;
- if ReadINI('Players/'+Accname[ID]+'.ini','achievements',Ach,'*ERROR while loading achievement*') = '0' then Boolvar[ID]:=False;
- end;
- Procedure NewLogin(ID:Byte;Name,Pass:String);
- begin
- iniPFile :='Players/'+Name+'.ini';
- ini:=iniLoad(iniPFile);
- //WriteFile('Players/'+Name+'.txt',Name+':'+GetPlayerStat(ID,'IP'));
- WriteFile('Players/'+Name+'.ini','');
- iniPFile :='Players/'+Name+'.ini';
- ini:=iniLoad(iniPFile);
- IniWrite(IniPFile,'stats','IP', GetPlayerStat(ID,'IP'));
- IniWrite(IniPFile,'stats','user', Name);
- IniWrite(IniPFile,'stats','pass', Pass);
- IniWrite(IniPFile,'stats','reg', '1');
- IniWrite(IniPFile,'stats','kills', '0');
- iniWrite('Players/'+Name+'.ini','stats','rank','1');
- iniWrite('Players/'+Name+'.ini','stats','ranknum','0');
- iniWrite('Players/'+Name+'.ini','stats','class','1');
- IniWrite(IniPFile,'stats','tna', '0');
- IniWrite(IniPFile,'stats','barkills', '0');
- iniWrite('Players/'+Name+'.ini','stats','tupred','0');
- iniWrite('Players/'+Name+'.ini','achievements','TP','0');
- iniWrite('Players/'+Name+'.ini','achievements','greatgahooka','0');
- iniWrite('Players/'+Name+'.ini','achievements','yeahyeah','0');
- iniWrite('Players/'+Name+'.ini','achievements','speedster','0');
- iniWrite('Players/'+Name+'.ini','achievements','holyshit','0');
- iniWrite('Players/'+Name+'.ini','achievements','catchme','0');
- iniWrite('Players/'+Name+'.ini','achievements','solochaser','0');
- iniWrite('Players/'+Name+'.ini','achievements','quitteasin','0');
- WriteConsole(ID,'login system Activated, new user creation detected',$EE81FAA1);
- WriteConsole(ID,'you have been registered as: '+Name+' and your password has been recorded as: '+Pass+'!',$EE81FAA1);
- WriteConsole(ID,'Remember to login to your account when you join game',$EE81FAA1);
- WriteConsole(ID,'otherwise your stats will be recorded to your starter acc',$EE81FAA1);
- WriteConsole(ID,'you can create as many accs as you wish',$EE81FAA1);
- WriteConsole(ID,'if you need a password reset send an email to snowman533@gmail.com',$EE81FAA1);
- WriteConsole(ID,'remember to include your username in your email',$EE81FAA1);
- WriteConsole(ID,'unauthorized requests will be ignored and will get you banned',$EE81FAA1);
- WriteConsole(ID,'Now recording your stats to your new account',$EE81FAA1);
- WriteConsole(ID,'enjoy your stay :D',$EE81FAA1);
- WriteConsole(ID,'as you rank, your hits will become more powerful',$EE81FAA1);
- //WriteConsole(ID,'Admin will be notified if:',$EE81FAA1)
- //WriteConsole(ID,'you access this server from a different IP address using your current name',$EE81FAA1)
- //WriteConsole(ID,'should you have changed computers or ISPs resulting in IP change',$EE81FAA1)
- //WriteConsole(ID,'please contact admin: snowman533@gmail.com',$EE81FAA1)
- end;
- procedure ExistingLogin(ID:Byte;Name:String);
- begin
- //PStat:= Name+':'+GetPlayerStat(ID,'IP');
- trKills[ID]:= strtoint(ReadINI('Players/'+Name+'.ini','stats','kills','0'));
- iniPFile :='Players/'+Name+'.ini';
- ini:=iniLoad(iniPFile);
- barKills[ID]:=strtoint(ReadINI('Players/'+Name+'.ini','stats','barkills','0'));
- RankNum[ID]:=strtoint(ReadINI('Players/'+Name+'.ini','stats','ranknum','0'));
- ForceAchUpdate(ID, 'TP');
- TP[ID]:=Boolvar[ID];
- ForceAchUpdate(ID, 'greatgahooka');
- greatgahooka[ID]:=Boolvar[ID]
- ForceAchUpdate(ID, 'yeahyeah');
- yeahyeah[ID]:=Boolvar[ID];
- ForceAchUpdate(ID, 'speedster');
- speedster[ID]:=Boolvar[ID];
- TNA[ID]:=strtoint(ReadINI('Players/'+Name+'.ini','stats','tna','0'));
- DamagePerc[ID]:=(RankNum[ID]*RankDamageMult)+tna[ID];
- ForceAchUpdate(ID, 'holyshit');
- holyshit[ID]:=Boolvar[ID];
- ForceAchUpdate(ID, 'catchme');
- catchme[ID]:=Boolvar[ID];
- ForceAchUpdate(ID, 'solochaser');
- SoloChaser[ID]:=Boolvar[ID];
- ForceAchUpdate(ID, 'quitteasin');
- QuitTeasin[ID]:=Boolvar[ID];
- end;
- procedure Nova(const X,Y,speed,decentralize,power: single; ID,style: byte; n: integer);
- var i: integer;
- angle: single;
- begin
- angle := 2*pi/n;
- for i:=0 to n do
- CreateBullet(X+cos(angle*i)*decentralize, Y+sin(angle*i)*decentralize, cos(angle*i)*speed, sin(angle*i)*speed, power,style , ID );
- end;
- procedure Achievement(ID:Byte; BroadcastAch, WriteAch:String);
- begin
- WriteConsole(ID,BroadcastAch+'!',$EE81FAA1);
- WriteConsole(0,IdtoName(ID)+' has just completed the "'+BroadcastAch+'" achievement',$EE81FAA1);
- WriteConsole(0,'and has earned 500 Cash + 1% DO as an achievement bonus',$EE81FAA1);
- Cash:=Cash+500;
- TNA[ID]:=TNA[ID]+1;
- iniWrite('Players/'+Accname[ID]+'.ini','stats','tna',inttostr(TNA[ID]));
- iniWrite('Players/'+Accname[ID]+'.ini','achievements',WriteAch,'1');
- iniWrite('Players/'+Accname[ID]+'.ini','stats','tupred',inttostr(TUPred[ID]));
- iniWrite('Players/'+Accname[ID]+'.ini','stats','barkills',inttostr(barKills[ID]));
- end;
- procedure Shoot(x, y, x2, y2, speed, dmg: single; style, owner: byte);
- var dist: single;
- begin
- dist := Distance(x, y, x2, y2) / speed;
- x2 := (x2 - x) / dist;
- y2 := (y2 - y) / dist;
- createbullet(x, y, x2, y2, dmg, style, owner);
- end;
- Procedure Setstats();
- begin
- BonusID:=4;
- //Cash:=0;
- DEC:=3000;
- EBN:=2;
- EBNM:=1;
- EDM:=1;
- DED:=47;
- Bottoset:=2;
- DEXN:=1;
- EBNN:=EBN*30;
- EBNNTT:=45;
- EBNNT:=EBNN/3;
- EBNND:=EBNNT*2;
- EDMM:=DED*EDM;
- EDMMT:=EDMM/3;
- EDMMD:=EDMMT*2;
- SetBotTeam:=1;
- OBFLX:=GetSpawnStat(6,'x');
- OBFLY:=GetSpawnStat(6,'x');
- Timer:= 300;
- for i:= 1 to 32 do begin
- if Getplayerstat(i,'Ping') > 0 then begin
- trKills[i]:=strtoint(ReadINI('Players/'+IDtoname(i)+'.ini','stats','kills','0'));
- TNA[i]:=strtoint(ReadINI('Players/'+IDtoname(i)+'.ini','stats','tna','0'));
- TUPred[i]:=strtoint(ReadINI('Players/'+IDtoname(i)+'.ini','stats','tupred','0'));
- RankNum[i]:=strtoint(ReadINI('Players/'+IDtoname(i)+'.ini','stats','ranknum','0'));
- end;
- end;
- end;
- function CheckPlayerAdmin(ID:Byte):Boolean;
- begin
- if ReadINI('Players/'+IDtoname(ID)+'.ini','stats','admin','0') = '1' then Result:=True;
- end;
- procedure ActivateServer();
- begin
- Setstats();
- Cash := strtoint(ReadINI('scripts/Shop/profit.ini','profit','cash','0'));
- for i:= 1 to 32 do begin
- ForceAchUpdate(i, 'TP');
- TP[i]:=Boolvar[i];
- ForceAchUpdate(i, 'greatgahooka');
- greatgahooka[i]:=Boolvar[i]
- ForceAchUpdate(i, 'yeahyeah');
- yeahyeah[i]:=Boolvar[i];
- ForceAchUpdate(i, 'speedster');
- speedster[i]:=Boolvar[i];
- end;
- if ReadINI('scripts/Shop/profit.ini','script','shop','*ERROR*') = '1' then shop := True;
- if ReadINI('scripts/Shop/profit.ini','script','shop','*ERROR*') = '0' then shop := False;
- end;
- function OnPlayerCommand(ID: Byte; Text: string): boolean;
- begin
- if Lowercase(Text) = '/save' then begin
- Writeconsole(ID,'Saved all accs, thanks for helping',$0000FFFF);
- //Command('/save');
- for i:= 1 to 32 do if Getplayerstat(i,'Ping') > 0 then begin
- iniWrite('Players/'+Accname[i]+'.ini','stats','kills',inttostr(trKills[i]));
- iniWrite('Players/'+Accname[i]+'.ini','stats','tupred',inttostr(TUPred[i]));
- iniWrite('Players/'+Accname[i]+'.ini','stats','barkills',inttostr(barKills[i]));
- iniWrite('Players/'+Accname[i]+'.ini','stats','ranknum',inttostr(RankNum[i]));
- end;
- iniWrite('scripts/Shop/profit.ini','profit','cash',inttostr(Cash));
- if not TP[ID] then begin
- Achievement(ID,'Team Mate', 'TP');
- TP[ID]:=True;
- end;
- end;
- if Lowercase(Text) = '/char' then begin
- TNA[ID]:=strtoint(ReadINI('Players/'+Accname[ID]+'.ini','stats','tna','0'));
- DamagePerc[ID]:=(RankNum[ID]*RankDamageMult)+tna[ID];
- if checkplayeradmin(ID) then DamagePerc[ID]:=DamagePerc[ID]+10;
- WriteConsole(ID,'Your stats',$EE81FAA1);
- WriteConsole(ID,'Total Kills: '+inttostr(trKills[ID])+'!',$EE81FAA1);
- WriteConsole(ID,'Rank: '+ReadINI('Players/'+Accname[ID]+'.ini','stats','rank','*ERROR while loading rank*')+'!',$EE81FAA1);
- WriteConsole(ID,'Class: '+ReadINI('Players/'+Accname[ID]+'.ini','stats','class','*ERROR while loading class*')+'!',$EE81FAA1);
- WriteConsole(ID,'Total Barret Kills: '+inttostr(barKills[ID])+'!',$EE81FAA1);
- WriteConsole(ID,'Total number of Predators used: '+inttostr(TUPred[ID])+'!',$EE81FAA1);
- WriteConsole(ID,'Total number of Achievements: '+ReadINI('Players/'+Accname[ID]+'.ini','stats','tna','*ERROR while loading achievements*')+'!',$EE81FAA1);
- WriteConsole(ID,'Damage Output: +'+inttostr(DamagePerc[ID])+'%!',$EE81FAA1);
- end;
- if shop then begin
- if Lowercase(Text) = '/cash' then begin
- WriteConsole(0,IdtoName(ID)+' has just requested Cash levels!',$EE81FAA1);
- WriteConsole(0,'Global Player Cash: '+inttostr(Cash),$EE81FAA1);
- end;
- if Lowercase(Text) = '/buy pred' then begin
- if Cash < 200 then begin
- WriteConsole(0,IdtoName(ID)+' just tried to purchase predator, not enough funds!',$EE81FAA1);
- end;
- if Cash >= 200 then begin
- Cash :=Cash-200;
- WriteConsole(0,IdtoName(ID)+' has just bought predator for 200 Cash',$EE81FAA1);
- GiveBonus(ID, 1);
- SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),20);
- TUPred[ID]:=TUPred[ID]+1;
- end;
- end;
- if Lowercase(Text) = '/buy tpred' then begin
- if Cash < 600 then begin
- WriteConsole(0,IdtoName(ID)+' just tried to purchase Team Predator, not enough funds!',$EE81FAA1);
- end;
- if Cash >= 600 then begin
- Cash :=Cash-600;
- WriteConsole(0,IdtoName(ID)+' has just bought Team Predator for 600 Cash',$EE81FAA1);
- for i := 1 to 32 do
- begin
- if GetPlayerStat(i,'Team') = 1 then if GetPlayerStat(i,'Alive') then
- begin
- GiveBonus(i, 1);
- TUPred[ID]:=TUPred[ID]+1;
- end;
- end;
- end;
- end;
- if Lowercase(Text) = '/buy serk' then begin
- if Cash < 195 then begin
- WriteConsole(0,IdtoName(ID)+' just tried to purchase berserker, not enough funds!',$EE81FAA1);
- end;
- if Cash >= 195 then begin
- Cash :=Cash-195;
- WriteConsole(0,IdtoName(ID)+' has just bought berserker for 195 Cash',$EE81FAA1);
- GiveBonus(ID, 2);
- end;
- end;
- if Lowercase(Text) = '/buy bes' then begin
- if Cash < 200 then begin
- WriteConsole(0,IdtoName(ID)+' just tried to purchase The Beserker, not enough funds!',$EE81FAA1);
- end;
- if Cash >= 200 then begin
- Cash :=Cash-200;
- WriteConsole(0,IdtoName(ID)+' has just bought Beserker for 600 Cash',$EE81FAA1);
- GiveBonus(i, 2);
- end;
- end;
- if Lowercase(Text) = '/buy tbes' then begin
- if Cash < 600 then begin
- WriteConsole(0,IdtoName(ID)+' just tried to purchase Team Beserker, not enough funds!',$EE81FAA1);
- end;
- if Cash >= 600 then begin
- Cash :=Cash-600;
- WriteConsole(0,IdtoName(ID)+' has just bought Team Beserker for 600 Cash',$EE81FAA1);
- for i := 1 to 32 do
- begin
- if GetPlayerStat(i,'Team') = 1 then if GetPlayerStat(i,'Alive') then
- begin
- GiveBonus(i, 2);
- end;
- end;
- end;
- end;
- if Lowercase(Text) = '/buy clusters' then begin
- if Cash < 3000 then begin
- If BonusID <> 5 then begin
- WriteConsole(0,IdtoName(ID)+' just tried to purchase the clusters, not enough funds!',$EE81FAA1);
- end;
- end;
- if BonusID = 5 then begin
- WriteConsole(ID,'cluster grenades are already in affect, try normal nades!',$EE81FAA1);
- end;
- if Cash >= 3000 then begin
- If BonusID <> 5 then begin
- Cash :=Cash-3000;
- BonusID:=5;
- WriteConsole(0,IdtoName(ID)+' has just bought the cluster grenade upgrade for 3000 Cash',$EE81FAA1);
- GiveBonus(ID,BonusID);
- end;
- end;
- end;
- if Lowercase(Text) = '/buy nades' then begin
- if Cash < 3000 then begin
- If BonusID <> 4 then begin
- WriteConsole(0,IdtoName(ID)+' just tried to purchase the nades, not enough funds!',$EE81FAA1);
- end;
- end;
- if BonusID = 4 then begin
- WriteConsole(ID,'regular grenades are already in affect, try clusters!',$EE81FAA1);
- end;
- if Cash >= 3000 then begin
- If BonusID <> 4 then begin
- Cash :=Cash-3000;
- BonusID:=4;
- WriteConsole(0,IdtoName(ID)+' has just bought the regular grenade upgrade for 3000 Cash',$EE81FAA1);
- GiveBonus(ID,BonusID);
- end;
- end;
- end;
- if Lowercase(Text) = '/buy dex' then begin
- if Cash < DEC then begin
- WriteConsole(0,IdtoName(ID)+' just tried to purchase bigger bangs, not enough funds!',$EE81FAA1);
- end;
- if Cash >= DEC then begin
- EBNM :=EBNM+1;
- EBN :=3*EBNM;
- EDM :=EDM+1;
- ED := (5*EDM)+ED;
- DEXN :=DEXN+1;
- WriteConsole(0,IdtoName(ID)+' has just bought bigger bangs for '+inttostr(DEC)+' Cash',$EE81FAA1);
- Cash :=Cash-DEC;
- DECC :=DEC/3;
- DEC :=(DEC+DECC)*3;
- end;
- end;
- if Lowercase(Text) = '/buy ally' then begin
- if Cash < 30000 then begin
- WriteConsole(0,IdtoName(ID)+' just tried to purchase an ally, not enough funds!',$EE81FAA1);
- end;
- if Cash >= 30000 then begin
- Cash :=Cash-30000;
- WriteConsole(0,IdtoName(ID)+' has just bought an ally for 30000 Cash',$EE81FAA1);
- for i := 1 to 32 do begin
- if idtoname(i) = 'Mr.Zombie' then begin
- Command('/setteam1 '+IntToStr(i));
- break;
- end;
- end;
- end;
- end;
- if Lowercase(Text) = '/buy holycross' then begin
- if Cash < 30000 then begin
- WriteConsole(0,IdtoName(ID)+' just tried to purchase Holy Cross, not enough funds!',$EE81FAA1);
- end;
- if Cash >= 30000 then begin
- HC:=true;
- WriteConsole(0,IdtoName(ID)+' has just bought Holy Cross for 30000 Cash',$EE81FAA1);
- Cash:=Cash-30000;
- end;
- end;
- if Lowercase(Text) = '/buy speed' then begin
- if Cash < predat then begin
- WriteConsole(0,IdtoName(ID)+' just tried to purchase the speed gun, not enough funds!',$EE81FAA1);
- end;
- if Cash >= predat then begin
- WriteConsole(0,IdtoName(ID)+' has just bought the speed gun for '+inttostr(predat)+' Cash',$EE81FAA1);
- WriteConsole(ID,'Server PM: '+IdtoName(ID)+': remember, when you die, you lose the gun',$EE81FAA1);
- WriteConsole(ID,'Server PM: so use it wisely',$EE81FAA1);
- Cash:=Cash-predat;
- SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),18);
- end;
- end;
- if Lowercase(Text) = '/buy tspeed' then begin
- if Cash < 900 then begin
- WriteConsole(0,IdtoName(ID)+' just tried to purchase Team Speed, not enough funds!',$EE81FAA1);
- end;
- if Cash >= 900 then begin
- Cash :=Cash-900;
- WriteConsole(0,IdtoName(ID)+' has just bought Team Speed for 300 Cash',$EE81FAA1);
- for i := 1 to 32 do
- begin
- if GetPlayerStat(i,'Team') = 1 then if GetPlayerStat(i,'Alive') then
- begin
- SpawnObject(GetPlayerStat(i,'x'),GetPlayerStat(i,'y'),18);
- end;
- end;
- end;
- end;
- if Lowercase(Text) = '/buy ftp' then begin
- if Cash < 10000 then begin
- WriteConsole(0,IdtoName(ID)+' just tried to purchase a Flag Teleport, not enough funds!',$EE81FAA1);
- end;
- if Cash >= 10000 then begin
- Cash :=Cash-10000;
- WriteConsole(0,IdtoName(ID)+' has just bought a Flag Teleport for 10000 Cash',$EE81FAA1);
- NFT[ID]:=NFT[ID]+1;
- WriteConsole(ID,'You now have '+inttostr(NFT[ID])+' teleports!',$EE81FAA1);
- end;
- end;
- if Lowercase(Text) = '/buy turret' then begin
- if Cash < 30000 then begin
- WriteConsole(0,IdtoName(ID)+' just tried to purchase a Turret, not enough funds!',$EE81FAA1);
- end;
- if Cash >= 30000 then begin
- SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y')-15,15);
- Cash :=Cash-30000;
- WriteConsole(0,IdtoName(ID)+' has just bought a Turret for 30000 Cash',$EE81FAA1)
- end;
- end;
- if Lowercase(Text) = '/buy nuke turret' then begin
- if Cash < 50000 then begin
- WriteConsole(0,IdtoName(ID)+' just tried to purchase a Nuke Turret, not enough funds!',$EE81FAA1);
- end;
- if Cash >= 50000 then begin
- SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y')-15,15);
- ntPosX[ID]:=GetPlayerStat(ID,'x');
- ntPosY[ID]:=GetPlayerStat(ID,'y');
- ntTimer[ID]:= 10;
- NTB[ID]:=True;
- Cash :=Cash-50000;
- WriteConsole(0,IdtoName(ID)+' has just bought a Nuke Turret for 50000 Cash',$EE81FAA1);
- WriteConsole(ID,'Arming...stay close to arm it!',$EE81FAA1);
- end;
- end;
- if Lowercase(Text) = '/buy assassin' then begin
- waiting4bot[ID]:=True;
- for i := 1 to 32 do begin
- if idtoname(i) = 'Mr.Zombie' then begin
- Command('/kick '+inttostr(i));
- break;
- end;
- end;
- Command('/addbot1 MRZOMBIEA');
- end;
- if Lowercase(Text) = '/items' then begin
- WriteConsole(0,'/buy pred - gives u pred bonus - '+inttostr(predat)+' cash',$EE81FAA1);
- WriteConsole(0,'/buy tpred - gives all Alpha team pred bonus - 600 cash',$EE81FAA1);
- WriteConsole(0,'/buy serk - gives u berserker bonus - 195 cash',$EE81FAA1);
- WriteConsole(0,'/buy tbes - gives all Alpha team berserker bonus - 600 cash',$EE81FAA1);
- WriteConsole(0,'/buy clusters - upgrades your nade bonus to clusters - 3000 cash',$EE81FAA1);
- WriteConsole(0,'/buy nades - upgrades your cluster bonus to nades - 3000 cash',$EE81FAA1);
- WriteConsole(0,'---->grenade upgrades affects whole team',$EE81FAA1);
- WriteConsole(0,'/buy dex - upgrades normal death explosion size - '+inttostr(DEC)+' Cash',$EE81FAA1);
- WriteConsole(0,'---->does not affect suicides',$EE81FAA1);
- WriteConsole(0,'/buy holycross - Kills all zombies on Red Team score - 30000 cash',$EE81FAA1);
- WriteConsole(0,'/buy ally - brainwash a zombie to join Alpha team - 30000 cash',$EE81FAA1);
- WriteConsole(0,'/buy speed - gives you the flamer gun - 225 cash',$EE81FAA1);
- WriteConsole(0,'/buy tspeed - gives all Alpha team the flamer gun - 900 cash',$EE81FAA1);
- WriteConsole(0,'/buy FTP - Teleports you to your flag on grab of other - 10000 cash',$EE81FAA1);
- WriteConsole(0,'/buy turret - gives you a turret - 30000 cash',$EE81FAA1);
- end;
- if Lowercase(Text) = '/dex on' then begin
- deathexp[ID]:=True;
- WriteConsole(ID,'Death explosions enabled for your ID, have fun',$EE81FAA1);
- WriteConsole(ID,'consider others, before you leave please use /dex off',$EE81FAA1);
- end;
- if Lowercase(Text) = '/dex off' then begin
- deathexp[ID]:=False;
- WriteConsole(ID,'Death explosions disabled for your ID, I hope you enjoyed it',$EE81FAA1);
- end;
- end;
- if GetPiece(Text,' ',0) = '/create' then begin
- NewLogin(ID, GetPiece(Text,' ',1),GetPiece(Text,' ',2));
- end;
- if GetPiece(Text,' ',0) = '/login' then begin
- if not FileExists('Players/'+GetPiece(Text,' ',1)+'.ini') then WriteConsole(ID,'This username does not exist or is incorrect, please try again',$EE81FAA1);
- if FileExists('Players/'+GetPiece(Text,' ',1)+'.ini') then begin
- if GetPiece(Text,' ',2) <> ReadINI('Players/'+GetPiece(Text,' ',1)+'.ini','stats','pass','*ERROR*') then WriteConsole(ID,'This password is incorrect, please try again',$EE81FAA1);
- if GetPiece(Text,' ',2) = ReadINI('Players/'+GetPiece(Text,' ',1)+'.ini','stats','pass','*ERROR*') then begin
- Accname[ID]:= GetPiece(Text,' ',1);
- WriteConsole(ID,'Login Successful, Welcome Back '+GetPiece(Text,' ',1)+'!',$EE81FAA1);
- ExistingLogin(ID,Accname[ID]);
- end;
- end;
- end;
- end;
- procedure OnMapChange(NewMap: string);
- begin
- for i:= 1 to 32 do begin
- if Getplayerstat(i,'Ping') > 0 then iniWrite('Players/'+GetPlayerStat(i,'Name')+'.ini','stats','kills',inttostr(trKills[i]));
- TFC[i]:=0;
- BKS[i]:=0;
- NKS[i]:=0;
- NTB[i]:=False;
- ntTimer[i]:=0;
- ntfTimer[i]:=0;
- KBZombie[i]:=0;
- iniPFile :='Players/'+Accname[i]+'.ini';
- IniWrite(IniPFile,'stats','kills', inttostr(trKills[i]));
- iniWrite('Players/'+Accname[i]+'.ini','stats','barkills',inttostr(barKills[i]));
- iniWrite('scripts/Shop/profit.ini','profit','cash',inttostr(Cash));
- iniWrite('Players/'+Accname[i]+'.ini','stats','ranknum',inttostr(RankNum[i]));
- end;
- OBFLX:=GetSpawnStat(6,'x');
- OBFLY:=GetSpawnStat(6,'x');
- For i := 1 to 32 do
- begin
- if shop then GiveBonus(i, BonusID);
- end;
- Tcash:=0;
- end;
- procedure OnPlayerRespawn(ID: byte);
- begin
- if shop then GiveBonus(ID,BonusID);
- end;
- Procedure NewPlayer(ID:Byte);
- begin
- iniPFile :='Players/'+IDtoname(ID)+'.ini';
- ini:=iniLoad(iniPFile);
- //WriteFile('Players/'+GetPlayerStat(ID,'Name')+'.txt',IDtoname(ID)+':'+GetPlayerStat(ID,'IP'));
- WriteFile('Players/'+IDtoname(ID)+'.ini','');
- iniPFile :='Players/'+IDtoname(ID)+'.ini';
- ini:=iniLoad(iniPFile);
- IniWrite(IniPFile,'stats','IP', GetPlayerStat(ID,'IP'));
- IniWrite(IniPFile,'stats','reg', '1');
- IniWrite(IniPFile,'stats','kills', '0');
- iniWrite('Players/'+IDtoname(ID)+'.ini','stats','rank','1');
- iniWrite('Players/'+IDtoname(ID)+'.ini','stats','ranknum','0');
- iniWrite('Players/'+IDtoname(ID)+'.ini','stats','class','1');
- IniWrite(IniPFile,'stats','tna', '0');
- IniWrite(IniPFile,'stats','barkills', '0');
- iniWrite('Players/'+IDtoname(ID)+'.ini','stats','tupred','0');
- iniWrite('Players/'+IDtoname(ID)+'.ini','achievements','TP','0');
- iniWrite('Players/'+IDtoname(ID)+'.ini','achievements','greatgahooka','0');
- iniWrite('Players/'+IDtoname(ID)+'.ini','achievements','yeahyeah','0');
- iniWrite('Players/'+IDtoname(ID)+'.ini','achievements','speedster','0');
- iniWrite('Players/'+IDtoname(ID)+'.ini','achievements','holyshit','0');
- iniWrite('Players/'+IDtoname(ID)+'.ini','achievements','catchme','0');
- iniWrite('Players/'+IDtoname(ID)+'.ini','achievements','solochaser','0');
- iniWrite('Players/'+IDtoname(ID)+'.ini','achievements','quitteasin','0');
- WriteConsole(ID,'Automated login system Activated, new/unregistered user detected',$EE81FAA1);
- WriteConsole(ID,'Welcome '+idtoname(ID)+'!',$EE81FAA1);
- WriteConsole(ID,'Your player name has been registered to your IP: '+getplayerstat(ID,'IP'),$EE81FAA1);
- WriteConsole(ID,'should you need to change your name, ie add clan tags:',$EE81FAA1);
- WriteConsole(ID,'admin will update your registration details',$EE81FAA1);
- WriteConsole(ID,'remember you are allowed 3 different player names before being kicked',$EE81FAA1);
- WriteConsole(ID,'Beginning stats collection for your account',$EE81FAA1);
- WriteConsole(ID,'use !stats to see your current player stats',$EE81FAA1);
- WriteConsole(ID,'You will now receive achievements',$EE81FAA1);
- WriteConsole(ID,'enjoy your stay :D',$EE81FAA1);
- WriteConsole(ID,'as you rank, your hits will become more powerful',$EE81FAA1);
- //WriteConsole(ID,'Admin will be notified if:',$EE81FAA1)
- //WriteConsole(ID,'you access this server from a different IP address using your current name',$EE81FAA1)
- //WriteConsole(ID,'should you have changed computers or ISPs resulting in IP change',$EE81FAA1)
- //WriteConsole(ID,'please contact admin: snowman533@gmail.com',$EE81FAA1)
- end;
- procedure ExistingPlayer(ID:Byte);
- begin
- //PStat:= Idtoname(id)+':'+GetPlayerStat(ID,'IP');
- trKills[ID]:= strtoint(ReadINI('Players/'+IDtoname(ID)+'.ini','stats','kills','0'));
- WriteConsole(ID,'Automated Login System Activated',$EE81FAA1);
- WriteConsole(ID,'Welcome back '+idtoname(ID)+'!',$EE81FAA1);
- iniPFile :='Players/'+IDtoname(ID)+'.ini';
- ini:=iniLoad(iniPFile);
- barKills[ID]:=strtoint(ReadINI('Players/'+IDtoname(ID)+'.ini','stats','barkills','0'));
- RankNum[ID]:=strtoint(ReadINI('Players/'+IDtoname(ID)+'.ini','stats','ranknum','0'));
- ForceAchUpdate(ID, 'TP');
- TP[ID]:=Boolvar[ID];
- //if ReadINI('Players/'+IDtoname(ID)+'.ini','achievements','TP','*ERROR*') = '*ERROR*' then iniWrite('Players/'+IDtoname(ID)+'.ini','achievements','TP','0');
- //if ReadINI('Players/'+IDtoname(ID)+'.ini','achievements','TP','*ERROR while loading achievement*') = '1' then TP[ID]:=True;
- //if ReadINI('Players/'+IDtoname(ID)+'.ini','achievements','TP','*ERROR while loading achievement*') = '0' then TP[ID]:=False;
- ForceAchUpdate(ID, 'greatgahooka');
- greatgahooka[ID]:=Boolvar[ID]
- //if ReadINI('Players/'+IDtoname(ID)+'.ini','achievements','greatgahooka','*ERROR*') = '*ERROR*' then iniWrite('Players/'+IDtoname(ID)+'.ini','achievements','greatgahooka','0');
- //if ReadINI('Players/'+IDtoname(ID)+'.ini','achievements','greatgahooka','*ERROR while loading achievement*') = '1' then greatgahooka[ID]:=True;
- //if ReadINI('Players/'+IDtoname(ID)+'.ini','achievements','greatgahooka','*ERROR while loading achievement*') = '0' then greatgahooka[ID]:=False;
- ForceAchUpdate(ID, 'yeahyeah');
- yeahyeah[ID]:=Boolvar[ID];
- //if ReadINI('Players/'+IDtoname(ID)+'.ini','achievements','yeahyeah','*ERROR*') = '*ERROR*' then iniWrite('Players/'+IDtoname(ID)+'.ini','achievements','yeahyeah','0');
- //if ReadINI('Players/'+IDtoname(ID)+'.ini','achievements','yeahyeah','*ERROR while loading achievement*') = '1' then yeahyeah[ID]:=True;
- //if ReadINI('Players/'+IDtoname(ID)+'.ini','achievements','yeahyeah','*ERROR while loading achievement*') = '0' then yeahyeah[ID]:=False;
- ForceAchUpdate(ID, 'speedster');
- speedster[ID]:=Boolvar[ID];
- //if ReadINI('Players/'+IDtoname(ID)+'.ini','achievements','speedster','*ERROR*') = '*ERROR*' then iniWrite('Players/'+IDtoname(ID)+'.ini','achievements','speedster','0');
- //if ReadINI('Players/'+IDtoname(ID)+'.ini','achievements','speedster','*ERROR while loading achievement*') = '1' then speedster[ID]:=True;
- //if ReadINI('Players/'+IDtoname(ID)+'.ini','achievements','speedster','*ERROR while loading achievement*') = '0' then speedster[ID]:=False;
- TNA[ID]:=strtoint(ReadINI('Players/'+IDtoname(i)+'.ini','stats','tna','0'));
- DamagePerc[ID]:=(RankNum[ID]*RankDamageMult)+tna[ID];
- ForceAchUpdate(ID, 'holyshit');
- holyshit[ID]:=Boolvar[ID];
- ForceAchUpdate(ID, 'catchme');
- catchme[ID]:=Boolvar[ID];
- ForceAchUpdate(ID, 'solochaser');
- SoloChaser[ID]:=Boolvar[ID];
- ForceAchUpdate(ID, 'quitteasin');
- QuitTeasin[ID]:=Boolvar[ID];
- end;
- procedure OnJoinTeam(ID, Team: byte);
- begin
- if idtoname(ID) = '[Assassin]Mr.Zombie' then begin
- for i:=1 to 32 do begin
- if waiting4bot[i] then begin
- BotOwner[ID]:= idtoname(i);
- waiting4bot[i]:= False;
- break;
- end;
- end;
- end;
- if Team = 1 then begin
- if FileExists('Players/'+IDtoname(ID)+'.ini') then begin
- ExistingPlayer(ID);
- Accname[ID] := idtoname(ID);
- end;
- if not FileExists('Players/'+IDtoname(ID)+'.ini') then begin
- NewPlayer(ID);
- if shop then GiveBonus(ID, BonusID);
- end;
- end;
- end;
- Procedure OnJoinGame(ID,Team:Byte);
- begin
- ResetStats(ID);
- end;
- procedure UpdateCharVars();
- begin
- for i := 1 to 32 do
- begin
- if GetPlayerStat(i,'Human') then begin
- BKS[i]:= BKS[i];
- Cash:=Cash+(Killnum[i]*BKS[i]);
- TTCash[i]:=Killnum[i]*BKS[i];
- WriteConsole(i,'Match Bonus!',$EE81FAA1);
- WriteConsole(i,'Your performance this map:',$EE81FAA1);
- WriteConsole(i,'Total Kills: '+Inttostr(Killnum[i])+'!',$EE81FAA1);
- WriteConsole(i,'Total Flag Scores: '+inttostr(TFC[i])+'!',$EE81FAA1);
- WriteConsole(i,'Best Kill-Streak: '+inttostr(BKS[i])+'!',$EE81FAA1);
- WriteConsole(i,'Longest Time Survived: '+inttostr(BTMin[i])+':'+inttostr(BTSec[i])+' (M:S)!',$EE81FAA1);
- if shop then begin
- WriteConsole(i,'Congrats, you have earned your team: '+inttostr(Killnum[i]*BKS[I])+' bonus cash for kills this match',$EE81FAA1);
- Tcash:=Tcash+Killnum[i];
- end;
- end;
- end;
- if shop then WriteConsole(0,'Alpha Team Match Bonus: '+inttostr(Tcash)+' (+'+inttostr(Tcash)+' Cash)!',$EE00FFFF);
- Tcash:=0;
- end;
- procedure OnFlagScore(ID, TeamFlag: byte);
- begin
- if (SpeedTimer[ID] > 0) AND (IDtoname(ID) <> 'Mr.Zombie') AND (speedster[ID]=False) then begin
- Achievement(ID,'Speedster','speedster');
- speedster[ID]:=True;
- SpeedTimer[ID]:=-1;
- end;
- if shop then begin
- i:=Random(1,2);
- if i = 1 then if GetPlayerStat(ID,'Team') = 1 then begin
- for i := 1 to 32 do begin
- if GetPlayerStat(i,'Alive') then if GetPlayerStat(i,'Team') = 1 then
- begin
- SpawnObject(GetPlayerStat(i,'x'),GetPlayerStat(i,'y'),18);
- end;
- end;
- end;
- if i = 2 then for i := 1 to 32 do
- begin
- if GetPlayerStat(ID,'Team') = 1 then if GetPlayerStat(i,'Alive') then if GetPlayerStat(i,'Team') = 1 then
- begin
- GiveBonus(i, 1);
- SpawnObject(GetPlayerStat(i,'x'),GetPlayerStat(i,'y'),20);
- TUPred[i]:=TUPred[i]+1;
- end;
- end;
- end;
- if not shop then begin
- for i := 1 to 32 do
- begin
- if GetPlayerStat(ID,'Team') = 1 then if GetPlayerStat(i,'Alive') then if GetPlayerStat(i,'Team') = 1 then
- begin
- GiveBonus(i, 1);
- SpawnObject(GetPlayerStat(i,'x'),GetPlayerStat(i,'y'),20);
- TUPred[i]:=TUPred[i]+1;
- end;
- end;
- end;
- TFC[ID]:=TFC[ID]+1;
- if HC then begin
- if GetPlayerStat(ID,'Human') then
- begin
- WriteConsole(0,'Holy Cross Activated, Alpha team has scored!',$EE81FAA1);
- DrawText(0,'HULELUJA!',330,RGB(255,255,255),0.20,40,240);
- for i := 1 to 32 do
- begin
- if not GetPlayerStat(i,'Human') then
- begin
- CreateBullet(GetPlayerStat(i,'x'), GetPlayerStat(i,'y') - 0, 0,-20,100, 3, ID);
- Sleep(20);
- end;
- end;
- Cash:=Cash+50
- WriteConsole(0,IdtoName(ID)+' earned Alpha Team 50 Cash for scoring under the Cross!',$EE81FAA1);
- end;
- end;
- if GetPlayerStat(ID,'Human') then
- begin
- WriteConsole(0,'Human Cappers Bonus @ '+IDtoName(ID)+'! (+50 cash)',$EE81FAA1);
- Cash:=Cash+50;
- end
- if AlphaScore = 10 then begin
- UpdateCharVars();
- end;
- if BravoScore = 10 then begin
- UpdateCharVars();
- end;
- end;
- function OnCommand(ID: Byte; Text: string): boolean;
- begin
- if GetPiece(text,' ',0) = '/raisecash' then begin
- Cash := Cash + Strtoint(GetPiece(Text,' ',1));
- WriteConsole(0,'Admin has just deposited '+Getpiece(Text,' ',1)+' Global Player Cash!',$EE81FAA1);
- end;
- if Lowercase(Text) = '/deathexplode' then begin
- WriteConsole(0,'death explosions enabled', $00EE0000);
- WriteLn('death explosions have been enabled by ' + IntToStr(ID) + '!');
- for i := 1 to 32 do deathexp[i] := True;
- Command('/maxrespawntime 20');
- end;
- if Lowercase(Text) = '/nodeathexp' then begin
- WriteConsole(0,'death explosions disabled', $00EE0000);
- WriteLn('death explosions have been disabled by ' + IntToStr(ID) + '!');
- for i := 1 to 32 do deathexp[i] := False;
- Command('/maxrespawntime 2');
- end;
- if Lowercase(Text) = '/give apred' then begin
- for i := 1 to 32 do
- begin
- if GetPlayerStat(i,'Team') = 1 then if GetPlayerStat(i,'Alive') then
- begin
- GiveBonus(i, 1);
- SpawnObject(GetPlayerStat(i,'x'),GetPlayerStat(i,'y'),20);
- end;
- end;
- WriteConsole(0,'Admin has just given Alpha Team predator',$EE81FAA1);
- end;
- if Lowercase(Text) = '/give bpred' then begin
- for i := 1 to 32 do
- begin
- if GetPlayerStat(i,'Team') = 2 then if GetPlayerStat(i,'Alive') then
- begin
- GiveBonus(i, 1);
- SpawnObject(GetPlayerStat(i,'x'),GetPlayerStat(i,'y'),20);
- end;
- end;
- WriteConsole(0,'Admin has just given the zombies predator, Lookout!!',$EEEE0000);
- end;
- if Lowercase(Text) = '/give aspeed' then begin
- for i := 1 to 32 do
- begin
- if GetPlayerStat(i,'Team') = 1 then if GetPlayerStat(i,'Alive') then
- begin
- SpawnObject(GetPlayerStat(i,'x'),GetPlayerStat(i,'y'),18);
- end;
- end;
- WriteConsole(0,'Admin has just given Alpha team the speed gun!',$EE81FAA1);
- end;
- if Lowercase(Text) = '/give bspeed' then begin
- for i := 1 to 32 do
- begin
- if GetPlayerStat(i,'Team') = 2 then if GetPlayerStat(i,'Alive') then
- begin
- SpawnObject(GetPlayerStat(i,'x'),GetPlayerStat(i,'y'),18);
- end;
- end;
- WriteConsole(0,'Admin has just given the zombies the speed gun, Lookout!!',$EEEE0000);
- end;
- if Text = '/nextmap' then begin
- UpdateCharVars();
- end;
- if LowerCase(Text) = '/shopoff' then begin
- iniWrite('scripts/Shop/profit.ini','script','shop','0');
- shop := False;
- end;
- if LowerCase(Text) = '/shopon' then begin
- iniWrite('scripts/Shop/profit.ini','script','shop','1');
- shop := True;
- end;
- if Lowercase(Text) = '/bossbot' then begin;
- for i := 1 to 32 do
- if IDToName(i) = 'Mr.Zombie' then begin
- Command('/kick '+inttostr(i)+'');
- Command('/addbot2 MRZOMBIEW');
- WriteConsole(0,'You Hear the distant roar of a warlord zombie, that cant be good...', $00FFEE22);
- break;
- end
- end;
- end;
- Function SetRank(ID:Byte; Rank, PlayerClass:String):String;
- begin
- iniWrite('Players/'+Accname[ID]+'.ini','stats','rank',Rank);
- iniWrite('Players/'+Accname[ID]+'.ini','stats','class',PlayerClass);
- RankDam[ID]:=RankNum[ID]*RankDamageMult;
- WriteConsole(ID,'Congratulations on promotion soldier!',$EE81FAA1);
- WriteConsole(ID,'You are now: '+Rank,$EE81FAA1);
- WriteConsole(0,IDtoname(ID)+' has just ranked to '+Rank+'!',$EE81FAA1);
- end;
- procedure OnPlayerKill(Killer, Victim: byte; Weapon: string);
- Var I: Integer;
- begin
- if CheckPlayerAdmin(Killer) then CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y') - 0, 0,0,1, 9, Killer);
- //if idtoname(Victim) = '[Assassin]Mr.Zombie' then begin
- //trKills[nametoid(BotOwner)]:=trKills[nametoid(BotOwner
- //if IDtoname(Killer) = '[Warlord]Mr.Zombie' then CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y'), 0, 0,1000, 9, Victim);
- if IDtoname(Victim) = '[Warlord]Mr.Zombie' then Command('/kick '+inttostr(Victim));
- //Shoot(GetPlayerStat(Killer, 'x') - 10,Getplayerstat(Killer,'y') - 10, Getplayerstat(Victim,'x'), getplayerstat(Victim,'y'), 500, 1000, 4, Killer);
- trKills[Killer]:=trKills[Killer]+1;
- if Weapon = 'Barrett M82A1' then begin
- barKills[Killer]:=barKills[Killer]+1;
- if (Distance(GetPlayerStat(Killer,'x'),GetPlayerStat(Killer,'y'),GetPlayerStat(Victim,'x'),GetPlayerStat(Victim,'y')) >= 200) AND (greatgahooka[Killer] = False) then begin
- Achievement(Killer, 'Ya Great Gahooka', 'greatgahooka');
- greatgahooka[Killer]:=True;
- end;
- if (Distance(GetPlayerStat(Killer,'x'),GetPlayerStat(Killer,'y'),GetPlayerStat(Victim,'x'),GetPlayerStat(Victim,'y')) >= 50) AND (yeahyeah[Killer] = False) then begin
- Achievement(Killer, 'Yeah Yeah we get it', 'yeahyeah');
- yeahyeah[Killer]:=True;
- end;
- end;
- if trKills[Killer] = 50 then begin
- SetRank(Killer, 'Private', 'Player');
- RankNum[Killer]:=1;
- iniWrite('Players/'+IDtoname(Killer)+'.ini','stats','ranknum',inttostr(RankNum[Killer]));
- WriteConsole(0,'Looks like this one might stay',$EE81FAA1);
- WriteConsole(0,'Please make our newest Player feel welcome',$EE81FAA1);
- end;
- if trKills[Killer] = 200 then begin
- SetRank(Killer, 'Corporal', 'Player');
- RankNum[Killer]:=2;
- iniWrite('Players/'+IDtoname(Killer)+'.ini','stats','ranknum',inttostr(RankNum[Killer]));
- end;
- if trKills[Killer] = 500 then begin
- SetRank(Killer, 'Sergeant', 'Player');
- RankNum[Killer]:=3;
- iniWrite('Players/'+IDtoname(Killer)+'.ini','stats','ranknum',inttostr(RankNum[Killer]));
- end;
- if trKills[Killer] = 1000 then begin
- SetRank(Killer, 'Captain', 'Officer');
- WriteConsole(Killer,'Welcome to the ranks Rookie, great to have you with us',$EE81FAA1);
- WriteConsole(0,'Please welcome our newest Officer',$EE81FAA1);
- RankNum[Killer]:=4;
- iniWrite('Players/'+IDtoname(Killer)+'.ini','stats','ranknum',inttostr(RankNum[Killer]));
- end;
- if trKills[Killer] = 3000 then begin
- SetRank(Killer, 'Major', 'Officer');
- RankNum[Killer]:=5;
- iniWrite('Players/'+IDtoname(Killer)+'.ini','stats','ranknum',inttostr(RankNum[Killer]));
- end;
- if trKills[Killer] = 4500 then begin
- SetRank(Killer, 'Colonel', 'Officer');
- RankNum[Killer]:=6;
- iniWrite('Players/'+IDtoname(Killer)+'.ini','stats','ranknum',inttostr(RankNum[Killer]));
- end;
- if trKills[Killer] = 6000 then begin
- SetRank(Killer, 'General', 'Officer');
- RankNum[Killer]:=7;
- iniWrite('Players/'+IDtoname(Killer)+'.ini','stats','ranknum',inttostr(RankNum[Killer]));
- end;
- if trKills[Killer] = 10000 then begin
- SetRank(Killer, 'Knight', 'Noble');
- WriteConsole(0,'Please welcome our newest Noble',$EE81FAA1);
- RankNum[Killer]:=8;
- iniWrite('Players/'+IDtoname(Killer)+'.ini','stats','ranknum',inttostr(RankNum[Killer]));
- end;
- if trKills[Killer] = 20000 then begin
- SetRank(Killer, 'Baron', 'Elite');
- WriteConsole(0,'We have an Elite on the field, welcome to the Vet Ranks '+idtoname(Killer)+'!',$EE81FAA1);
- RankNum[Killer]:=9;
- iniWrite('Players/'+IDtoname(Killer)+'.ini','stats','ranknum',inttostr(RankNum[Killer]));
- end;
- if trKills[Killer] = 50000 then begin
- SetRank(Killer, 'Earl', 'Elite');
- RankNum[Killer]:=10;
- iniWrite('Players/'+IDtoname(Killer)+'.ini','stats','ranknum',inttostr(RankNum[Killer]));
- end;
- if trKills[Killer] = 100000 then begin
- SetRank(Killer, 'Warlord', 'FSG Veteran');
- WriteConsole(0,GetPlayerStat(Killer, 'Name')+' Truly is an FSG Veteran',$EE81FAA1);
- RankNum[Killer]:=12;
- iniWrite('Players/'+IDtoname(Killer)+'.ini','stats','ranknum',inttostr(RankNum[Killer]));
- end;
- NKS[Killer]:=NKS[Killer]+1;
- if NKS[Killer]=NKS[Victim] then begin
- if NKS[Victim]>BKS[Victim] then BKS[Victim]:=NKS[Victim];
- NKS[Victim]:=0;
- end;
- Killnum[Killer]:=Killnum[Killer]+1;
- if shop then begin
- GiveBonus(Killer,BonusID);
- Cash :=Cash+1;
- end;
- if deathexp[Killer] then begin
- {for i := 1 to 5 do}
- CreateBullet(GetPlayerStat(i,'x'), GetPlayerStat(i,'y') - 0, 0,-200,100, 10, Killer);
- Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,DED*EDM,25, Killer,10,EBN*2);
- Sleep(1);
- //WriteLn('Cash Updated');
- //WriteConsole(0,'Global Player Cash: '+inttostr(Cash),$EE81FAA1);
- //WriteLn('Cash Displayed');
- end;
- if Victim = Killer then begin //begin nova
- // This message will only happen for selfkilling bots, though.
- WriteConsole(0, IDtoName(Victim) + ' just annihilated himself', $00EE0000);
- Nova(GetPlayerstat(Killer,'X'),Getplayerstat(Killer,'Y'),0,35,0, Killer,10,5);
- Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,70,0, Killer,10,25);
- Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,105,0, Killer,10,25);
- Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,140,0, Killer,10,25);
- Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,175,0, Killer,10,25);
- Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,210,0, Killer,10,25);
- Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,245,0, Killer,10,25);
- Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,270,0, Killer,10,25);
- Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,305,0, Killer,10,25);
- Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,340,0, Killer,10,25);
- Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,375,0, Killer,10,75);
- Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,410,0, Killer,10,150);
- sleep(30);
- end;
- if Getplayerstat(Killer,'Name') = 'Mr.Zombie' then begin
- for I := 1 to DEXN do
- begin
- Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,DED*I,25, Victim,10,EBNNTT*I);
- //Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,(DED*I)/2,25, Victim,10,EBNND);
- //Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,(DED*I)/3,25, Victim,10,EBNNT);
- Sleep(1);
- for i:= 1 to 32 do begin
- //if GetPlayerStat(i,'Team') = 1 then CreateBullet(GetPlayerStat(i,'x'), GetPlayerStat(i,'y') - 0, 0,-20,100, 10, Killer);
- end;
- end;
- end;
- if idtoname(Killer) = 'Mr.Zombie' then begin
- KBZombie[Victim] := KBZombie[Victim]+1;
- if KBZombie[Victim] = 50 then WriteConsole(0,''+idtoname(Victim)+' is getting owned, dats gotta hurt!',$00EEEE00);
- if KBZombie[Victim] = 100 then begin
- if not holyshit[Victim] then begin
- Achievement(Victim, 'HOLY SHIT! Hes Still going!', 'holyshit');
- holyshit[Victim] := True;
- end;
- Writeconsole(0, 'holy shit, '+idtoname(Victim)+' is getting totally owned and is still going! o.0', $00EEEE00);
- end;
- end;
- if FlagCaptured[Victim] then FlagCaptured[Victim] := False;
- if Flaghold[Victim] > 0 then Flaghold[Victim] := 0;
- end;
- procedure AppOnIdle(Ticks: integer);
- begin
- Timer:=Timer - 1;
- if Timer = 0 then begin
- Writeconsole(0,'Saving all accounts...',$0000FFFF);
- //Command('/save');
- for i:= 1 to 32 do if Getplayerstat(i,'Ping') > 0 then begin
- if SpeedTimer[i] > 0 then Speedtimer[i] := SpeedTimer[i] - 1;
- iniWrite('Players/'+IDtoname(i)+'.ini','stats','kills',inttostr(trKills[i]));
- iniWrite('Players/'+IDtoname(i)+'.ini','stats','tupred',inttostr(TUPred[i]));
- iniWrite('Players/'+IDtoname(i)+'.ini','stats','barkills',inttostr(barKills[i]));
- iniWrite('Players/'+IDtoname(i)+'.ini','stats','ranknum',inttostr(RankNum[i]));
- end;
- iniWrite('scripts/Shop/profit.ini','profit','cash',inttostr(Cash));
- //Sleep(2000);
- Timer:=300;
- Writeconsole(0,'Done!',$0000FFFF);
- end;
- for i:= 1 to 32 do if GetPlayerStat(i,'Active') AND GetPlayerStat(i,'Alive') then begin
- if GetPlayerStat(i,'Human') then begin
- if GetPlayerStat(i, 'Flagger') = False then FlagCaptured[i]:= False;
- if FlagCaptured[i] then Flaghold[i]:=Flaghold[i]+1;
- if (Flaghold[i] = 30) AND (catchme[i] = False) then begin
- Achievement(i,'Catch Me if you can! :-)', 'catchme');
- catchme[i] := True;
- end;
- if (Flaghold[i] = 60) AND (SoloChaser[i] = False) then begin
- Achievement(i,'Solo Zombie Flagger Chaser','solochaser');
- SoloChaser[i]:=True;
- end;
- if (Flaghold[i] = 120) AND (QuitTeasin[i] = False) then begin
- Achievement(i,'Hey! Quit Teasin!','quitteasin');
- QuitTeasin[i]:=True;
- end;
- TSec[i]:= TSec[i] + 1;
- if TSec[i] = 60 then begin
- TMin[i]:= TMin[i] + 1;
- TSec[i]:= 0;
- end;
- end else begin
- if TSec[i] > 0 then BTSec[i] := TSec[i];
- TSec[i] := 0;
- if TMin[i] > 0 then BTMin[i]:= TMin[i];
- TMin[i] := 0;
- CheckTime(i);
- end;
- end;
- if GetPlayerStat(ID,'human') AND GetPlayerStat(ID,'Flagger') AND shop then Cash:=Cash+2;
- if Timeleft = 1 then begin
- for i := 1 to 32 do
- begin
- if GetPlayerStat(i,'Human') then begin
- Cash:=Cash+Killnum[i];
- WriteConsole(i,'Match Bonus!',$EE81FAA1);
- WriteConsole(i,'Congrats, you have earned your team: '+inttostr(Killnum[i])+' bonus cash for kills this match',$EE81FAA1);
- Tcash:=Tcash+Killnum[i];
- end;
- end;
- WriteConsole(0,'Alpha Team Match Bonus: '+inttostr(Tcash)+' (+'+inttostr(Tcash)+' Cash)!',$EE00FFFF);
- Tcash:=0;
- end;
- For PlayerID := 1 To 32 Do begin
- if NTB[PlayerID] then begin
- if ntTimer[PlayerID] > 0 then ntTimer[PlayerID]:=ntTimer[PlayerID]-1;
- WriteConsole(PlayerID,''+inttostr(ntTimer[PlayerID])+'...',$EE00FFFF);
- if ntTimer[PlayerID] = 0 then begin
- WriteConsole(PlayerID,'Armed! keep your distance',$EE00FFFF);
- NTB[PlayerID]:=False;
- end;
- if (ntTimer[PlayerID] = 0) AND (ntfTimer[PlayerID] > 0) then ntfTimer[PlayerID]:=ntfTimer[PlayerID]-1;
- 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
- WriteLn('Novas should be triggering now');
- Nova(ntPosX[PlayerID],ntPosY[PlayerID],0,35,0, PlayerID,10,5);
- Nova(ntPosX[PlayerID],ntPosY[PlayerID],0,70,0, PlayerID,10,25);
- Nova(ntPosX[PlayerID],ntPosY[PlayerID],0,105,0, PlayerID,10,25);
- Nova(ntPosX[PlayerID],ntPosY[PlayerID],0,140,0, PlayerID,10,25);
- Nova(ntPosX[PlayerID],ntPosY[PlayerID],0,175,0, PlayerID,10,25);
- Nova(ntPosX[PlayerID],ntPosY[PlayerID],0,210,0, PlayerID,10,25);
- Nova(ntPosX[PlayerID],ntPosY[PlayerID],0,245,0, PlayerID,10,25);
- Nova(ntPosX[PlayerID],ntPosY[PlayerID],0,270,0, PlayerID,10,25);
- Nova(ntPosX[PlayerID],ntPosY[PlayerID],0,305,0, PlayerID,10,25);
- Nova(ntPosX[PlayerID],ntPosY[PlayerID],0,340,0, PlayerID,10,25);
- Nova(ntPosX[PlayerID],ntPosY[PlayerID],0,375,0, PlayerID,10,75);
- Nova(ntPosX[PlayerID],ntPosY[PlayerID],0,410,0, PlayerID,10,150);
- ntfTimer[PlayerID]:=30;
- end;
- end;
- end;
- end;
- procedure OnFlagGrab(ID, TeamFlag: byte; GrabbedInBase: boolean);
- begin
- if not speedster[ID] then SpeedTimer[ID] := 5;
- Cash:=Cash+5;
- if NFT[ID] > 0 then begin
- MovePlayer(ID,GetObjectStat(1,'X'), GetObjectStat(1, 'Y'));
- WriteConsole(0,'Grab detected, I see you have a flag teleporter!',$EE81FAA1);
- WriteConsole(0,'Teleporting you now '+IDtoName(ID)+'!',$EE81FAA1);
- //i:=KillObject(2);
- //SetSpawnStat(i,'x',GetPlayerStat(ID,'x'));
- //SetSpawnStat(i,'y',GetPlayerStat(ID,'y'));
- NFT[ID]:=NFT[ID]-1;
- WriteConsole(ID,'You now have '+inttostr(NFT[ID])+' teleports remaining!',$EE81FAA1);
- end;
- if GetPlayerStat(ID, 'human') then FlagCaptured[ID] := True;
- end;
- function OnPlayerDamage(Victim, Shooter: byte; Damage: integer): integer;
- //var result:Integer;
- begin
- //RankDam[Shooter]:=Damage+(Damage*(((RankNum[Shooter]+tna[Shooter])*RankDamageMult)/100));
- TNA[Shooter]:=strtoint(ReadINI('Players/'+IDtoname(Shooter)+'.ini','stats','tna','0'));
- DamagePerc[Shooter]:=(RankNum[Shooter]*RankDamageMult)+tna[Shooter];
- if CheckPlayerAdmin(Shooter) then begin
- if Getplayerstat(Victim,'alive') then CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y') - 0, 0,0,1, 9, Shooter);
- //if Getplayerstat(Victim,'alive') then CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y') - 0, 0,0,1, 4, Shooter);
- end;
- RankDam[Shooter]:=Damage+(Damage*(DamagePerc[Shooter]/100));
- result:=Damage + Rankdam[Shooter];
- //WriteLn('should be adding '+inttostr(RankDam[Shooter])+' damage');
- if IDtoname(Shooter) = '[Warlord]Mr.Zombie' then begin
- DamCalc[Shooter]:=Damage+RankDam[Shooter];
- //Result:=DamCalc[Shooter]*(1/100);
- if Getplayerstat(Victim,'alive') then Result:=CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y'), 0,-10,100, 10, Shooter);
- //if Getplayerstat(Victim,'alive') = False then break;
- end;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement