14.11.2015, 19:00
So, I've been working on a gamemode for like 2-3 weeks and I suddenly got stuck.
I created a dynamic faction system now I want to create some commands for it.
Whenever a player joins a faction, It saves player's faction ID in his variables,
I want to loop through offline players to check their group's ID in order to list them into a dialog
At this moment the command's only listing online players.
Is it possible to list offline players aswell?
I created a dynamic faction system now I want to create some commands for it.
Whenever a player joins a faction, It saves player's faction ID in his variables,
I want to loop through offline players to check their group's ID in order to list them into a dialog
PHP код:
CMD:members(playerid, params[])
{
new userlist[MAX_PLAYERS];
new name[MAX_PLAYER_NAME];
if(PlayerVar[playerid][GroupRank] > 5)
{
for(new i; i < MAX_PLAYERS; i++) {
if(PlayerVar[i][Group] == PlayerVar[playerid][Group]){
new string[256];
GetPlayerName(i, name, sizeof(name));
format(string, sizeof(string), "{068481}%s{FFFFFF} - Rank %d", name, PlayerVar[i][GroupRank]);
strcat(userlist, string);
}
}
}
return ShowPlayerDialog(playerid, 97, DIALOG_STYLE_LIST, "UXG RPG: Members", userlist, "OK", "Cancel");
}
Is it possible to list offline players aswell?