Author Topic: [Suggestion] SpectatingPlayers: byte;  (Read 894 times)

0 Members and 1 Guest are viewing this topic.

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
[Suggestion] SpectatingPlayers: byte;
« on: June 04, 2007, 02:34:20 pm »
Exact same thing as AlphaPlayers, BravoPlayers, CharliePlayers, and DeltaPlayers, except this is for spectating players. I know you could just do SpectatingPlayers := NumPlayers - AlphaPlayers - BravoPlayers - CharliePlayers - DeltaPlayers but that is... using a global byte would make it a bit cleaner for when the number of spectating players is needed.

Offline urraka

  • Soldat Developer
  • Flagrunner
  • ******
  • Posts: 703
Re: [Suggestion] SpectatingPlayers: byte;
« Reply #1 on: June 04, 2007, 02:59:56 pm »
You can't do
Code: [Select]
SpectatingPlayers := NumPlayers - AlphaPlayers - BravoPlayers - CharliePlayers - DeltaPlayers if you are in deathmatch.

You can use this:
Code: [Select]
function SpectatingPlayers():byte;
var
    i: integer;
begin
    Result := 0;
    for i := 1 to 32 do
        if (GetPlayerStat(i, 'Active') = true) and (GetPlayerStat(i, 'Team') = 5) then
            Result := Result + 1;
end;
urraka

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: [Suggestion] SpectatingPlayers: byte;
« Reply #2 on: June 04, 2007, 03:41:23 pm »
Oh, another suggustion while im at it... # of players on team 0 :)
forgot about that... maybe, call it... DMPlayers or... TeamlessPlayers or something :P
so 2 teams are excluded from total players :( Thats not a nice thing to exclude them.

Offline Avarax

  • Veteran
  • *****
  • Posts: 1529
    • Official Hexer & MMod site
Re: [Suggestion] SpectatingPlayers: byte;
« Reply #3 on: June 04, 2007, 04:01:41 pm »
function NeutralPlayers():byte;
var
    i: integer;
begin
    Result := 0;
    for i := 1 to 32 do
        if (GetPlayerStat(i, 'Active') = true) and (GetPlayerStat(i, 'Team') = 0) then
            Result := Result + 1;
end
I like to have one Martini
Two at the very most
Three I'm under the table
Four I'm under the host

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: [Suggestion] SpectatingPlayers: byte;
« Reply #4 on: June 04, 2007, 10:24:01 pm »
I know I know... just a request for it being in a global variable. <3