0 Members and 1 Guest are viewing this topic.
i := 32while GetPlayerStat(i,'Active') = false do i := i - 1;Result := i;
function MaxID: byte;var i: byte;begin result:=0; for i:=1 to 32 do If GetPlayerStat(i,'Active') = true then result:=result+1;end;
function CountWeapon(WeaponID,Team: byte): byte;var i: byte;var MaxID: byte;begin result:=0; for i:=1 to 32 do If GetPlayerStat(i,'Active') = true then MaxID:=i; for i:=1 to MaxID do If (GetPlayerStat(i,'Active') = true) then If (GetPlayerStat(i,'Team') < 5) and (GetPlayerStat(i,'Alive') = true) and ((GetPlayerStat(i,'Team') = Team) or (Team = 0)) and ((GetPlayerStat(i,'Primary') = WeaponID) or (GetPlayerStat(i,'Secondary') = WeaponID)) then result:=result+1;end;
function CountWeapon(WeaponID,Team: byte): byte;var i: byte;begin result:=0; for i:=1 to 32 do If (GetPlayerStat(i,'Active') = true) then If (GetPlayerStat(i,'Team') < 5) and (GetPlayerStat(i,'Alive') = true) and ((GetPlayerStat(i,'Team') = Team) or (Team = 0)) and ((GetPlayerStat(i,'Primary') = WeaponID) or (GetPlayerStat(i,'Secondary') = WeaponID)) then result:=result+1;end;
procedure OnWeaponChange(ID, PrimaryNum, SecondaryNum: byte);var i: byte;MaxID: Byte;begin If JustRespawned[ID] = true then begin JustRespawned[ID]:=false; If (PrimaryNum > 0) and (PrimaryNum < 11) then If CountWeapon(PrimaryNum,GetPlayerStat(ID,'Team')) >= Allowed[PrimaryNum] then begin for i:=1 to 32 do If GetPlayerStat(i,'Active') = true then MaxID:=i; for i:=1 to MaxID do If (GetPlayerStat(i,'Active') = true) and (GetPlayerStat(i,'Team') = GetPlayerStat(ID,'Team')) then If Allowed[PrimaryNum] > 0 then SetWeaponActive(i,PrimaryNum,true) else SetWeaponActive(i,PrimaryNum,false); end; If (SecondaryNum > 0) and (SecondaryNum < 11) then If CountWeapon(SecondaryNum,GetPlayerStat(ID,'Team')) >= Allowed[SecondaryNum] then begin for i:=1 to 32 do If GetPlayerStat(i,'Active') = true then MaxID:=i; for i:=1 to MaxID do If (GetPlayerStat(i,'Active') = true) and (GetPlayerStat(i,'Team') = GetPlayerStat(ID,'Team')) then If Allowed[SecondaryNum] > 0 then SetWeaponActive(i,SecondaryNum,true) else SetWeaponActive(i,SecondaryNum,false); end; end;end;