20.11.2015, 20:47
So, today I've encountered a problem with my /members command
Everything works fine, it is doing exactly what it is supposed to do (show online members of a faction)
But here's the problem, while the player is online it is being displayed in a dialog, along with other members
whenever he logs out, he's not being removed from that string and I can still see him when I use /members.
What might cause this bug?
pawn Код:
CMD:members(playerid, params[])
{
new userlist[250];
new name[MAX_PLAYER_NAME];
new counton[128];
new count = 0;
if(PlayerVar[playerid][GroupRank] > 5)
{
for(new i; i < MAX_PLAYERS; i++) {
if(PlayerVar[i][Group] == PlayerVar[playerid][Group]){
GetPlayerName(i, name, sizeof(name));
format(userlist, sizeof(userlist), "%s{068481}%s{FFFFFF} - Rank %d\n", userlist, name, PlayerVar[i][GroupRank]);
count++;
format(counton, sizeof(counton), "Membrii totali conectati in factiunea %s: %d", GroupInfo[PlayerVar[playerid][Group]][gName], count);
}
}
}
SCM(playerid, COLOR_NOB, counton);
ShowPlayerDialog(playerid, 97, DIALOG_STYLE_LIST, "UXG RPG: Members", userlist, "OK", "Cancel");
return 1;
}
But here's the problem, while the player is online it is being displayed in a dialog, along with other members
whenever he logs out, he's not being removed from that string and I can still see him when I use /members.
What might cause this bug?