20.04.2018, 10:42
its because the i where the sendclient message code is searching all players for the faction id < 1 so sends the message change it to [playerid]
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++) { //This is where you had the [i] instead of [playerid] if((pInfo[playerid][pRank] < 1)) return SendClientMessage(playerid, -1, "You are not from any faction"); if(IsPlayerConnected(i)) { if(pInfo[playerid][pFaction] == pInfo[i][pFaction]) { 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; }