Recently I wrote even a simple gamemode I put it only for proof that the the same something able.
This server is received from someone. I do not know from where it can flood me or I had a great jumping ping, so the server collapsed!
type tMine = record
owner: byte;
duration: integer;
X,Y: single;
end;
var
TalibType, TalibResVest, TalibGranade, TaliMag, TalibMines, TaliAmmo, TalibC4Limit, TalibSzpieg, SzpiegTime, StatTimes, StatDead, TalibStat: array[1..32] of integer;
SzpiegWep: array[1..32] of array[1..2] of integer;
TalibC4: array[1..32] of array[1..3] of integer;
PredUse, PredUse2, StatBuild: array[1..32] of boolean;
mine: array[1..32] of tMine;
MaxHealth: integer;
function NearestOpponent(ID,Team: byte; friendly: boolean): byte;
var
i: integer;
NearestDistance, tmpDistance: single;
NearestID: byte;
begin
NearestDistance:=-1;
NearestID:=0;
for i:=1 to 32 do
begin
if (Friendly = false) then if(GetPlayerStat(i,'Team') <> Team)and(GetPlayerStat(i,'active'))and(GetPlayerStat(i,'Alive')=true) then begin
tmpDistance:=Distance(GetPlayerStat(ID,'X'),GetPlayerStat(ID,'Y'),GetPlayerStat(i,'X'),GetPlayerStat(i,'Y'));
if(NearestDistance=-1) then begin
NearestDistance:=tmpDistance;
NearestID:=i;
end else if(tmpDistance<NearestDistance) then begin
NearestDistance:=tmpDistance;
NearestID:=i;
end;
end;
if (Friendly = true) then if(GetPlayerStat(i,'Team') = Team)and(GetPlayerStat(i,'active'))and(GetPlayerStat(i,'Alive')=true)and(i<>ID) then begin
tmpDistance:=Distance(GetPlayerStat(ID,'X'),GetPlayerStat(ID,'Y'),GetPlayerStat(i,'X'),GetPlayerStat(i,'Y'));
if(NearestDistance=-1) then begin
NearestDistance:=tmpDistance;
NearestID:=i;
end else if(tmpDistance<NearestDistance) then begin
NearestDistance:=tmpDistance;
NearestID:=i;
end;
end;
end;
Result:=NearestID;
end;
function lookForTarget(ID: byte; MinDistance, MaxDistance: integer; UsingRaycast: boolean): byte;
var
i,Team: byte; X,Y,X2,Y2,sqrdist,maxdist: single;
begin
GetPlayerXY(ID,X,Y);
maxdist:=MaxDistance*MaxDistance;
Result:=0;
Team := GetPlayerStat(ID, 'Team');
for i:=1 to 32 do if i <> ID then if GetPlayerStat(i, 'Active') then if GetPlayerStat(i, 'Alive') then if GetPlayerStat(i, 'team') <> Team then begin
GetPlayerXY(i,X2,Y2);
if UsingRayCast then if not RayCast(X,Y-7,X2,Y2-7,sqrdist,MaxDistance+1) then continue;
X2:=X2-X; Y2:=Y2-Y; sqrdist:=X2*X2+Y2*Y2;
if (sqrdist < maxdist) and (sqrdist >= MinDistance) then begin
Result:=i;
maxdist:=sqrdist;
end;
end;
end;
function arctan2(X, Y: single): single;
begin
if X < 0 then Result := arctan(Y/X) + Pi else
if X > 0 then Result := arctan(Y/X) else
if Y > 0 then Result := 2.3562 else
Result := -0.7854;
end;
function BallisticAim(x1, y1, x2, y2, v, gravity: single; var target_in_range: boolean): single;
var
x, y, sine, cosine, diff, last_diff, y3, g2, a, a2: single;
dir, last_dir: boolean;
kx_v, g_k_v, g_k2: single;
begin
x := x2 - x1;
y := y1 - y2; // inverted y axis
a := arctan2(x,y);
if x1 < x2 then begin // direction increasement angle
a2 := 0.3;
end else begin
a2 := -0.3;
end;
diff := 10e6;
kx_v := 0.01*x/v; // calculate constants
g2 := 0.135 * gravity / 0.06;
g_k_v := g2/0.01/v;
g_k2 := g2/0.01/0.01;
repeat
sine := sin(a); cosine := cos(a);
// y(x) = (tan(a) + g/k/v/cos(a))*x + g/k^2*ln(1 - k*x/v/cos(a)
y3 := (sine/cosine + g_k_v/cosine)*x + g_k2*LogN(2.71828182846, 1 - kx_v/cosine);
if y3 = 0 then begin // if NAN is returned - target is out of range
Result := -Result;
exit;
end;
last_diff := diff;
diff := abs(y3-y);
if diff < last_diff then Result := a;
if diff < 5 then break; // if found the angle
last_dir := dir;
dir := y3 > y;
if (dir) xor (last_dir) then begin // if passed the proper angle, change direction and increase accuracy
a2 := a2/-2;
end;
a := a + a2;
until false;
Result := -Result; // invert angle due to inverted y axis
target_in_range := true;
end;
procedure ResVar(ID:byte);
var i:integer;
begin
//~~~ Type ~~~
TalibType[ID] := 0;
//~~~ Mechanik ~~~
TalibResVest[ID] := 1;
//~~~ Żołnierz zaopatrzenia ~~~
TalibGranade[ID] := 1;
TaliMag[ID] := 1;
//~~~ Saper ~~~
TalibMines[ID] := 0;
TaliAmmo[ID] := 0;
//Stat ~~~ Wsparcie ogniowe ~~~
TalibC4Limit[ID] := 0;
for i := 1 to 3 do TalibC4[ID][i] := 0;
//~~~ Szpieg ~~~
TalibSzpieg[ID] := 0;
SzpiegTime[ID] := 0;
PredUse[ID] := false;
PredUse2[ID] := false;
for i := 1 to 2 do SzpiegWep[ID][i] := 0;
//~~~ Komandos ~~~
StatTimes[ID] := 0;
StatDead[ID] := 0;
TalibStat[ID] := 0;
StatBuild[ID] := false;
end;
Procedure WeapActive(ID, Team: byte);
begin
case (Team) of
1: begin
SetWeaponActive(ID, 1, false);
SetWeaponActive(ID, 2, false);
SetWeaponActive(ID, 3, true);
SetWeaponActive(ID, 4, false);
SetWeaponActive(ID, 5, true);
SetWeaponActive(ID, 6, true);
SetWeaponActive(ID, 7, false);
SetWeaponActive(ID, 8, false);
SetWeaponActive(ID, 9, true);
SetWeaponActive(ID, 10, false);
end;
2: begin
SetWeaponActive(ID, 1, true);
SetWeaponActive(ID, 2, true);
SetWeaponActive(ID, 3, false);
SetWeaponActive(ID, 4, true);
SetWeaponActive(ID, 5, false);
SetWeaponActive(ID, 6, false);
SetWeaponActive(ID, 7, true);
SetWeaponActive(ID, 8, true);
SetWeaponActive(ID, 9, true);
SetWeaponActive(ID, 10, false);
SetWeaponActive(ID, 13, false);
end;
end;
end;
procedure Wave(X,Y,Direction,Offset,Radius,Speed,Power,RoomPerBullet,Radiation: single; Bullettype,Bulletcount,Owner: byte);
var i: integer;
angle,centerX,centerY: single;
begin
centerX:=X-cos(Direction)*Radius;
centerY:=Y-sin(Direction)*Radius;
angle := (Bulletcount * RoomPerBullet) / (2 * pi * Radius);
for i:=-Bulletcount div 2 to Bulletcount div 2 + Bulletcount mod 2 do
CreateBullet(centerX+cos(Direction+angle*i)*Radius+cos(Direction)*Offset,centerY+sin(Direction+angle*i)*Radius+sin(Direction)*Offset, cos(Direction+angle*i*Radiation)*Speed, sin(Direction+angle*i*Radiation)*speed,power,Bullettype,Owner);
end;
procedure nova(X,Y,dir_x,dir_y,r,speed,power: single; n: word; style, id: byte);
var
angle,sine,cosine: single;
begin
angle:=6.28318/n;
for n:=n downto 1 do begin
sine:=sin(angle*n);
cosine:=cos(angle*n);
CreateBullet(cosine*r + X, sine*r + Y,cosine*speed + dir_x,sine*speed + dir_y,power, style, ID);
end;
end;
procedure Missile(owner_ID, target_ID: Byte; X, Y: Single);
var
poly_coll, target_coll: Boolean;
n, interval: Word;
X2, Y2, dist, next_dist_x, next_dist_y, prev_dist_x, prev_dist_y, rd: Single;
begin
GetPlayerXY(target_ID,X2,Y2);
dist:=Distance(X,Y,X2,Y2);
next_dist_x:=(X2-X)/(dist/10);
next_dist_y:=(Y2-Y)/(dist/10);
X:=X + next_dist_x;
Y:=Y + next_dist_y;
prev_dist_x:=next_dist_x;
prev_dist_y:=next_dist_y;
interval:=40;
while (n < 45) do begin
Sleep(interval);
next_dist_x:=((X2-X)/(dist/(20+40*2))+prev_dist_x*40) / (40+1);
next_dist_y:=((Y2-Y)/(dist/(24+40*2))+prev_dist_y*40) / (40+1);
prev_dist_x:=next_dist_x;
prev_dist_y:=next_dist_y;
X:=X + next_dist_x;
Y:=Y + next_dist_y;
GetPlayerXY(target_ID,X2,Y2);
dist:=Distance(X,Y,X2,Y2);
if dist > 80 then begin
if not rayCast(X,Y,X+15,Y,rd,16) then X:=X - 15 else if not rayCast(X,Y,X-15,Y,rd,16) then X:=X + 15;
if not rayCast(X,Y,X,Y+18,rd,19) then Y:=Y - 18 else if not rayCast(X,Y,X,Y-18,rd,19) then Y:=Y + 18;
end;
if dist < 25 then begin
target_coll:=true;
break;
end else if not RayCast(X,Y,X,Y,rd,1) then begin
poly_coll:=true;
break;
end;
if (dist > 10*2) then CreateBullet(X, Y, next_dist_x/10*2, next_dist_y/10*2, 0, 5, owner_ID);
if interval > 9 then interval:=interval-2;
n:=n+1;
end;
if target_coll then begin
DoDamageBy(target_ID, owner_ID, GetPlayerStat(target_ID, 'health')-1);
nova(X,Y,next_dist_x/2,next_dist_y/2,20,5,2,7,14,owner_ID);
nova(X2,Y2,0,0,30,8,2,9,14,owner_ID);
nova(X2,Y2,0,0,12,-3,10,5,4,owner_ID);
end else if poly_coll then begin
nova(X,Y,next_dist_x/2,next_dist_y/2,20,5,2,7,14,owner_ID);
nova(X,Y,0,0,20,-3,10,4,4,owner_ID);
end else begin //no fuel
nova(X,Y,next_dist_x/3,next_dist_y/2,20,5,2,7,14,owner_ID);
CreateBullet(X, Y, next_dist_x/2, next_dist_x/3, 10, 4, owner_ID);
end;
end;
procedure TalibFireBomb(ID: byte); //3
var X2, Y2: single;
begin
GetPlayerXY(ID,X2,Y2);
nova(X2,Y2,X2+20/2,Y2+20/2,20,5,2,7,14,ID);
nova(X2,Y2,0,0,12,-3,10,5,4,ID);
nova(X2,Y2,0,0,30,8,2,9,14,ID);
Wave(GetPlayerStat(ID,'X'),GetPlayerStat(ID,'Y'),0,80,50,5,2,10,1,12,50,ID);
if (GetPlayerStat(ID, 'Ground') = false) then DoDamage(ID, 800);
end;
procedure TalibTriper(ID: byte); //4
var
target: byte;
in_range: boolean;
begin
target:=NearestOpponent(ID,GetPlayerStat(ID,'Team'), false);
if (target = 0) then target := ID;
if(target<>0) then begin
Wave(GetPlayerStat(ID,'X'),GetPlayerStat(ID,'Y'),BallisticAim(GetPlayerStat(ID,'X'),GetPlayerStat(ID,'Y'),GetPlayerStat(target,'X')+GetPlayerStat(target,'VelX'),GetPlayerStat(target,'Y')+GetPlayerStat(target,'VelY'),11,0.06,in_range),10,10,7,650,15,1,12,2,ID);
nova(GetPlayerStat(ID,'X'),GetPlayerStat(ID,'Y'),0,0,30,8,2,9,14,ID);
nova(GetPlayerStat(ID,'X'),GetPlayerStat(ID,'Y'),0,0,12,-3,10,5,4,ID);
Wave(GetPlayerStat(ID,'X'),GetPlayerStat(ID,'Y'),BallisticAim(GetPlayerStat(ID,'X'),GetPlayerStat(ID,'Y'),GetPlayerStat(target,'X')+GetPlayerStat(target,'VelX'),GetPlayerStat(target,'Y')+GetPlayerStat(target,'VelY'),11,0.06,in_range),10,10,7,650,15,1,12,2,ID);
end else Wave(GetPlayerStat(ID,'X'),GetPlayerStat(ID,'Y'),BallisticAim(GetPlayerStat(ID,'X'),GetPlayerStat(ID,'Y'),0,0,7,0.06,in_range),10,10,10,650,15,1,12,2,ID);
if (GetPlayerStat(ID, 'Ground') = false) then DoDamage(ID, 800);
end;
Procedure TalibBoss(Talib: byte; DED: boolean); //1
var Vx,Vy: single;
begin
Vx := GetPlayerStat(Talib,'X');
Vy := GetPlayerStat(Talib,'Y');
CreateBullet(Vx,Vy,0,0,1100,4,Talib);
CreateBullet(Vx,Vy+10,0,0,1100,4,Talib);
CreateBullet(Vx,Vy+60,0,0,1100,4,Talib);
nova(Vx,Vy,0,0,25,8,2,9,14,Talib);
CreateBullet(Vx,Vy-30,0,0,1100,4,Talib);
CreateBullet(Vx,Vy-60,0,0,1100,4,Talib);
CreateBullet(Vx+30,Vy,0,0,1100,4,Talib);
CreateBullet(Vx+60,Vy,0,0,1100,4,Talib);
nova(Vx,Vy,0,0,30,8,2,9,14,Talib);
CreateBullet(Vx-30,Vy,0,0,1100,4,Talib);
CreateBullet(Vx-30,Vy-30,0,0,1100,4,Talib);
CreateBullet(Vx-60,Vy,0,0,1100,4,Talib);
CreateBullet(Vx+30,Vy-30,0,0,1100,4,Talib);
CreateBullet(Vx+30,Vy+30,0,0,1100,4,Talib);
nova(Vx,Vy,0,0,55,8,2,9,14,Talib);
CreateBullet(Vx-30,Vy-30,0,0,1100,4,Talib);
CreateBullet(Vx-30,Vy+30,0,0,1100,4,Talib);
if (GetPlayerStat(Talib, 'Ground') = false) then DoDamage(Talib, 800);
end;
procedure MaleMocneCos(x,y,r,step,speed,offset: single; style,shooter: integer; face: boolean); //2
var i,n: integer;
l,a,x1,y1: single;
begin
l := 1.5 * pi * r;
n := round(l / step);
a := step / r;
for i := 0 to n do begin
x1 := i * a * r;
y1 := sin(i * a - pi/2) * r;
CreateBullet(x + x1 * cos(offset) - y1 * sin(offset),y + x1 * sin(offset) + y1 * cos(offset),0,speed,0,style,shooter);
x1 := i * a * r;
y1 := sin(i * a + pi/2) * r;
CreateBullet(x + x1 * cos(offset) - y1 * sin(offset),y + x1 * sin(offset) + y1 * cos(offset),0,speed,0,style,shooter);
end;
end;
procedure TaliboO(ID: byte; Type1, Type2: integer);
var
MaxXL, MaxXP, MaxYG,X,Y: single;
begin
MaxXL:=0;
MaxXP:=0;
MaxYG:=0;
if(MaxXL=0)then MaxXL:=GetPlayerStat(ID,'X') else if(GetPlayerStat(ID,'X')<MaxXL) then MaxXL:=GetPlayerStat(ID,'X');
if(MaxXP=0)then MaxXP:=GetPlayerStat(ID,'X') else if(GetPlayerStat(ID,'X')>MaxXP) then MaxXP:=GetPlayerStat(ID,'X');
if(MaxYG=0)then MaxYG:=GetPlayerStat(ID,'Y') else if(GetPlayerStat(ID,'Y')<MaxYG) then MaxYG:=GetPlayerStat(ID,'Y');
X:=(MaxXL+MaxXP)/2;
Y:=MaxYG-15;
Wave(X,Y,0,0,12,6.5,4,3,3,type2,25,ID);
CreateBullet(X,Y,0,0,0,type1,ID);
CreateBullet(X-5,Y,0,0,0,type1,ID);
CreateBullet(X+5,Y,0,0,0,type1,ID);
CreateBullet(X-10,Y,0,0,0,type1,ID);
CreateBullet(X+10,Y,0,0,0,type1,ID);
if (GetPlayerStat(ID, 'Ground') = false) then DoDamage(ID, 800);
end;
procedure TaliboSrubki(ID: byte);
begin
CreateBullet(GetPlayerStat(ID,'X'),GetPlayerStat(ID,'y') ,0,0,0,4,ID);
CreateBullet(GetPlayerStat(ID,'X'),GetPlayerStat(ID,'y') ,0,0,0,5,ID);
Wave(GetPlayerStat(ID,'X'),GetPlayerStat(ID,'Y'),0,80,50,7,2,10,4,3,24,ID);
CreateBullet(GetPlayerStat(ID,'X'),GetPlayerStat(ID,'y') ,0,0,0,5,ID);
Wave(GetPlayerStat(ID,'X'),GetPlayerStat(ID,'Y'),0,80,50,4.5,2,10,1,8,20,ID);
CreateBullet(GetPlayerStat(ID,'X'),GetPlayerStat(ID,'y') ,0,0,0,5,ID);
CreateBullet(GetPlayerStat(ID,'X'),GetPlayerStat(ID,'y') ,0,0,0,5,ID);
Wave(GetPlayerStat(ID,'X'),GetPlayerStat(ID,'Y'),0,80,50,6,2,10,4,3,24,ID);
if (GetPlayerStat(ID, 'Ground') = false) then DoDamage(ID, 800);
end;
procedure Talibzgranatem(ID: byte);
begin
CreateBullet(GetPlayerStat(ID,'X'),GetPlayerStat(ID,'Y'),0,0,0,10,ID);
CreateBullet(GetPlayerStat(ID,'X'),GetPlayerStat(ID,'Y')+20,0,0,0,10,ID);
CreateBullet(GetPlayerStat(ID,'X'),GetPlayerStat(ID,'Y')+40,0,0,0,10,ID);
CreateBullet(GetPlayerStat(ID,'X')+20,GetPlayerStat(ID,'Y'),0,0,0,10,ID);
CreateBullet(GetPlayerStat(ID,'X')+40,GetPlayerStat(ID,'Y'),0,0,0,10,ID);
CreateBullet(GetPlayerStat(ID,'X')-20,GetPlayerStat(ID,'Y'),0,0,0,10,ID);
CreateBullet(GetPlayerStat(ID,'X')-40,GetPlayerStat(ID,'Y'),0,0,0,10,ID);
Wave(GetPlayerStat(ID,'X'),GetPlayerStat(ID,'Y'),0,80,50,7,4,12,6,12,6,ID);
CreateBullet(GetPlayerStat(ID,'X'),GetPlayerStat(ID,'Y'),0,0,0,5,ID);
CreateBullet(GetPlayerStat(ID,'X'),GetPlayerStat(ID,'Y'),0,0,0,5,ID);
CreateBullet(GetPlayerStat(ID,'X'),GetPlayerStat(ID,'Y'),0,0,0,5,ID);
CreateBullet(GetPlayerStat(ID,'X'),GetPlayerStat(ID,'Y'),0,4,0,3,ID);
CreateBullet(GetPlayerStat(ID,'X'),GetPlayerStat(ID,'Y'),6,4,0,3,ID);
CreateBullet(GetPlayerStat(ID,'X'),GetPlayerStat(ID,'Y'),-6,4,0,3,ID);
CreateBullet(GetPlayerStat(ID,'X'),GetPlayerStat(ID,'Y'),0,0,0,4,ID);
if (GetPlayerStat(ID, 'Ground') = false) then DoDamage(ID, 800);
end;
procedure PostawMine(ID: byte);
var placed: boolean; i: byte; X1,X2,Y1,Y2: single;
begin
if (GetPlayerStat(ID,'Alive')=true) then if (GetPlayerStat(ID,'Ground') = true) then begin
case GetPlayerStat(ID,'Team') of
1:GetFlagsSpawnXY(X1,Y1,X2,Y2);
2:GetFlagsSpawnXY(X2,Y2,X1,Y1);
end;
if (Distance(X1,Y1,X2,Y2) > 120) then begin
placed:=false;
i:=1;
while (placed = false) and (i < 33) do begin
if (mine[i].duration = 0) then begin
placed := true;
mine[i].duration := 160;
mine[i].owner := ID;
mine[i].X := GetPlayerStat(ID,'X');
mine[i].Y := GetPlayerStat(ID,'Y');
inc(TalibMines[ID], 1);
CreateBullet(GetPlayerStat(ID,'X'),GetPlayerStat(ID,'Y')-25,0,-3.5,0,7,ID);
DrawText(ID,'Mine placed.' + chr(13) + chr(10) + 'Keep distance to activate it.',220,$D0D21D,0.112,20,360);
end;
i := i + 1;
end;
if (placed = false) then WriteConsole(ID,'Mine count limit exceeded.',$D0D21D);
end else WriteConsole(ID,'Mines can not be placed that close to your flag.',$D0D21D);
end else WriteConsole(ID,'Mines can only be placed on the ground.',$D0D21D) else WriteConsole(ID,'Mines can not be placed while dead.',$D0D21D);
end;
procedure PokazKim(ID: byte);
begin
case (TalibType[ID]) of
1: WriteConsole(ID,'[Al-Kaida] Zostales Abu Musab al-Zarkawi',$D0D21D);
2: WriteConsole(ID,'[Al-Kaida] Zostales Jastrzebiem Mohameta.',$D0D21D);
3: WriteConsole(ID,'[Al-Kaida] Zostales Ayman al-Zawahiri.',$D0D21D);
4: WriteConsole(ID,'[Al-Kaida] Zostales Abu Hamza al-Muhadżir.',$D0D21D);
5: WriteConsole(ID,'[Al-Kaida] Dzakad!',$D0D21D);
6: WriteConsole(ID,'[Al-Kaida] Zostales Mohammad Atefa.',$D0D21D);
7: WriteConsole(ID,'[Al-Kaida] Zostales Abu Bakra.',$D0D21D);
8: WriteConsole(ID,'[Al-Kaida] Zostales Saif al-Adel.',$D0D21D);
9: WriteConsole(ID,'[American] Zostales mechanikiem wojennym.',$D0D21D);
10: WriteConsole(ID,'[American] Zostales medykiem polowym.',$D0D21D);
11: WriteConsole(ID,'[American] Zostales starszym srzelcem.',$D0D21D);
12: WriteConsole(ID,'[American] Zostales zolnierzem zaopatrzenia.',$D0D21D);
13: WriteConsole(ID,'[American] Zostales saperem wojsk ladowych.',$D0D21D);
14: WriteConsole(ID,'[American] Zostales wsparciem wojsk ladowych.',$D0D21D);
15: WriteConsole(ID,'[American] Zostales szpiegiem amerykan.',$D0D21D);
16: WriteConsole(ID,'[American] Zostales komandosem.',$D0D21D);
end;
end;
function OnPlayerDamageEx(Victim, Shooter: Byte; Damage: Integer; Weapon: Byte): Integer;
var Vx,Vy,Sx,Sy: single; td: integer;
begin
td:=Damage;
Vx := GetPlayerStat(Victim,'X');
Vy := GetPlayerStat(Victim,'Y');
Sx := GetPlayerStat(Shooter,'X');
Sy := GetPlayerStat(Shooter,'Y');
if (Shooter <> Victim) and (GetPlayerStat(Shooter,'Team') <> GetPlayerStat(Victim,'Team')) then begin
if (GetPlayerStat(Victim,'Team')=1) and (Distance(Vx,Vy,Sx,Sy) < 90) and (GetPlayerStat(victim,'Alive') = true) then begin
case (TalibType[Victim]) of
1: TalibBoss(Victim, false); // Wybucha najmocniejsza bomba
2: MaleMocneCos(Vx,Vy,10,2,10,1,4,Victim,true); // Bardzo głośna i niszczycielska bomba
3: TalibFireBomb(Victim); // Wybucha i strzela wybuchajacymi odlamkami w wroga
4: TalibTriper(Victim); // Wystrzela 3 pociski rakietowe
5: TaliboO(Victim, 4, 3); // Wielki grad odłamków
6: TaliboO(Victim, 5, 4); // Wielki mocny okrągły wybuch
7: TaliboSrubki(Victim); // Wybuch i odłamki
8: Talibzgranatem(Victim); // Drobne ale grozne gdy wróg blisko
end;
end;
if (GetPlayerStat(Shooter,'team')=2) and (TalibType[Shooter] = 16) then begin // Leczenie sie komandosa!
if ((GetPlayerStat(Shooter,'Health') + 4) > MaxHealth) then DoDamage(Shooter,GetPlayerStat(Shooter,'Health') - MaxHealth) else DoDamage(Shooter,-4);
end;
end;
if (GetPlayerStat(Shooter,'team')=2) and (TalibType[Shooter] = 11) then begin // Starszy strzelec damage +30%
if (Damage > 0) then Result := damage+round((30/100)*damage) else Result := damage;
end else Result := damage;
end;
procedure OnPlayerKill(Killer, Victim: byte; Weapon: string);
var Vx,Vy: single; i: integer;
begin
Vx := GetPlayerStat(Victim,'X');
Vy := GetPlayerStat(Victim,'Y');
if (Killer <> Victim) and (GetPlayerStat(Victim,'Team') <> GetPlayerStat(Killer,'Team')) then begin
if (GetPlayerStat(Victim,'Team')=1) and (TalibType[Victim] = 1) then TalibBoss(Victim, true); //Wybucha najmocniejsza bomba
if (GetPlayerStat(Victim,'Team')=1) and (TalibType[Victim] = 2) then MaleMocneCos(Vx,Vy,10,2,10,1,4,Victim,true); //Bardzo głośna i niszczycielska bomba
if (GetPlayerStat(Victim,'Team')=1) and (TalibType[Victim] = 3) then TalibFireBomb(Victim);
if (GetPlayerStat(Victim,'Team')=1) and (TalibType[Victim] = 4) then TalibTriper(Victim); // Wystrzela 3 pociski rakietowe
if (GetPlayerStat(Victim,'Team')=1) and (TalibType[Victim] = 5) then TaliboO(Victim, 4, 3); //Wielki grad odłamków
if (GetPlayerStat(Victim,'Team')=1) and (TalibType[Victim] = 6) then TaliboO(Victim, 5, 4); //Wielki mocny okrągły wybuch
if (GetPlayerStat(Victim,'Team')=1) and (TalibType[Victim] = 7) then TaliboSrubki(Victim); //Wybuch i odłamki
if (GetPlayerStat(Victim,'Team')=1) and (TalibType[Victim] = 8) then Talibzgranatem(Victim); //Wybuch i odłamki
ResVar(Killer);
end;
if (Killer = Victim) then begin
for i := 1 to 32 do if (mine[i].owner = Victim) and (mine[i].duration <> 0) then begin
CreateBullet(mine[i].X+20,mine[i].Y-5,0,0,25,4,mine[i].owner);
CreateBullet(mine[i].X-20,mine[i].Y-5,0,0,25,4,mine[i].owner);
CreateBullet(mine[i].X,mine[i].Y-22,0,0,25,4,mine[i].owner);
CreateBullet(mine[i].X,mine[i].Y,0,10,25,4,mine[i].owner);
mine[i].duration := 0;
mine[i].owner := 0;
end;
ResVar(Killer);
end;
if (killer <> victim) then if (GetPlayerStat(victim, 'Active') = true) then begin
for i := 1 to 32 do if (mine[i].owner = Victim) and (mine[i].duration <> 0) then begin
CreateBullet(mine[i].X+20,mine[i].Y-5,0,0,25,4,mine[i].owner);
CreateBullet(mine[i].X-20,mine[i].Y-5,0,0,25,4,mine[i].owner);
CreateBullet(mine[i].X,mine[i].Y-22,0,0,25,4,mine[i].owner);
CreateBullet(mine[i].X,mine[i].Y,0,10,25,4,mine[i].owner);
mine[i].duration := 0;
mine[i].owner := 0;
end;
ResVar(victim);
end;
if (TalibStat[Victim] <> 0) then begin
CreateBullet(GetObjectStat(TalibStat[Victim], 'x')+20,GetObjectStat(TalibStat[Victim], 'y')-5,0,0,25,4,Victim);
CreateBullet(GetObjectStat(TalibStat[Victim], 'x')-20,GetObjectStat(TalibStat[Victim], 'y')-5,0,0,25,4,Victim);
CreateBullet(GetObjectStat(TalibStat[Victim], 'x'),GetObjectStat(TalibStat[Victim], 'y')-22,0,0,25,4,Victim);
CreateBullet(GetObjectStat(TalibStat[Victim], 'x'),GetObjectStat(TalibStat[Victim], 'y'),0,10,25,4,Victim);
KillObject(TalibStat[Victim]);
end;
end;
function OnPlayerCommand(ID: Byte; Text: string): boolean;
begin
if (text = '/mine') and (TalibType[ID] = 13) then if (TalibMines[ID] < 2) then PostawMine(ID) else WriteConsole(ID,'Nie masz min!',$D0D21D);
Result := false;
end;
procedure OnPlayerRespawn(ID: byte);
var i: byte;
begin
ResVar(ID);
if (GetPlayerStat(ID, 'Team') = 1) then i:=random(1,9) else i:=random(9,17);
TalibType[ID] := i;
PokazKim(ID);
if (TalibType[ID]=9) then GiveBonus(ID, 3);
end;
procedure c4bomb(ID, ID2: byte);
begin
CreateBullet(GetPlayerStat(ID,'x')+20,GetPlayerStat(ID,'y')-5,0,0,25,4,ID2);
CreateBullet(GetPlayerStat(ID,'x')-20,GetPlayerStat(ID,'y')-5,0,0,25,4,ID2);
CreateBullet(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y')-22,0,0,25,4,ID2);
CreateBullet(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),0,10,25,4,ID2);
end;
procedure AppOnIdle(Ticks: integer);
var b, i, LI: byte; x, y: single;
begin
for i := 1 to 32 do begin
if (GetPlayerStat(i, 'active')) then if (TalibType[i] = 9) then begin // Amerykanski Mechanik! Daje Vest co 45
if Ticks mod (60 * 1) = 0 then begin
dec(TalibResVest[i], 1);
DrawTextEx(i,38,'TimeVest: '+inttostr(TalibResVest[i]),330,$FFB300,0.06,352,444);
if (TalibResVest[i] = 0) then begin
TalibResVest[i] := 45;
b := NearestOpponent(i,GetPlayerStat(i,'Team'), true);
GiveBonus(b,3);
GiveBonus(i, 3);
if not (b=0) then begin
WriteConsole(i,'Dales kamizelke graczu: '+GetPlayerStat(b, 'name'),$D0D21D);
WriteConsole(b,'Otrzymales kamizelke od: '+GetPlayerStat(i, 'name'),$D0D21D);
end;
end;
end;
end;
if (GetPlayerStat(i, 'active')) then if (TalibType[i] = 15) then begin // Amerykanski Szpieg
if Ticks mod (60 * 1) = 0 then begin
if (PredUse[i] = true) then dec(TalibSzpieg[i], 1);
if (PredUse[i] = true) then DrawTextEx(i,38,'TimePred: '+inttostr(TalibSzpieg[i]),330,$FFB300,0.06,352,444) else DrawTextEx(i,38,'TimePred: X',330,$FFB300,0.06,352,444);
if (TalibSzpieg[i] = 0) then PredUse[i] := false;
end;
end;
if (GetPlayerStat(i, 'active')) then if (TalibType[i] = 12) then begin // Amerykanski żołnierz zaopatrzenia! Rozdaje granaty co 40 i pelen magazynek co 10 sec.
if Ticks mod (60 * 1) = 0 then begin
dec(TalibGranade[i], 1);
DrawTextEx(i,39,'TimeGranade: '+inttostr(TalibGranade[i]),330,$FFB300,0.06,352,444);
if (TalibGranade[i] = 0) then begin
TalibGranade[i] := 40;
b := NearestOpponent(i,GetPlayerStat(i,'Team'), true);
GiveBonus(b,random(4,6));
GiveBonus(i,random(4,6));
if not (b=0) then begin
WriteConsole(i,'Dales granaty graczu: '+GetPlayerStat(b, 'name'),$D0D21D);
WriteConsole(b,'Otrzymales granaty od: '+GetPlayerStat(i, 'name'),$D0D21D);
end;
end;
dec(TaliMag[i], 1);
DrawTextEx(i,40,'FulMag: '+inttostr(TaliMag[i]),330,$FFB300,0.06,352,434);
if (TaliMag[i] = 0) then begin
TaliMag[i] := 10;
ForceWeaponEx(i, GetPlayerStat(i, 'Primary'), GetPlayerStat(i, 'Secondary'), 0, 0);
end;
end;
end;
if Ticks mod (60 * 1) = 0 then begin
if (GetPlayerStat(i, 'active')) then if (TalibType[i] = 10) then begin //Amerykanski Medyk! Leczy team w zasiegu
GetPlayerXY(i,X,Y);
if (GetPlayerStat(i,'Alive') = true) then for b := 1 to 32 do if (GetPlayerStat(b,'Active') = true) then if (GetPlayerStat(b,'Alive') = true) and (GetPlayerStat(i,'Team') = GetPlayerStat(b,'Team')) and (Distance(X,Y,GetPlayerStat(b,'X'),GetPlayerStat(b,'Y')) <= 120) and (GetPlayerStat(b,'Health') < MaxHealth) then begin
DrawTextEx(i,39,'Healing in progress..',130,$FFB300,0.06,352,444);
if ((GetPlayerStat(b,'Health') + 8) > MaxHealth) then DoDamage(b,GetPlayerStat(b,'Health') - MaxHealth) else DoDamage(b,-8);
end;
end;
end;
if (GetKeyPress(i, 'down') = true) and (TalibType[i] = 13) and (GetKeyPress(i, 'Shoot') = true) and (GetPlayerStat(i,'Ground') = true) and (GetPlayerStat(i,'Alive') = true) and (GetPlayerStat(i,'Primary') = 16) and (GetPlayerStat(i,'Ammo') <> 0) then begin // Amerykanski saper
LI := lookForTarget(i, 0, 700, true);
if (LI > 0) then WriteConsole(LI,'[WARNING] Targeted you!',$FF0000);
if (TaliAmmo[i] < 1) then begin
if (LI > 0) then begin
GetPlayerXY(i, x, y);
Missile(i, LI, x, y);
ForceWeaponEx(i, 16, GetPlayerStat(i,'Secondary'), -1, GetPlayerStat(i,'SecAmmo'));
TaliAmmo[i] := TaliAmmo[i] + 1;
WriteConsole(i,'Tracked: '+GetPlayerStat(LI,'name')+' - Fire!',$D0D21D);
LI := 0;
end else WriteConsole(i,'Not found the enemy!',$D0D21D);
end;
end;
if Ticks mod (60 * 1) = 0 then begin
if (mine[i].duration > 0) then begin
dec(mine[i].duration, 1);
if (mine[i].duration = 0) then begin
CreateBullet(mine[i].X+20,mine[i].Y-5,0,0,25,4,mine[i].owner);
CreateBullet(mine[i].X-20,mine[i].Y-5,0,0,25,4,mine[i].owner);
CreateBullet(mine[i].X,mine[i].Y-22,0,0,25,4,mine[i].owner);
CreateBullet(mine[i].X,mine[i].Y,0,10,25,4,mine[i].owner);
WriteConsole(mine[i].owner,'One of your mines has exceeded duration and blew up.',$D0D21D);
end else for b:=1 to 32 do if (GetPlayerStat(b,'Active') = true) and (GetPlayerStat(b,'Team') < 5) then if (Distance(GetPlayerStat(b,'X'),GetPlayerStat(b,'Y'),mine[i].X,mine[i].Y) < 55) and (GetPlayerStat(b,'Team') <> GetPlayerStat(mine[i].owner,'Team')) and (Distance(GetPlayerStat(mine[i].owner,'X'),GetPlayerStat(mine[i].owner,'Y'),mine[i].X,mine[i].Y) > 80) then begin
CreateBullet(mine[i].X+20,mine[i].Y-5,0,0,25,4,mine[i].owner);
CreateBullet(mine[i].X-20,mine[i].Y-5,0,0,25,4,mine[i].owner);
CreateBullet(mine[i].X,mine[i].Y-22,0,0,25,4,mine[i].owner);
CreateBullet(mine[i].X,mine[i].Y,0,10,25,4,mine[i].owner);
mine[i].duration := 0;
WriteConsole(mine[i].owner,GetPlayerStat(b,'Name') + ' stepped into one of your mines.',$D0D21D);
DrawText(b,'Baaammm!!',300,$D0D21D,0.15,60,360);
end;
end;
if (PredUse2[i] = true) then if not (GetPlayerStat(i, 'Primary') = 0) and not (GetPlayerStat(i, 'Primary') = 14) and not(GetPlayerStat(i, 'Primary') = 255) then ForceWeapon(i, 0, 14, 0);
if (SzpiegTime[i] > 0) and (GetPlayerStat(i,'active') = true) then begin
dec(SzpiegTime[i], 1);
if (SzpiegTime[i] = 0) then begin
ForceWeapon(i, SzpiegWep[i][1], SzpiegWep[i][2], 0);
PredUse2[i] := false;
end;
end;
if (StatDead[i] > 0) and (GetPlayerStat(i,'active') = true) then begin
dec(StatDead[i], 1);
if (StatDead[i] >= 5) then DrawTextEx(i,39,'DeadStat: '+inttostr(StatDead[i]),150,$FFB300,0.06,352,434);
if (StatDead[i] < 4) then DrawTextEx(i,39,'DeadStat: '+inttostr(StatDead[i]),150,$FF0000,0.06,352,434);
if (StatDead[i] = 0) then begin
CreateBullet(GetObjectStat(TalibStat[i], 'x')+20,GetObjectStat(TalibStat[i], 'y')-5,0,0,25,4,i);
CreateBullet(GetObjectStat(TalibStat[i], 'x')-20,GetObjectStat(TalibStat[i], 'y')-5,0,0,25,4,i);
CreateBullet(GetObjectStat(TalibStat[i], 'x'),GetObjectStat(TalibStat[i], 'y')-22,0,0,25,4,i);
CreateBullet(GetObjectStat(TalibStat[i], 'x'),GetObjectStat(TalibStat[i], 'y'),0,10,25,4,i);
KillObject(TalibStat[i]);
end;
end;
if (GetPlayerStat(i,'active') = true) then if (TalibType[i] = 16) then begin
dec(StatTimes[i], 1);
if (StatBuild[i] = true) then DrawTextEx(i,37,'TimeStat: '+inttostr(StatTimes[i]),150,$FFB300,0.06,352,444) else DrawTextEx(i,37,'TimeStat: S+Q',150,$FFB300,0.06,352,444);
if (StatTimes[i] = 0) then begin
StatBuild[i] := false;
end;
end;
if (GetPlayerStat(i,'active') = true) and (TalibType[i] = 14) then begin
if (TalibC4Limit[i] = 0) then DrawTextEx(i,37,'C4: S+Q (3)',150,$FFB300,0.06,352,444);
if (TalibC4Limit[i] = 1) then DrawTextEx(i,37,'C4: 2',150,$FFB300,0.06,352,444);
if (TalibC4Limit[i] = 2) then DrawTextEx(i,37,'C4: 1',150,$FFB300,0.06,352,444);
if (TalibC4Limit[i] = 3) then DrawTextEx(i,37,'C4: Q+Shoot! (0)',150,$FF0000,0.06,352,444);
end;
if (GetPlayerStat(i,'active') = true) and (TalibType[i] = 13) then begin
if (TalibMines[i] = 0) then DrawTextEx(i,37,'Mine: S+Q (2)',150,$FFB300,0.06,352,444);
if (TalibMines[i] = 1) then DrawTextEx(i,37,'Mines: 1',150,$FFB300,0.06,352,444);
if (TalibMines[i] = 2) then DrawTextEx(i,37,'Mines: 0',150,$FFB300,0.06,352,444);
end;
end;
if Ticks mod (30 * 1) = 0 then begin //Key Press
if (GetKeyPress(i, 'down') = true) and (TalibType[i] = 13) and (GetKeyPress(i, 'Changewep') = true) and (GetPlayerStat(i,'Ground') = true) then if (TalibMines[i] < 2) then PostawMine(i) else WriteConsole(i,'Nie masz min!',$D0D21D);
if (GetKeyPress(i, 'down') = true) and (GetPlayerStat(i,'alive') = true) and (GetPlayerStat(i,'team') = 1) and (GetKeyPress(i, 'up') = true) then if (GetPlayerStat(i,'Ground') = true) then begin //Samo Wysadzenie!
DoDamage(i, 3000);
if (GetPlayerStat(i,'Team')=1) and (TalibType[i] = 1) then TalibBoss(i, true); //Wybucha najmocniejsza bomba
if (GetPlayerStat(i,'Team')=1) and (TalibType[i] = 2) then MaleMocneCos(GetPlayerStat(i,'X'),GetPlayerStat(i,'Y'),10,2,10,1,4,i,true); //Bardzo głośna i niszczycielska bomba
if (GetPlayerStat(i,'Team')=1) and (TalibType[i] = 3) then TalibFireBomb(i);
if (GetPlayerStat(i,'Team')=1) and (TalibType[i] = 4) then TalibTriper(i); // Wystrzela 3 pociski rakietowe
if (GetPlayerStat(i,'Team')=1) and (TalibType[i] = 5) then TaliboO(i, 4, 3); //Wielki grad odłamków
if (GetPlayerStat(i,'Team')=1) and (TalibType[i] = 6) then TaliboO(i, 5, 4); //Wielki mocny okrągły wybuch
if (GetPlayerStat(i,'Team')=1) and (TalibType[i] = 7) then TaliboSrubki(i); //Wybuch i odłamki
if (GetPlayerStat(i,'Team')=1) and (TalibType[i] = 8) then Talibzgranatem(i); //Wybuch i odłamki
WriteConsole(i,'W imie allacha!',$D0D21D);
end else WriteConsole(li,'Aby sie samemu wysadzic musisz stac na ziemi.',$D0D21D);
if (GetKeyPress(i, 'down') = true) and (GetPlayerStat(i,'alive') = true) and (TalibType[i] = 14) and (GetKeyPress(i,'Changewep') = true) then begin //C4 wpsarcie ogniowe
if (TalibC4Limit[i] < 3) then begin
LI := NearestOpponent(i,GetPlayerStat(i,'Team'), false);
if (TalibC4[i][1] = 0) then begin
if (Distance(GetPlayerStat(i, 'x'),GetPlayerStat(i, 'y'),GetPlayerStat(li, 'x'),GetPlayerStat(li, 'y')) < 340) then begin
TalibC4[i][1] := li;
inc(TalibC4Limit[i], 1);
WriteConsole(li,'Masz na sobie c4 wroga - W kazdej chwili mozesz pierdolnosc!',$D0D21D);
WriteConsole(i,'#1 Zarzuciles c4 na '+GetPlayerStat(TalibC4[i][1],'name'),$D0D21D);
end else WriteConsole(i,'Brak wroga w zasiegu!',$D0D21D);
end;
LI := NearestOpponent(i,GetPlayerStat(i,'Team'), false);
if (TalibC4[i][2] = 0) and (li <> TalibC4[i][1]) and (LI <> i) then begin
if (Distance(GetPlayerStat(i, 'x'),GetPlayerStat(i, 'y'),GetPlayerStat(li, 'x'),GetPlayerStat(li, 'y')) < 340) then begin
TalibC4[i][2] := li;
inc(TalibC4Limit[i], 1);
WriteConsole(li,'Masz na sobie c4 wroga - W kazdej chwili mozesz pierdolnosc!',$D0D21D);
WriteConsole(i,'#2 Zarzuciles c4 na '+GetPlayerStat(TalibC4[i][2],'name'),$D0D21D);
end else WriteConsole(i,'Brak wroga w zasiegu!',$D0D21D);
end;
LI := NearestOpponent(i,GetPlayerStat(i,'Team'), false);
if (TalibC4[i][3] = 0) and (li <> TalibC4[i][1]) and (li <> TalibC4[i][2]) and (LI <> i) then begin
if (Distance(GetPlayerStat(i, 'x'),GetPlayerStat(i, 'y'),GetPlayerStat(li, 'x'),GetPlayerStat(li, 'y')) < 340) then begin
TalibC4[i][3] := li;
inc(TalibC4Limit[i], 1);
WriteConsole(li,'Masz na sobie c4 wroga - W kazdej chwili mozesz pierdolnosc!',$D0D21D);
WriteConsole(i,'#3 Zarzuciles c4 na '+GetPlayerStat(TalibC4[i][3],'name'),$D0D21D);
end else WriteConsole(i,'Brak wroga w zasiegu!',$D0D21D);
end;
end else WriteConsole(i,'Brak c4!',$D0D21D);
end;
if (GetKeyPress(i, 'Changewep') = true) and (GetPlayerStat(i,'alive') = true) and (TalibType[i] = 14) and (GetKeyPress(i,'Shoot') = true) then begin
if (TalibC4[i][1] <> 0) then begin
c4bomb(TalibC4[i][1], i);
WriteConsole(i,'#1 '+GetPlayerStat(TalibC4[i][1],'name')+' poszedl do nieba!',$D0D21D);
WriteConsole(TalibC4[i][1],GetPlayerStat(i,'name')+' zabil cie za pomoca c4!',$D0D21D);
TalibC4[i][1] := 0;
end;
if (TalibC4[i][2] <> 0) then begin
c4bomb(TalibC4[i][2], i);
WriteConsole(i,'#2 '+GetPlayerStat(TalibC4[i][2],'name')+' poszedl do nieba!',$D0D21D);
WriteConsole(TalibC4[i][2],GetPlayerStat(i,'name')+' zabil cie za pomoca c4!',$D0D21D);
TalibC4[i][2] := 0;
end;
if (TalibC4[i][3] <> 0) then begin
c4bomb(TalibC4[i][3], i);
WriteConsole(i,'#3 '+GetPlayerStat(TalibC4[i][3],'name')+' poszedl do nieba!',$D0D21D);
WriteConsole(TalibC4[i][3],GetPlayerStat(i,'name')+' zabil cie za pomoca c4!',$D0D21D);
TalibC4[i][3] := 0;
end;
end;
if (GetKeyPress(i, 'Prone') = true) and (GetPlayerStat(i,'alive') = true) and (GetPlayerStat(i,'active') = true) and (TalibType[i] = 15) then if (PredUse[i] = false) then begin
GiveBonus(i, 1);
TalibSzpieg[i] := 60;
PredUse[i] := true;
PredUse2[i] := true;
SzpiegWep[i][1] := GetPlayerStat(i, 'Primary');
SzpiegWep[i][2] := GetPlayerStat(i, 'Secondary');
SzpiegTime[i] := 25;
ForceWeapon(i, 0, 14, 0);
end;
if (GetKeyPress(i, 'Down') = true) and (GetKeyPress(i, 'Changewep') = true) and (GetPlayerStat(i,'alive') = true) and (GetPlayerStat(i,'active') = true) and (TalibType[i] = 16) then if (StatBuild[i] = false) then begin
TalibStat[i] := SpawnObject(GetPlayerStat(i,'x'), GetPlayerStat(i,'y'),15);
StatBuild[i] := true;
StatTimes[i] := 30;
StatDead[i] := 10;
end;
end;
end;
end;
procedure OnMapChange(NewMap: string);
var i: byte;
begin
for i:=1 to 32 do begin
mine[i].duration := 0;
ResVar(i);
WeapActive(i, GetPlayerStat(i, 'Team'));
end;
end;
Procedure OnJoinTeam (ID, Team: byte);
var i: integer;
begin
ResVar(ID);
WeapActive(ID, Team);
if (Team = 1) then i:=random(1,9) else i:=random(9,17);
TalibType[ID] := i;
PokazKim(ID);
end;
procedure OnLeaveGame(ID, Team: byte; Kicked: boolean);
begin
if (TalibStat[ID] <> 0) then begin
CreateBullet(GetObjectStat(TalibStat[ID], 'x')+20,GetObjectStat(TalibStat[ID], 'y')-5,0,0,25,4,ID);
CreateBullet(GetObjectStat(TalibStat[ID], 'x')-20,GetObjectStat(TalibStat[ID], 'y')-5,0,0,25,4,ID);
CreateBullet(GetObjectStat(TalibStat[ID], 'x'),GetObjectStat(TalibStat[ID], 'y')-22,0,0,25,4,ID);
CreateBullet(GetObjectStat(TalibStat[ID], 'x'),GetObjectStat(TalibStat[ID], 'y'),0,10,25,4,ID);
KillObject(TalibStat[ID]);
end;
ResVar(ID);
end;
procedure ActivateServer();
var i, b, h: byte;
begin
AppOnIdleTimer := 5;
if (Command('/realistic') = 1) then MaxHealth:= 65 else MaxHealth:= 150;
for i := 1 to 32 do ResVar(i);
for b := 1 to 32 do begin
if (GetPlayerStat(b, 'active')=true) then begin
WeapActive(b, GetPlayerStat(b, 'Team'));
if (GetPlayerStat(b, 'Team') = 1) then h:=random(1,9) else h:=random(9,17);
TalibType[b] := h;
PokazKim(b);
end;
end;
end;