procedure WeaponAmmoChangeLimit(ID:byte);
var NW,NS:TNewWeapon; WeapChangeRan:byte;
begin
case (PlayerInfo[id].ClassID) of
1: begin
if (PlayerInfo[ID].Resp=False) then begin
if (Players[id].Primary.Wtype>16) then PlayerInfo[ID].Wep1 := 17 else PlayerInfo[ID].Wep1 := Players[id].Primary.Wtype;
if (Players[id].Secondary.Wtype>16) then PlayerInfo[ID].Wep2 := 17 else PlayerInfo[ID].Wep2 := Players[id].Secondary.Wtype;
if (PlayerInfo[ID].Wep1<18) and (PlayerInfo[ID].Wep2<18) then begin
WepAmmo[PlayerInfo[ID].Wep1][ID]:=GetMaxAmmo(PlayerInfo[ID].Wep1);
WepAmmo[PlayerInfo[ID].Wep2][ID]:=GetMaxAmmo(PlayerInfo[ID].Wep2);
end;
if (PlayerInfo[ID].Wep2=12) or (PlayerInfo[ID].Wep2=13) then begin
WeapChangeRan:=iif(Random(1,3)=1,11,0);
NS:=TNewWeapon.Create(); NS.WType:=PlayerInfo[ID].Wep1; NS.Ammo:=GetMinAmmo(PlayerInfo[ID].Wep1);
NW:=TNewWeapon.Create(); NW.WType:=WeapChangeRan; NW.Ammo:=GetMinAmmo(WeapChangeRan);
WepAmmo[PlayerInfo[ID].Wep2][ID]:=(GetMinAmmo(PlayerInfo[ID].Wep2)-Random(0,1+Trunc(RanDropAmmo*GetMinAmmo(PlayerInfo[ID].Wep2))));
WepAmmo[WeapChangeRan][ID]:=GetMaxAmmo(WeapChangeRan);
Players[ID].ForceWeapon(NS,NW);
NS.Free(); NW.Free();
end;
end else
begin
WepAmmo[1][ID]:=GetMaxAmmo(1);
WepAmmo[3][ID]:=GetMaxAmmo(3);
WepAmmo[4][ID]:=GetMaxAmmo(4);
WepAmmo[0][ID]:=GetMaxAmmo(0);
WepAmmo[11][ID]:=GetMaxAmmo(11);
end;
end;
2: begin
if (PlayerInfo[ID].Resp=False) then begin
if (Players[id].Primary.Wtype>16) then PlayerInfo[ID].Wep1 := 17 else PlayerInfo[ID].Wep1 := Players[id].Primary.Wtype;
if (Players[id].Secondary.Wtype>16) then PlayerInfo[ID].Wep2 := 17 else PlayerInfo[ID].Wep2 := Players[id].Secondary.Wtype;
if (PlayerInfo[ID].Wep1<18) and (PlayerInfo[ID].Wep2<18) then begin
WepAmmo[PlayerInfo[ID].Wep1][ID]:=GetMaxAmmo(PlayerInfo[ID].Wep1);
WepAmmo[PlayerInfo[ID].Wep2][ID]:=GetMaxAmmo(PlayerInfo[ID].Wep2);
end;
if (PlayerInfo[ID].Wep2=12) or (PlayerInfo[ID].Wep2=13) then begin
WeapChangeRan:=iif(Random(1,3)=1,11,0);
NS:=TNewWeapon.Create(); NS.WType:=PlayerInfo[ID].Wep1; NS.Ammo:=GetMinAmmo(PlayerInfo[ID].Wep1);
NW:=TNewWeapon.Create(); NW.WType:=WeapChangeRan; NW.Ammo:=GetMinAmmo(WeapChangeRan);
WepAmmo[PlayerInfo[ID].Wep2][ID]:=(GetMinAmmo(PlayerInfo[ID].Wep2)-Random(0,1+Trunc(RanDropAmmo*GetMinAmmo(PlayerInfo[ID].Wep2))));
WepAmmo[WeapChangeRan][ID]:=GetMaxAmmo(WeapChangeRan);
Players[ID].ForceWeapon(NS,NW);
NS.Free(); NW.Free();
end;
end else
begin
WepAmmo[2][ID]:=GetMaxAmmo(2);
WepAmmo[9][ID]:=GetMaxAmmo(9);
WepAmmo[10][ID]:=GetMaxAmmo(10);
WepAmmo[0][ID]:=GetMaxAmmo(0);
WepAmmo[11][ID]:=GetMaxAmmo(11);
end;
end;
3: begin
if (PlayerInfo[ID].Resp=False) then begin
if (Players[id].Primary.Wtype>16) then PlayerInfo[ID].Wep1 := 17 else PlayerInfo[ID].Wep1 := Players[id].Primary.Wtype;
if (Players[id].Secondary.Wtype>16) then PlayerInfo[ID].Wep2 := 17 else PlayerInfo[ID].Wep2 := Players[id].Secondary.Wtype;
if (PlayerInfo[ID].Wep1<18) and (PlayerInfo[ID].Wep2<18) then begin
WepAmmo[PlayerInfo[ID].Wep1][ID]:=GetMaxAmmo(PlayerInfo[ID].Wep1);
WepAmmo[PlayerInfo[ID].Wep2][ID]:=GetMaxAmmo(PlayerInfo[ID].Wep2);
end;
if (PlayerInfo[ID].Wep2=12) or (PlayerInfo[ID].Wep2=13) then begin
WeapChangeRan:=iif(Random(1,3)=1,11,0);
NS:=TNewWeapon.Create(); NS.WType:=PlayerInfo[ID].Wep1; NS.Ammo:=GetMinAmmo(PlayerInfo[ID].Wep1);
NW:=TNewWeapon.Create(); NW.WType:=WeapChangeRan; NW.Ammo:=GetMinAmmo(WeapChangeRan);
WepAmmo[PlayerInfo[ID].Wep2][ID]:=(GetMinAmmo(PlayerInfo[ID].Wep2)-Random(0,1+Trunc(RanDropAmmo*GetMinAmmo(PlayerInfo[ID].Wep2))));
WepAmmo[WeapChangeRan][ID]:=GetMaxAmmo(WeapChangeRan);
Players[ID].ForceWeapon(NS,NW);
NS.Free(); NW.Free();
end;
end else
begin
WepAmmo[5][ID]:=GetMaxAmmo(5);
WepAmmo[6][ID]:=GetMaxAmmo(6);
WepAmmo[8][ID]:=GetMaxAmmo(8);
WepAmmo[0][ID]:=GetMaxAmmo(0);
WepAmmo[11][ID]:=GetMaxAmmo(11);
end;
end;
4: begin
if (PlayerInfo[ID].Resp=False) then begin
if (Players[id].Primary.Wtype>16) then PlayerInfo[ID].Wep1 := 17 else PlayerInfo[ID].Wep1 := Players[id].Primary.Wtype;
if (Players[id].Secondary.Wtype>16) then PlayerInfo[ID].Wep2 := 17 else PlayerInfo[ID].Wep2 := Players[id].Secondary.Wtype;
if (PlayerInfo[ID].Wep1<18) and (PlayerInfo[ID].Wep2<18) then begin
WepAmmo[PlayerInfo[ID].Wep1][ID]:=GetMaxAmmo(PlayerInfo[ID].Wep1);
WepAmmo[PlayerInfo[ID].Wep2][ID]:=GetMaxAmmo(PlayerInfo[ID].Wep2);
end;
if (PlayerInfo[ID].Wep2=17) or (PlayerInfo[ID].Wep2=0) or (PlayerInfo[ID].Wep2=11) then begin
NS:=TNewWeapon.Create(); NS.WType:=PlayerInfo[ID].Wep1; NS.Ammo:=GetMinAmmo(PlayerInfo[ID].Wep1);
NW:=TNewWeapon.Create(); NW.WType:=13; NW.Ammo:=GetMinAmmo(13);
if (PlayerInfo[ID].Wep2<>17) then WepAmmo[PlayerInfo[ID].Wep2][ID]:=(GetMinAmmo(PlayerInfo[ID].Wep2)-Random(0,1+Trunc(RanDropAmmo*GetMinAmmo(PlayerInfo[ID].Wep2))));
WepAmmo[13][ID]:=GetMaxAmmo(13);
Players[ID].ForceWeapon(NS,NW);
NS.Free(); NW.Free();
end;
end else
begin
WepAmmo[2][ID]:=GetMaxAmmo(2);
WepAmmo[4][ID]:=GetMaxAmmo(4);
WepAmmo[7][ID]:=GetMaxAmmo(7);
WepAmmo[12][ID]:=GetMaxAmmo(12);
WepAmmo[13][ID]:=GetMaxAmmo(13);
end;
end;
end;
end;