23.03.2012, 20:43
Heey all,
How can i detect the players in a team like:
/detectcops
Cops:
Admigo
Thanks Admigo
How can i detect the players in a team like:
/detectcops
Cops:
Admigo
Thanks Admigo
CMD:detectcops(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
SendClientMessage(playerid, COLOR_GREY, "(Online) Cops:");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pFaction] == 1)
{
new factiontext[64], sendername[MAX_PLAYER_NAME], string[128];
if(PlayerInfo[i][pRank] == 6) { factiontext = "Rank 6"; }
else if(PlayerInfo[i][pRank] == 5) { factiontext = "Rank 5"; }
else if(PlayerInfo[i][pRank] == 4) { factiontext = "Rank 4"; }
else if(PlayerInfo[i][pRank] == 3) { factiontext = "Rank 3"; }
else if(PlayerInfo[i][pRank] == 2) { factiontext = "Rank 2"; }
else if(PlayerInfo[i][pRank] == 1) { factiontext = "Rank 1"; }
else { factiontext = "Rank default"; }
GetPlayerName(i, sendername, sizeof(sendername));
sendername[strfind(sendername,"_")] = ' ';
if(FactionDuty[i] == 0)
{
format(string, 128, "%s: %s [Duty: No]", factiontext, sendername);
SendClientMessage(playerid, random(0xFFFFFFFF), string);
}
else
{
format(string, 128, "%s: %s [Rank: %d] [Duty: Yes]", factiontext, sendername);
SendClientMessage(playerid, 0xFAAFBEFF, string);
}
}
}
}
}
return 1;
}