0 Members and 2 Guests are viewing this topic.
Function Active(ID: Byte): Boolean; //Checks if Player is active, it's just faster than GetPlayerStat(). Begin Result := False; if GetPlayerStat(ID,'Active') = True Then Result := True;end;
With GetTeamPlayers(), you can see how many players there are in a team. Usage: /getplayers <Team>
if GetPlayerStat(ID,'Active') = True Then Result := True;
In regards to the Active function:[...]
How about DeathmatchPlayers, AlphaPlayers, BravoPlayers, CharliePlayers, DeltaPlayers and Spectators (built-in variables)? This one is useless. You could change the whole 32-iterations loop into one case Team of (0 to 5).
Do GetTeamPlayers(0) to see if it doesn't return how many players have no team.GetTeamPlayers(0) returns all players that doesn't have a team.GetTeamPlayers(1) returns all players in Alpha Team.GetTeamPlayers(2) returns all players in Bravo Team.GetTeamPlayers(3) returns all players in Charlie Team.GetTeamPlayers(4) returns all players in Delta Team.GetTeamPlayers(5) returns all players in Spectator Group.If you wanna prove it, go "/addbot0 Kruger", and then "/getplayers 0"..It doesn't need Case of.
case Team of 0: result:= DeathmatchPlayers; 1: result:= AlphaPlayers; 2: result:= BravoPlayers; 3: result:= CharliePlayers; 4: result:= DeltaPlayers; 5: result:= Spectators;end;
I don't really care. Does the same thing.
It doesn't need Case of.
That's exactly what I was talking about. Apply this and delete that Active(ID) function and it'll be okay.