/teams command? -
cod5devious - 26.05.2012
So I been looking around and I couldn't find a zcmd command that shows number of players in teams like
/teams
Thats does like sendclientmessage:
Traids: (number of players on team)
Aztecas: (number of players on team)
.ect
Does anyone know a code of it or something?
Re: /teams command? -
cod5devious - 26.05.2012
Bump
Re: /teams command? -
cod5devious - 26.05.2012
BUMP!
Re: /teams command? -
HighPitchedVoice - 26.05.2012
ForceClassSelection(playerid);
Re: /teams command? -
milanosie - 26.05.2012
Quote:
Originally Posted by HighPitchedVoice
ForceClassSelection(playerid);
|
Thats not what he is asking for.
Here, take this /admins.
Its the way every list of teams/ranks/variables should be made.
Just change the admin variable to your teams
pawn Код:
CMD:admins(playerid, params[])
{
new string[128], acount = 0, Name[MAX_PLAYER_NAME];
foreach(Player, i)
{
if(PlayerInfo[i][AdminLevel] >= 1)
{
acount++;
}
}
if(acount > 0)
{
SendClientMessage(playerid, COLOR_ORANGE, "Reality Roleplay Online Administrators:");
foreach(Player, i)
{
if(PlayerInfo[i][AdminLevel] >= 1)
{
GetPlayerName(i, Name, sizeof(Name));
if(PlayerInfo[i][AdminLevel] == 1)
{
format(string, sizeof string, "Trial Moderator: %s (ID: %d) - Admin Level: %d", Name, i, PlayerInfo[i][AdminLevel]);
}
if(PlayerInfo[i][AdminLevel] == 2)
{
format(string, sizeof string, "Moderator: %s (ID: %d) - Admin Level: %d", Name, i, PlayerInfo[i][AdminLevel]);
}
if(PlayerInfo[i][AdminLevel] == 3)
{
format(string, sizeof string, "Administrator: %s (ID: %d) - Admin Level: %d", Name, i, PlayerInfo[i][AdminLevel]);
}
if(PlayerInfo[i][AdminLevel] == 4)
{
format(string, sizeof string, "Administrator: %s (ID: %d) - Admin Level: %d", Name, i, PlayerInfo[i][AdminLevel]);
}
if(PlayerInfo[i][AdminLevel] == 5)
{
format(string, sizeof string, "High Administrator: %s (ID: %d) - Admin Level: %d", Name, i, PlayerInfo[i][AdminLevel]);
}
if(PlayerInfo[i][AdminLevel] == 6 && !IsPlayerAdmin(i))
{
format(string, sizeof string, "Head Manager: %s (ID: %d) - Admin Level: %d", Name, i, PlayerInfo[i][AdminLevel]);
}
if(IsPlayerAdmin(i) || PlayerInfo[i][AdminLevel] > 6 )
{
format(string, sizeof string, "Server Owner: %s (ID: %d) - Admin Level: %d", Name, i, PlayerInfo[i][AdminLevel]);
}
SendClientMessage(playerid, COLOR_GREEN, string);
}
}
format(string, sizeof string, "Total administrators online: %d.", acount);
SendClientMessage(playerid, COLOR_ORANGE, string);
}
else if(acount < 1) SendClientMessage(playerid, 0xD8D8D8FF, "There are no administrators online!");
return 1;
}
Re: /teams command? -
Kitten - 26.05.2012
pawn Код:
new playersAliveCount;
CMD:teams()
{
new string[128];
format(string,sizeof(string), "Traids : %d, Aztecas: %d",GetTeamPlayersAlive(TEAM_TRAIDS),GetTeamPlayersAlive(TEAM_AZTECAS));
SendClientMessage(playerid,-1,string);
return 1;
}
GetTeamPlayersAlive(teamid)
{
new count;
for(new i; i < playersAliveCount; i++)
{
if(IsPlayerConnected(i) && gTeam[i] == teamid) count++;
}
return count;
}
Use playersAliveCount++ or -- when the player team leaves for example
pawn Код:
public OnPlayerDeath(playerid, killerid, reason) return playersAliveCount--;
public OnPlayerSpawn(playerid) return playersAliveCount++;
Change the gTeam to your function of setting teams.
Re: /teams command? -
cod5devious - 26.05.2012
Cheers
Kitten your the best.