Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type TSection = record
- Name: string;
- Keys: array of string;
- end;
- type TINIFile = record
- Sections: array of TSection;
- end;
- 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 keyFound = false 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 sectionFound = false 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 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;
- const
- Grenade = 2;
- M79 = 4;
- CNade = 9;
- CPellet = 10;
- LAW = 12;
- Knife = 13;
- procedure BigBangDeath(Killer,Victim,BulletType:Byte; speed:Integer);
- var i, bdev, bnum:integer;
- begin
- bdev:= 35
- bnum:= 5
- for i:= 1 to 20 do begin
- Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),speed,bdev,100, Killer,BulletType,bnum);
- bdev:=bdev+35;
- bnum:=bnum+5;
- end;
- 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 ShootPlayer(Victim,Shooter:Byte;x,y,speed,dmg:single; Bullettype:Byte);
- var dist: single;
- var x2,y2:Integer;
- begin
- dist := Distance(x, y, Getplayerstat(Victim,'x'), GetPlayerStat(Victim,'y')) / speed;
- x2 := (GetplayerStat(Victim,'x') - x) / dist;
- y2 := (Getplayerstat(Victim,'y') - y) / dist;
- createbullet(x, y, x2, y2, dmg, Bullettype, Shooter);
- end;
- const
- ClBad = $FFFF44;
- ClGood = $EE00FF;
- PredTime = 25;
- RankDamageMult = 3;
- const RedFlag = 1;
- const BlueFlag = 2;
- Const
- T = True;
- F = False;
- Type
- Stats = Record
- LongTime: Boolean;
- TSec,Tmin,BTSec,BTMin: Integer;
- end;
- Type PLStats = Record
- PlayerID: Byte;
- Name: String;
- Kills: integer;
- Rank: integer;
- Caps: integer;
- Team: Byte;
- Achievements:integer;
- RankNum: Integer;
- RankName: String;
- DefSkill: String; // skill 1
- lvl1learned:Boolean;
- lvl1percentage:Integer;
- Specialty: String; // skill 2
- lvl2learned:Boolean;
- MFSkill: String; // skill 3
- lvl3learned:Boolean;
- THSkill: String; // skill 4
- lvl4learned:Boolean;
- ofsSkill: String; // skill 5
- lvl5learned:Boolean;
- MedSkill: String; // skill 6
- lvl6learned:Boolean;
- SmnSkill: String; // skill 7
- lvl7learned:Boolean;
- randnum:Integer;
- Admin:Boolean;
- OrigrankdamagePerc:Integer;
- RankDamageMultiplier:Integer;
- Killstreak:Integer;
- CashEarnt:Integer;
- end;
- Type Itemz = Record
- x:Integer;
- y:Integer;
- Name:string;
- TrigTimer:Integer;
- Armed:Boolean;
- Cool: Boolean;
- end;
- var
- Owner: Array [1..32] of PLStats;
- ItemOwner: Array [1..225] of PLStats;
- ItemInfo: Array [1..225] of Itemz;
- ItemID: Integer;
- Playerinfo: Array [1..32] of PLStats;
- z:Integer;
- ini: TINIFile;
- Cash,DEC,DECC,EBNN,EBNND,EBNNT,EBNNTT,EDMM,EDMMT,EDMMD,Tcash,i,i2,BonusID,ID,EBN,EBNM,ED,EDM,DED,Dude,DEXN,Bottoset,SetBotTeam:Integer;
- OBFLX,OBFLY,NBFLX,NBFLY,PlayerID:Integer;
- HC,Shop: Boolean;
- PStat,Skill: 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,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;
- 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 NewLogin(ID:Byte;Name,Pass:String);
- var afd:string;
- begin
- afd :='Players/'+Name+'.txt';
- WriteFile(afd, GetPlayerStat(ID,'IP')); //[1]
- WriteFile(afd, Name); //[2]
- WriteFile(afd, Pass); //[3]
- WriteFile(afd, '0'); //kills [4]
- WriteFile(afd,'Private First Class'); //rankname [5]
- WriteFile(afd,'0'); //ranknum [6]
- WriteFile(afd,'Rookie'); //classname [7]
- WriteFile(afd,'0'); //tna [8]
- WriteFile(afd, '0'); //barkills [9]
- WriteFile(afd,'0'); //tupred [10]
- WriteFile(afd,'false'); //TP t/f [11]
- WriteFile(afd,'false'); //greatgahooka t/f [12]
- WriteFile(afd,'false'); //yeahyeah t/f [13]
- WriteFile(afd,'false'); //speedster t/f [14]
- WriteFile(afd,'false'); //holyshit t/f [15]
- WriteFile(afd,'false'); //catchme t/f [16]
- WriteFile(afd,'false'); //solochaser t/f [17]
- WriteFile(afd,'false'); //quitteasin t/f [18]
- 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 temporary',$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);
- Playerinfo[ID].Kills:= strtoint(ReadINI('Players/'+Name+'.ini','stats','kills','0'));
- TP[ID]:=F;
- greatgahooka[ID]:=F;
- yeahyeah[ID]:=F;
- speedster[ID]:=F;
- holyshit[ID]:=F;
- catchme[ID]:=F;
- solochaser[ID]:=F;
- quitteasin[ID]:=F;
- Playerinfo[ID].lvl1percentage:=0;
- playerinfo[ID].defskill:= '';
- playerinfo[ID].lvl1learned:=F;
- playerinfo[ID].kills:=0;
- Playerinfo[ID].achievements:=0;
- end;
- function GetSkillPerk(ID:Byte; SkillPerk:String):String;
- begin
- Result := ReadINI('Players/'+Accname[ID]+'.ini','skills',SkillPerk,'*ERROR*');
- end;
- var acd:array of string;
- var afd:string;
- procedure ExistingLogin(ID:Byte;Name:String);
- begin
- afd :='Players/'+Name+'.txt';
- acd:= xsplit(readfile(afd),(chr(13)+chr(10)));
- Playerinfo[ID].Kills:= strtoint(acd[4]);
- Playerinfo[ID].achievements:=strtoint(acd[8]);
- Playerinfo[ID].Rankname:=acd[5];
- barKills[ID]:=strtoint(acd[9]);
- Playerinfo[ID].Ranknum:=strtoint(acd[6]);
- TP[ID]:=acd[11];
- Playerinfo[ID].achievements:=0;
- if TP[ID] then Playerinfo[ID].achievements:=Playerinfo[ID].achievements + 1;
- greatgahooka[ID]:=acd[12];
- if greatgahooka[ID] then Playerinfo[ID].achievements:=Playerinfo[ID].achievements + 1;
- yeahyeah[ID]:=acd[13];
- if yeahyeah[ID] then Playerinfo[ID].achievements:=Playerinfo[ID].achievements + 1;
- speedster[ID]:=acd[14];
- if speedster[ID] then Playerinfo[ID].achievements:=Playerinfo[ID].achievements + 1;
- DamagePerc[ID]:=(Playerinfo[ID].Ranknum*RankDamageMult)+Playerinfo[ID].achievements;
- holyshit[ID]:=acd[15];
- if holyshit[ID] then Playerinfo[ID].achievements:=Playerinfo[ID].achievements + 1;\
- catchme[ID]:=acd[16];
- if catchme[ID] then Playerinfo[ID].achievements:=Playerinfo[ID].achievements + 1;
- SoloChaser[ID]:=acd[17];
- if solochaser[ID] then Playerinfo[ID].achievements:=Playerinfo[ID].achievements + 1;
- QuitTeasin[ID]:=acd[18];
- if quitteasin[ID] then Playerinfo[ID].achievements:=Playerinfo[ID].achievements + 1;
- iniWrite('Players/'+Accname[ID]+'.ini','stats','tna',inttostr(Playerinfo[ID].achievements));
- Playerinfo[ID].lvl1percentage:=StrtoInt(ReadINI('Players/'+Accname[ID]+'.ini','skills','defpercent','10'));
- playerinfo[ID].defskill:= GetSkillPerk(ID,'lvl1');
- if getSkillPerk(ID,'lvl1') <> '*ERROR*' then playerinfo[ID].lvl1learned:=T;
- 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;
- Playerinfo[ID].achievements:=Playerinfo[ID].achievements+1;
- iniWrite('Players/'+Accname[ID]+'.ini','stats','tna',inttostr(Playerinfo[ID].achievements));
- 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]));
- Playerinfo[ID].achievements:=0;
- if TP[ID] then Playerinfo[ID].achievements:=Playerinfo[ID].achievements + 1;
- if greatgahooka[ID] then Playerinfo[ID].achievements:=Playerinfo[ID].achievements + 1;
- if yeahyeah[ID] then Playerinfo[ID].achievements:=Playerinfo[ID].achievements + 1;
- if speedster[ID] then Playerinfo[ID].achievements:=Playerinfo[ID].achievements + 1;
- if holyshit[ID] then Playerinfo[ID].achievements:=Playerinfo[ID].achievements + 1;
- if catchme[ID] then Playerinfo[ID].achievements:=Playerinfo[ID].achievements + 1;
- if solochaser[ID] then Playerinfo[ID].achievements:=Playerinfo[ID].achievements + 1;
- if quitteasin[ID] then Playerinfo[ID].achievements:=Playerinfo[ID].achievements + 1;
- iniWrite('Players/'+Accname[ID]+'.ini','stats','tna',inttostr(Playerinfo[ID].achievements));
- end;
- Procedure Setstats();
- begin
- BonusID:=4;
- 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
- Playerinfo[i].Kills:=strtoint(ReadINI('Players/'+IDtoname(i)+'.ini','stats','kills','0'));
- Playerinfo[i].achievements:=strtoint(ReadINI('Players/'+IDtoname(i)+'.ini','stats','tna','0'));
- TUPred[i]:=strtoint(ReadINI('Players/'+IDtoname(i)+'.ini','stats','tupred','0'));
- Playerinfo[i].Ranknum:=strtoint(ReadINI('Players/'+IDtoname(i)+'.ini','stats','ranknum','0'));
- end;
- end;
- end;
- procedure UpdateCharVars();
- begin
- for i := 1 to 32 do
- begin
- if GetPlayerStat(i,'Human') = true 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 = true 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 = true then WriteConsole(0,'Alpha Team Match Bonus: '+inttostr(Tcash)+' (+'+inttostr(Tcash)+' Cash)!',$EE00FFFF);
- Tcash:=0;
- end;
- Function SetRank(ID:Byte; Rank, PlayerClass:String; PRanknum: Integer):String;
- begin
- iniWrite('Players/'+Accname[ID]+'.ini','stats','rank',Rank);
- iniWrite('Players/'+Accname[ID]+'.ini','stats','class',PlayerClass);
- Playerinfo[ID].Ranknum:=Playerinfo[ID].Ranknum*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);
- Playerinfo[ID].Ranknum:=PRankNum;
- iniWrite('Players/'+Accname[ID]+'.ini','stats','ranknum',inttostr(Playerinfo[ID].Ranknum));
- end;
- function CheckPlayerDist(ID:Byte;chkpxID,chkpyID,Distance:Integer):Boolean;
- var Dist:Single;
- begin
- if RayCast(GetPlayerStat(ID,'x'),GetPlayerstat(ID,'y'),chkpxID,chkpyID,Dist,Distance) then Result:=T;
- end;
- function PlayerSeenFromFlag(ID,Flag:Byte):Boolean;
- var Dist:Single;
- begin
- if RayCast(GetPlayerStat(ID,'x'),GetPlayerstat(ID,'y'),GetObjectstat(Flag,'x'),GetObjectstat(Flag,'y'),Dist,5000000) then Result:=T;
- end;
- procedure SetSkillPerk(ID:Byte; lvl, SkillPerk:String);
- begin
- iniWrite('Players/'+Accname[ID]+'.ini','skills', lvl, SkillPerk);
- Skill:=SkillPerk;
- end;
- {Function SaveAccName(ID:Byte;):String;
- begin
- for i:= 1 to 32 do begin}
- Const
- prdat = 225;
- teampred = 600;
- serk = 200;
- teamserk= 600;
- nades = 3000;
- ally = 30000;
- holycross = 50000;
- speed = 200;
- teamspeed = 900;
- flagtele = 1000;
- turret = 30000;
- 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];
- ItemID:=1;
- 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 shop = True then begin
- Case Lowercase(Text) of
- '/save' : begin
- Writeconsole(ID,'Saved all accs, thanks for helping',$0000FFFF);
- {for i:= 1 to 32 do if Getplayerstat(i,'Ping') > 0 then begin
- iniWrite('Players/'+Accname[i]+'.ini','stats','kills',inttostr(Playerinfo[i].Kills));
- 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(Playerinfo[i].Ranknum));
- end;}
- iniWrite('scripts/Shop/profit.ini','profit','cash',inttostr(Cash));
- if TP[ID] = False then begin
- TP[ID]:=True;
- Achievement(ID,'Team Mate', 'TP');
- end;
- end;
- '/char' : begin
- Playerinfo[ID].achievements:=strtoint(ReadINI('Players/'+Accname[ID]+'.ini','stats','tna','*ERROR while loading achievements*'));
- DamagePerc[ID]:=(Playerinfo[ID].Ranknum*RankDamageMult)+Playerinfo[ID].achievements;
- if Playerinfo[ID].Admin = True then DamagePerc[ID]:=DamagePerc[ID]+10;
- WriteConsole(ID,'Your stats',$EE81FAA1);
- WriteConsole(ID,'Total Kills: '+inttostr(Playerinfo[ID].Kills)+'!',$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;
- '/cash' : begin
- WriteConsole(0,IdtoName(ID)+' has just requested Cash levels!',$EE81FAA1);
- WriteConsole(0,'Global Player Cash: '+inttostr(Cash),$EE81FAA1);
- end;
- '/buy pred' : begin
- if Cash < prdat then WriteConsole(0,IdtoName(ID)+' just tried to purchase predator, not enough funds!',$EE81FAA1);
- if Cash >= prdat then begin
- Cash :=Cash-prdat;
- WriteConsole(0,IdtoName(ID)+' has just bought predator for '+inttostr(prdat)+' Cash',$EE81FAA1);
- GiveBonus(ID, 1);
- SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),20);
- TUPred[ID]:=TUPred[ID]+1;
- end;
- end;
- '/buy tpred' : begin
- if Cash < teampred then WriteConsole(0,IdtoName(ID)+' just tried to purchase Team Predator, not enough funds!',$EE81FAA1);
- if Cash >= teampred then begin
- Cash :=Cash-teampred;
- WriteConsole(0,IdtoName(ID)+' has just bought Team Predator for '+inttostr(teampred)+' Cash',$EE81FAA1);
- for i := 1 to 32 do if GetPlayerStat(i,'Team') = 1 AND GetPlayerStat(i,'Alive') then begin
- GiveBonus(i, 1);
- TUPred[ID]:=TUPred[ID]+1;
- end;
- end;
- end;
- '/buy serk' : begin
- if Cash < 195 then WriteConsole(0,IdtoName(ID)+' just tried to purchase berserker, not enough funds!',$EE81FAA1);
- 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;
- '/buy bes' : begin
- if Cash < 200 then WriteConsole(0,IdtoName(ID)+' just tried to purchase The Beserker, not enough funds!',$EE81FAA1);
- 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;
- '/buy tbes' : begin
- if Cash < 600 then WriteConsole(0,IdtoName(ID)+' just tried to purchase Team Beserker, not enough funds!',$EE81FAA1);
- 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 if GetPlayerStat(i,'Team') = 1 AND GetPlayerStat(i,'Alive')=true then GiveBonus(i, 2);
- end;
- end;
- '/buy clusters' : begin
- if (Cash < 3000) AND (BonusID <> 5) then WriteConsole(0,IdtoName(ID)+' just tried to purchase the clusters, not enough funds!',$EE81FAA1);
- if BonusID = 5 then WriteConsole(ID,'cluster grenades are already in affect, try normal nades!',$EE81FAA1);
- if (Cash >= 3000) AND (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;
- '/buy nades' : begin
- if (Cash < 3000) AND (BonusID <> 4) then WriteConsole(0,IdtoName(ID)+' just tried to purchase the nades, not enough funds!',$EE81FAA1);
- if BonusID = 4 then WriteConsole(ID,'regular grenades are already in affect, try clusters!',$EE81FAA1);
- if (Cash >= 3000) AND (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;
- '/buy dex' : begin
- if Cash < DEC then WriteConsole(0,IdtoName(ID)+' just tried to purchase bigger bangs, not enough funds!',$EE81FAA1);
- 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;
- '/buy ally' : begin
- if Cash < 30000 then WriteConsole(0,IdtoName(ID)+' just tried to purchase an ally, not enough funds!',$EE81FAA1);
- if Cash >= 30000 then begin
- Cash :=Cash-30000;
- WriteConsole(0,IdtoName(ID)+' has just bought an ally for 30000 Cash',$EE81FAA1);
- Owner[Bottoset].Name := idtoname(ID);
- Owner[Bottoset].PlayerID := ID;
- Command('/setteam1 '+IntToStr(Bottoset));
- Bottoset:=Bottoset+1;
- end;
- end;
- '/buy holycross' : begin
- if Cash < 30000 then WriteConsole(0,IdtoName(ID)+' just tried to purchase Holy Cross, not enough funds!',$EE81FAA1);
- 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;
- '/buy speed' : begin
- if Cash < 600 then WriteConsole(0,IdtoName(ID)+' just tried to purchase the speed gun, not enough funds!',$EE81FAA1);
- if Cash >= 600 then begin
- WriteConsole(0,IdtoName(ID)+' has just bought the speed gun for 600 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-600;
- SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),18);
- end;
- end;
- '/buy tspeed' : begin
- if Cash < 900 then WriteConsole(0,IdtoName(ID)+' just tried to purchase Team Speed, not enough funds!',$EE81FAA1);
- 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 if GetPlayerStat(i,'Team') = 1 AND GetPlayerStat(i,'Alive') then SpawnObject(GetPlayerStat(i,'x'),GetPlayerStat(i,'y'),18);
- end;
- end;
- '/buy ftp' : begin
- if Cash < 10000 then WriteConsole(0,IdtoName(ID)+' just tried to purchase a Flag Teleport, not enough funds!',$EE81FAA1);
- 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;
- '/buy turret' : begin
- if Cash < 30000 then WriteConsole(0,IdtoName(ID)+' just tried to purchase an automated Turret, not enough funds!',$EE81FAA1);
- if (PlayerSeenFromFlag(ID,RedFlag)=F) AND (PlayerSeenfromFlag(ID, BlueFlag)=F) AND (Cash >= 30000) then begin
- SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y')-15,15);
- ItemOwner[ItemID].PlayerID:=ID;
- ItemOwner[ItemID].Team:=GetPlayerStat(ID,'Team');
- ItemInfo[ItemID].x:=GetPlayerStat(ID,'x');
- ItemInfo[ItemID].y:=GetPlayerStat(ID,'y');
- ItemInfo[ItemID].Name:= 'Auto Turret';
- ItemID := ItemID+1;
- Cash :=Cash-30000;
- WriteConsole(0,IdtoName(ID)+' has just bought an automated Turret for 30000 Cash',$EE81FAA1)
- end else begin
- WriteConsole(ID,'One of the Flags reports that they have a visual on you...',ClBad);
- WriteConsole(ID,'You cannot place a turret here',ClBad);
- end;
- end;
- '/buy mfg' : begin
- if Cash < 200000 then WriteConsole(0,IdtoName(ID)+' just tried to purchase a Massive Flak Gun (MFG), not enough funds!',$EE81FAA1);
- if (PlayerSeenFromFlag(ID,RedFlag)=F) AND (PlayerSeenfromFlag(ID, BlueFlag)=F) AND (Cash >= 200000) then begin
- SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y')-15,15);
- ItemOwner[ItemID].PlayerID:=ID;
- ItemOwner[ItemID].Team:=GetPlayerStat(ID,'Team');
- ItemInfo[ItemID].x:=GetPlayerStat(ID,'x');
- ItemInfo[ItemID].y:=GetPlayerStat(ID,'y');
- ItemInfo[ItemID].Name:= 'Massive Flak Gun';
- ItemID := ItemID+1;
- Cash :=Cash-200000;
- WriteConsole(0,IdtoName(ID)+' has just bought a Massive Flak Gun (MFG) for 200,000 Cash',$EE81FAA1)
- end else begin
- WriteConsole(ID,'One of the Flags reports that they have a visual on you...',ClBad);
- WriteConsole(ID,'You cannot place a turret here',ClBad);
- end;
- end;
- '/buy nuke turret' : begin
- if Cash < 50000 then WriteConsole(0,IdtoName(ID)+' just tried to purchase a Nuke Turret, not enough funds!',$EE81FAA1);
- if Cash >= 50000 then begin
- ItemOwner[ItemID].PlayerID:=ID;
- ItemInfo[ItemID].x:=GetPlayerStat(ID,'x');
- ItemInfo[ItemID].y:=GetPlayerStat(ID,'y');
- ItemInfo[ItemID].Name:= 'Nuke Turret';
- ItemInfo[ItemID].TrigTimer := 10;
- SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y')-15,15);
- ItemID := ItemID+1;
- 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;
- '/buy assassin' : begin
- for i := 1 to 32 do if idtoname(i) = 'Mr.Zombie' then begin
- waiting4bot[ID] := True;
- Command('/kick '+inttostr(i));
- Owner[i].Name := idtoname(ID);
- Owner[i].PlayerID := ID;
- Command('/addbot1 MRZOMBIEA');
- break;
- end;
- end;
- '/items' : begin
- WriteConsole(0,'/buy pred - gives u pred bonus - '+inttostr(prdat)+' 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 an automated turret - 30000 cash',$EE81FAA1);
- WriteConsole(0,'/buy nuke turret - gives you a nuke turret - 50000 cash',$EE81FAA1);
- WriteConsole(0,'-->Arms 10 sec after purchase, then a massive explosion',$EE81FAA1);
- WriteConsole(0,'when a zombie comes into range, then same again after 30 seconds',$EE81FAA1);
- WriteConsole(0,'/buy MFG - gives you a Massive Flak Gun (MFG) - 60000 cash',$EE81FAA1);
- WriteConsole(0,'MFG is a defensive turret, fires massive flak bullets at the enemy',$EE81FAA1);
- WriteConsole(0,'place anywhere out of sight of a flag',$EE81FAA1);
- end;
- '/dex on' : 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;
- '/dex off' : begin
- deathexp[ID]:=False;
- WriteConsole(ID,'Death explosions disabled for your ID, I hope you enjoyed it',$EE81FAA1);
- end;
- end;
- if (Playerinfo[ID].lvl1learned=F) AND (PlayerInfo[ID].Kills>50) then begin
- Case Lowercase(Text) of
- '/learn kerbam': begin
- PLayerInfo[ID].lvl1learned:=T;
- Playerinfo[ID].Defskill:= 'kerbam';
- SetSkillPerk(ID,'lvl1','kerbam');
- Playerinfo[ID].lvl1percentage:=10;
- iniWrite('Players/'+Accname[ID]+'.ini','skills','defpercent', inttostr(playerinfo[ID].lvl1percentage));
- WriteConsole(ID,'Perk: kerbam learned, your current chance is 10 percent, will increase with rank',ClGood);
- end;
- '/learn shield': begin
- PLayerInfo[ID].lvl1learned:=T;
- Playerinfo[ID].Defskill:= 'shield';
- SetSkillPerk(ID,'lvl1','shield');
- end;
- end;
- end else begin
- //WriteConsole(ID,'You cannot '+Text+' yet, Rookie, Keep Killin ;)',ClBad);
- end;
- if GetPiece(Text,' ',0) = '/create' then begin
- NewLogin(ID, GetPiece(Text,' ',1),GetPiece(Text,' ',2));
- AccName[ID]:= GetPiece(Text,' ',1);
- Playerinfo[ID].Ranknum:=strtoint(ReadINI('Players/'+Accname[ID]+'.ini','stats','ranknum','0'));
- Playerinfo[ID].achievements:=strtoint(ReadINI('Players/'+Accname[ID]+'.ini','stats','tna','0'));
- end;
- if GetPiece(Text,' ',0) = '/login' then begin
- afd :='Players/'+GetPiece(Text,' ',1)+'.txt';
- acd:= xsplit(readfile(afd),(chr(13)+chr(10)));
- if FileExists('Players/'+afd) = False then WriteConsole(ID,'This username does not exist or is incorrect, please try again',$EE81FAA1);
- if FileExists('Players/'+afd) then begin
- if GetPiece(Text,' ',2) <> acd[3] then WriteConsole(ID,'This password is incorrect, please try again',$EE81FAA1);
- if GetPiece(Text,' ',2) = acd[3] then begin
- Accname[ID]:= acd[2];
- WriteConsole(ID,'Login Successful, Welcome Back '+acd[2]+'!',$EE81FAA1);
- ExistingLogin(ID,Accname[ID]);
- end;
- end;
- end;
- end;
- end;
- procedure OnMapChange(NewMap: string);
- begin
- for i:= 1 to 32 do if Getplayerstat(i,'Ping') > 0 then iniWrite('Players/'+GetPlayerStat(i,'Name')+'.ini','stats','kills',inttostr(PlayerInfo[i].Kills));
- for i:= 1 to 32 do begin
- 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(Playerinfo[i].Kills));
- 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(Playerinfo[i].ranknum));
- end;
- for z := 1 to ItemID do ItemOwner[z].PlayerID:=0;
- ItemID:=1;
- OBFLX:=GetSpawnStat(6,'x');
- OBFLY:=GetSpawnStat(6,'x');
- For i := 1 to 32 do if shop = true then GiveBonus(i, BonusID);
- Tcash:=0;
- end;
- procedure OnPlayerRespawn(ID: byte);
- begin
- if shop = true then GiveBonus(ID,BonusID);
- end;
- procedure OnJoinTeam(ID, Team: byte);
- begin
- //if ReadINI('Players/'+IDtoname(ID)+'.ini','stats','admin','0') = '1' then Playerinfo[ID].Admin:=True;
- PlayerInfo[ID].Team:=Team;
- if shop = true then GiveBonus(ID, BonusID);
- end;
- Procedure OnJoinGame(ID,Team:Byte);
- begin
- ResetStats(ID);
- end;
- procedure OnFlagScore(ID, TeamFlag: byte);
- var ran:Integer;
- begin
- if (SpeedTimer[ID] > 0) AND (speedster[ID]=False) then begin
- speedster[ID]:=True;
- Achievement(ID,'Speedster','speedster');
- SpeedTimer[ID]:=-1;
- end;
- if shop = true then begin
- i:=Random(1,2);
- if (i = 1) AND (GetPlayerStat(ID,'Team') = 1) then begin
- for ran := 1 to 32 do if (GetPlayerStat(ran,'Alive')) then SpawnObject(GetPlayerStat(ran,'x'),GetPlayerStat(ran,'y'),18);
- end;
- if i = 2 then for ran := 1 to 32 do begin
- if GetPlayerStat(ran,'Team') = 1 then if GetPlayerStat(ran,'Alive') = true then if GetPlayerStat(ran,'Team') = 1 then begin
- GiveBonus(ran, 1);
- SpawnObject(GetPlayerStat(ran,'x'),GetPlayerStat(ran,'y'),20);
- TUPred[i]:=TUPred[i]+1;
- end;
- end;
- end;
- if shop = false then begin
- for i := 1 to 32 do if GetPlayerStat(ID,'Team') = 1 AND GetPlayerStat(i,'Alive') then begin
- GiveBonus(i, 1);
- SpawnObject(GetPlayerStat(i,'x'),GetPlayerStat(i,'y'),20);
- TUPred[i]:=TUPred[i]+1;
- end;
- end;
- TFC[ID]:=TFC[ID]+1;
- if HC = true then begin
- if GetPlayerStat(ID,'Human') = true 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 if GetPlayerStat(i,'Human') = false then CreateBullet(GetPlayerStat(i,'x'), GetPlayerStat(i,'y') - 0, 0,-20,100, 3, ID);
- end;
- Cash:=Cash+50
- WriteConsole(0,IdtoName(ID)+' earned Alpha Team 50 Cash for scoring under the Cross!',$EE81FAA1);
- end;
- if GetPlayerStat(ID,'Human') = true then begin
- WriteConsole(0,'Human Cappers Bonus @ '+IDtoName(ID)+'! (+50 cash)',$EE81FAA1);
- Cash:=Cash+50;
- end;
- if AlphaScore = 10 then UpdateCharVars();
- if BravoScore = 10 then UpdateCharVars();
- 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;
- Case Lowercase(Text) of
- '/deathexplode' : 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;
- '/nodeathexp' : 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;
- '/give apred' : begin
- for i := 1 to 32 do if GetPlayerStat(i,'Team') = 1 AND GetPlayerStat(i,'Alive') = true then begin
- GiveBonus(i, 1);
- SpawnObject(GetPlayerStat(i,'x'),GetPlayerStat(i,'y'),20);
- end;
- WriteConsole(0,'Admin has just given Alpha Team predator',$EE81FAA1);
- end;
- '/give bpred' : begin
- for i := 1 to 32 do if GetPlayerStat(i,'Team') = 2 then if GetPlayerStat(i,'Alive') = true then begin
- GiveBonus(i, 1);
- SpawnObject(GetPlayerStat(i,'x'),GetPlayerStat(i,'y'),20);
- end;
- WriteConsole(0,'Admin has just given the zombies predator, Lookout!!',$EEEE0000);
- end;
- '/give aspeed' : begin
- for i := 1 to 32 do if GetPlayerStat(i,'Team') = 1 AND GetPlayerStat(i,'Alive') then SpawnObject(GetPlayerStat(i,'x'),GetPlayerStat(i,'y'),18);
- WriteConsole(0,'Admin has just given Alpha team the speed gun!',$EE81FAA1);
- end;
- '/give bspeed' : begin
- for i := 1 to 32 do if GetPlayerStat(i,'Team') = 2 AND GetPlayerStat(i,'Alive') then SpawnObject(GetPlayerStat(i,'x'),GetPlayerStat(i,'y'),18);
- WriteConsole(0,'Admin has just given the zombies the speed gun, Lookout!!',$EEEE0000);
- end;
- '/nextmap' : UpdateCharVars();
- '/shopoff' : begin
- iniWrite('scripts/Shop/profit.ini','script','shop','0');
- shop := False;
- Writeconsole(0,'Items have just been disabled',ClBad);
- end;
- '/shopon' : begin
- iniWrite('scripts/Shop/profit.ini','script','shop','1');
- shop := True;
- WriteConsole(0,'Items have just been enabled, have fun',ClBad);
- end;
- '/bossbot' : 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;
- end;
- procedure OnPlayerKill(Killer, Victim: byte; Weapon: string);
- Var I: Integer;
- var Grencount:Array of Integer;
- begin
- PlayerInfo[Killer].Killstreak:=PlayerInfo[Killer].Killstreak + 1;
- if Playerinfo[Victim].Killstreak > 0 then PlayerInfo[Victim].Killstreak:=0;
- Case idtoname(Victim) of
- '[Assassin]Mr.Zombie' : if (Owner[Killer].Name <> '') then PlayerInfo[Owner[Killer].PlayerID].Kills:=Playerinfo[Owner[Killer].PlayerID].Kills+1;
- 'Mr.Zombie' : if (Owner[Killer].Name <> '') then PlayerInfo[Owner[Killer].PlayerID].Kills:=Playerinfo[Owner[Killer].PlayerID].kills+1;
- '[Warlord]Mr.Zombie' : begin
- Cash:=Cash+5000;
- BotChat(Victim,'ARgh! you are a better fighter than me '+idtoname(Killer)+'!');
- Command('/kick '+inttostr(Victim));
- Writeconsole(0,idtoname(killer)+' has earnt Alpha team 5,000 Cash for a warlord kill',ClGood);
- end;
- end;
- //Shoot(GetPlayerStat(Killer, 'x') - 10,Getplayerstat(Killer,'y') - 10, Getplayerstat(Victim,'x'), getplayerstat(Victim,'y'), 500, 1000, 4, Killer);
- Playerinfo[Killer].kills:=playerinfo[Killer].Kills+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
- greatgahooka[Killer]:=True;
- Achievement(Killer, 'Ya Great Gahooka', 'greatgahooka');
- end;
- if (Distance(GetPlayerStat(Killer,'x'),GetPlayerStat(Killer,'y'),GetPlayerStat(Victim,'x'),GetPlayerStat(Victim,'y')) >= 50) AND (yeahyeah[Killer] = False) then begin
- yeahyeah[Killer]:=True;
- Achievement(Killer, 'Yeah Yeah we get it', 'yeahyeah');
- end;
- end;
- Case Playerinfo[Killer].kills of
- 50 : begin
- SetRank(Killer, 'Private', 'Player', 1);
- WriteConsole(0,'Looks like this one might stay',$EE81FAA1);
- WriteConsole(0,'Please make our newest Player feel welcome',$EE81FAA1);
- if (PlayerInfo[Killer].lvl1learned = False) AND (playerinfo[Killer].defskill = '') then begin
- Writeconsole(KIller,'congrats on your level',ClGood);
- WriteConsole(KIller,'you can now learn one of the following Defense skills/Perks:',ClGood);
- //Writeconsole(Killer,'/learn martyrdom - drops all of your remaining grenades live on death (perk)',ClGood);
- WriteConsole(Killer,'/learn kerbam - 10 percent chance of a tactic nuke on death (perk)',ClGood);
- //WriteConsole(Killer,'/learn shield - become invincable for 10 seconds (skill)',ClGood);
- //WriteConsole(KIller,'100 kills for every 1 charge of the shield, "/use shield" to use 1 charge',ClGood);
- Writeconsole(Killer,'these messages will appear each kill until you select a skill/perk',ClBad);
- end;
- end;
- 200 : SetRank(Killer, 'Corporal', 'Player', 2);
- 500 : SetRank(Killer, 'Sergeant', 'Player', 3);
- 1000 : begin
- SetRank(Killer, 'Captain', 'Officer', 4);
- WriteConsole(Killer,'Welcome to the ranks Rookie, great to have you with us',$EE81FAA1);
- WriteConsole(0,'Please welcome our newest Officer',$EE81FAA1);
- end;
- 3000 : SetRank(Killer, 'Major', 'Officer', 5);
- 4500 : SetRank(Killer, 'Colonel', 'Officer', 6);
- 6000 : SetRank(Killer, 'General', 'Officer', 7);
- 10000 : begin
- SetRank(Killer, 'Knight', 'Noble', 8);
- WriteConsole(0,'Please welcome our newest Noble',$EE81FAA1);
- end;
- 20000 : begin
- SetRank(Killer, 'Baron', 'Elite', 9);
- WriteConsole(0,'We have an Elite on the field, welcome to the Vet Ranks '+idtoname(Killer)+'!',$EE81FAA1);
- end;
- 50000 : SetRank(Killer, 'Earl', 'Elite', 10);
- 75000 : SetRank(Killer, 'Duke', 'Dealer of Zombie Death', 11);
- 100000 : begin
- SetRank(Killer, 'Warlord', 'FSG Veteran', 12);
- WriteConsole(0,GetPlayerStat(Killer, 'Name')+' Truly is an FSG Veteran',$EE81FAA1);
- end;
- end;
- if PlayerInfo[Victim].lvl1Learned = T then begin
- Case Playerinfo[Victim].DefSkill of
- 'kerbam': begin
- Playerinfo[Victim].randnum := Random(1,100);
- if Playerinfo[Victim].randnum <= Playerinfo[Victim].lvl1percentage then begin
- BigBangDeath(Victim,Victim,M79,5);
- Writeconsole(Victim,'KERBAM!!!',ClBad);
- writeconsole(0,idtoname(victim)+' just went Kerbam!',ClBad);
- end;
- end;
- 'martyrdom': begin
- Grencount[Victim]:= GetPlayerStat(Victim,'Grenades');
- Nova(GetPlayerstat(Victim,'x'),GetPlayerstat(Victim,'Y'),20,20,100, Victim,Grenade, Grencount[Victim]);
- end;
- end;
- end;
- NKS[Killer]:=NKS[Killer]+1;
- if (NKS[Killer]=NKS[Victim]) and (NKS[Victim]>BKS[Victim]) then BKS[Victim]:=NKS[Victim];
- NKS[Victim]:=0;
- Killnum[Killer]:=Killnum[Killer]+1;
- if shop = true then begin
- GiveBonus(Killer,BonusID);
- Cash :=Cash+PlayerInfo[Killer].Killstreak;
- Playerinfo[Killer].CashEarnt:=PlayerInfo[Killer].killstreak+Playerinfo[Killer].Killstreak;
- Writeconsole(Victim,'Cash Earnt this streak: +'+inttostr(Playerinfo[Victim].CashEarnt)+' Cash',$00EEFF00);
- If Playerinfo[Victim].CashEarnt <> 0 then Playerinfo[Victim].CashEarnt := 0;
- end;
- if deathexp[Killer] = true then begin
- 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 Getplayerstat(Killer,'Name') = 'Mr.Zombie' then for I := 1 to DEXN do begin
- Nova(GetPlayerstat(Victim,'X'),Getplayerstat(Victim,'Y'),0,DED*I,25, Victim,10,EBNNTT*I);
- Sleep(1);
- end;
- if idtoname(Killer) = 'Mr.Zombie' then begin
- if Owner[Killer].Name <> '' then Writeconsole(Owner[Killer].PlayerID,'your ally just made a kill',$00EEFF00);
- 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) AND (holyshit[Victim] = False) then begin
- holyshit[Victim] := True;
- Achievement(Victim, 'HOLY SHIT! Hes Still going!', 'holyshit');
- Writeconsole(0, 'holy shit, '+idtoname(Victim)+' is getting totally owned and is still going! o.0', $00EEEE00);
- end;
- end;
- if FlagCaptured[Victim] = True then FlagCaptured[Victim] := False;
- if Flaghold[Victim] > 0 then Flaghold[Victim] := 0;
- PlayerInfo[Killer].Rankdamagemultiplier:=PlayerInfo[Killer].Rankdamagemultiplier+1;
- if PlayerInfo[Victim].Rankdamagemultiplier > 1 then PlayerInfo[Victim].Rankdamagemultiplier:=1
- 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/'+Accname[i]+'.ini','stats','kills',inttostr(playerinfo[i].kills));
- 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));
- Timer:=300;
- Writeconsole(0,'Done!',$0000FFFF);
- end;
- for i:= 1 to 32 do if (GetPlayerStat(i,'Active') = true) AND (GetPlayerStat(i,'Alive') = true) then begin
- if GetPlayerStat(i,'Human') = true then begin
- if GetPlayerStat(i, 'Flagger') = False then FlagCaptured[i]:= False;
- if FlagCaptured[i] = true then Flaghold[i]:=Flaghold[i]+1;
- if (Flaghold[i] = 30) AND (catchme[i] = False) then begin
- catchme[i] := True;
- Achievement(i,'Catch Me if you can! :-)', 'catchme');
- end;
- if (Flaghold[i] = 60) AND (SoloChaser[i] = False) then begin
- SoloChaser[i]:=True;
- Achievement(i,'Solo Zombie Flagger Chaser','solochaser');
- end;
- if (Flaghold[i] = 120) AND (QuitTeasin[i] = False) then begin
- QuitTeasin[i]:=True;
- Achievement(i,'Hey! Quit Teasin!','quitteasin');
- end;
- TSec[i]:= TSec[i] + 1;
- if TSec[i] = 60 then begin
- TMin[i]:= TMin[i] + 1;
- TSec[i]:= 0;
- end;
- if GetPlayerStat(i,'Flagger') = False then begin
- Flaghold[i]:=0;
- FlagCaptured[i]:=F;
- 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') = true) AND (GetPlayerStat(ID,'Flagger') = true) AND (shop = True) then Cash:=Cash+2;
- if Timeleft = 1 then begin
- for i := 1 to 32 do begin
- if GetPlayerStat(i,'Human') = true 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 z := 1 To ItemID Do begin
- if ItemInfo[z].Name = 'Nuke Turret' then begin
- if (ItemInfo[z].TrigTimer > 0) AND (CheckPlayerDist(ItemOwner[z].PlayerID,ItemInfo[z].x,ItemInfo[z].y,200)) then ItemInfo[z].Trigtimer:=ItemInfo[z].TrigTimer-1;
- if (ItemInfo[z].TrigTimer > 0) AND (ItemInfo[z].Armed = False) AND (CheckPlayerDist(ItemOwner[z].PlayerID,ItemInfo[z].x,ItemInfo[z].y,200)) then WriteConsole(ItemOwner[z].PlayerID,''+inttostr(ItemInfo[z].TrigTimer)+'...',$EE00FFFF);
- if (ItemInfo[z].TrigTimer = 0) AND (ItemInfo[z].Armed = False) then begin
- WriteConsole(ItemOwner[z].PlayerID,'Armed! keep your distance',$EE00FFFF);
- ItemInfo[z].Armed:=T;
- end;
- if ItemInfo[z].TrigTimer > 0 then ItemInfo[z].Trigtimer:=ItemInfo[z].TrigTimer-1;
- if (ItemInfo[z].Trigtimer = 0) AND (ItemInfo[z].Armed) then for i := 1 to 32 do if (CheckPlayerDist(i,ItemInfo[z].x,Iteminfo[z].y,50)) AND (idtoname(i) = 'Mr.Zombie') then begin
- WriteLn('Novas should be triggering now');
- Nova(ItemInfo[z].x,ItemInfo[z].y,0,35,0, ItemOwner[z].PlayerID,10,5);
- Nova(ItemInfo[z].x,ItemInfo[z].y,0,70,0, ItemOwner[z].PlayerID,10,25);
- Nova(ItemInfo[z].x,ItemInfo[z].y,0,105,0, ItemOwner[z].PlayerID,10,25);
- Nova(ItemInfo[z].x,ItemInfo[z].y,0,140,0, ItemOwner[z].PlayerID,10,25);
- Nova(ItemInfo[z].x,ItemInfo[z].y,0,175,0, ItemOwner[z].PlayerID,10,25);
- Nova(ItemInfo[z].x,ItemInfo[z].y,0,210,0, ItemOwner[z].PlayerID,10,25);
- Nova(ItemInfo[z].x,ItemInfo[z].y,0,245,0, ItemOwner[z].PlayerID,10,25);
- Nova(ItemInfo[z].x,ItemInfo[z].y,0,270,0, ItemOwner[z].PlayerID,10,25);
- Nova(ItemInfo[z].x,ItemInfo[z].y,0,305,0, ItemOwner[z].PlayerID,10,25);
- Nova(ItemInfo[z].x,ItemInfo[z].y,0,340,0, ItemOwner[z].PlayerID,10,25);
- Nova(ItemInfo[z].x,ItemInfo[z].y,0,375,0, ItemOwner[z].PlayerID,10,75);
- Nova(ItemInfo[z].x,ItemInfo[z].y,0,410,0, ItemOwner[z].PlayerID,10,150);
- ItemInfo[z].Armed := F;
- ItemInfo[z].TrigTimer:=30;
- WriteConsole(ItemOwner[z].PlayerID,'one of your nuke turrets just got triggered', $00EEFF00);
- WriteConsole(0,'one of '+idtoname(ItemOwner[z].PlayerID)+'s nukes turrets just got triggered', $00EEFF00);
- end;
- end;
- if ItemInfo[z].Name='Massive Flak Gun' then for i := 1 to 32 do if (GetPlayerstat(i,'Active')=True) AND (GetPlayerstat(i,'Alive')=True) AND (CheckPlayerDist(i,ItemInfo[z].x,Iteminfo[z].y,600)) AND (GetPlayerStat(i,'Team')<>ItemOwner[z].Team) then Shoot(ItemInfo[z].x,Iteminfo[z].y,GetPlayerStat(i,'x'),GetPlayerstat(i,'y'),500,1000,4,ItemOwner[z].PlayerID);
- if ItemInfo[z].Name='Auto Turret' then for i := 1 to 32 do if (CheckPlayerDist(i,ItemInfo[z].x,Iteminfo[z].y,600)) AND (GetPlayerStat(i,'Team')<>ItemOwner[z].Team) then Shoot(ItemInfo[z].x,Iteminfo[z].y,GetPlayerStat(i,'x'),GetPlayerstat(i,'y'),5000,1000,1,ItemOwner[z].PlayerID);
- end;
- end;
- procedure OnFlagGrab(ID, TeamFlag: byte; GrabbedInBase: boolean);
- begin
- if speedster[ID] = false 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);
- NFT[ID]:=NFT[ID]-1;
- WriteConsole(ID,'You now have '+inttostr(NFT[ID])+' teleports remaining!',$EE81FAA1);
- end;
- if GetPlayerStat(ID, 'human') = true then FlagCaptured[ID] := True;
- end;
- function OnPlayerDamage(Victim, Shooter: byte; Damage: integer): integer;
- begin
- Playerinfo[Shooter].achievements:=strtoint(ReadINI('Players/'+IDtoname(Shooter)+'.ini','stats','tna','0'));
- DamagePerc[Shooter]:=(RankNum[Shooter]*RankDamageMult)+Playerinfo[Shooter].achievements;
- { if (Playerinfo[shooter].Admin=True) and (Getplayerstat(Victim,'alive')=True) then CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y') - 0, 0,0,1, 10, Shooter);}
- RankDam[Shooter]:=Damage+(Damage*(DamagePerc[Shooter]/100));
- result:=Damage + (Rankdam[Shooter]*Playerinfo[Shooter].Rankdamagemultiplier);
- if IDtoname(Shooter) = '[Warlord]Mr.Zombie' then begin
- DamCalc[Shooter]:=Damage+RankDam[Shooter];
- //Result:=DamCalc[Shooter]*(1/100);
- end;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement