19.04.2018, 19:22
Hi, this command shows online faction members, but I want to make it if playerid is in faction 1, to show only faction 1 members.
PHP Code:
CMD:factionon(playerid, params[])
{
new str[128], DUTY_STR[24], COLOR, counter = 0;
SendClientMessage(playerid, -1, " - Online members - ");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if((pInfo[i][pRank] < 1)) return SendClientMessage(playerid, -1, "You are not from any faction");
if(IsPlayerConnected(i))
{
if(pInfo[i][pFaction] == pInfo[i][pFaction]) /// there i dont know what to do
{
if(!pInfo[i][pFactionDuty])
{
DUTY_STR = "Off Duty";
COLOR = COLOR_WHITE;
}
else
{
DUTY_STR = "ON DUTY";
COLOR = COLOR_RED;
}
format(str, sizeof(str),"%s: %s - %s", GetRankName(i), PlayerName(i), DUTY_STR);
SendClientMessage(playerid, COLOR, str);
counter++;
}
} }
return 1;
}