I have this enum that stores the information of organizations stored with mysql.
There is a situation, in which I will display all the members of the organization, however as we can see there are more than 30 members and the current way in which I do this is to write the code for each member.
I would like to know if there is any way, to access the variable of each member without having to be one by one. Perhaps with the use of some repetition loop? It's possible?
PHP Code:
enum oInfo
{
oID,
oName[50],
oMoney,
oMaterials,
oMaconha,
oCrack,
oCocaina,
oOrgVip,
oOrgVipTime,
Float:oPosX,
Float:oPosY,
Float:oPosZ,
Float:oPosA,
oInterior,
oWorld,
oSkinLider,
oSkinLiderF,
oSkinMember,
oSkinMember2,
oSkinMember3,
oSkinMember4,
oSkinMember5,
oSkinMemberF,
oSalaryLider,
oSalaryMember,
oSalaryMember2,
oSalaryMember3,
oSalaryMember4,
oSalaryMember5,
oLider[MAX_PLAYER_NAME],
oSubLider[MAX_PLAYER_NAME],
oMember1[MAX_PLAYER_NAME],
oMember2[MAX_PLAYER_NAME],
oMember3[MAX_PLAYER_NAME],
oMember4[MAX_PLAYER_NAME],
oMember5[MAX_PLAYER_NAME],
oMember6[MAX_PLAYER_NAME],
oMember7[MAX_PLAYER_NAME],
oMember8[MAX_PLAYER_NAME],
oMember9[MAX_PLAYER_NAME],
oMember10[MAX_PLAYER_NAME],
oMember11[MAX_PLAYER_NAME],
oMember12[MAX_PLAYER_NAME],
oMember13[MAX_PLAYER_NAME],
oMember14[MAX_PLAYER_NAME],
oMember15[MAX_PLAYER_NAME],
oMember16[MAX_PLAYER_NAME],
oMember17[MAX_PLAYER_NAME],
oMember18[MAX_PLAYER_NAME],
oMember19[MAX_PLAYER_NAME],
oMember20[MAX_PLAYER_NAME],
oMember21[MAX_PLAYER_NAME],
oMember22[MAX_PLAYER_NAME],
oMember23[MAX_PLAYER_NAME],
oMember24[MAX_PLAYER_NAME],
oMember25[MAX_PLAYER_NAME],
oMember26[MAX_PLAYER_NAME],
oMember27[MAX_PLAYER_NAME],
oMember28[MAX_PLAYER_NAME],
oMember29[MAX_PLAYER_NAME],
oMember30[MAX_PLAYER_NAME]
};
new OrgInfo[MAX_ORGS][oInfo];
There is a situation, in which I will display all the members of the organization, however as we can see there are more than 30 members and the current way in which I do this is to write the code for each member.
PHP Code:
format(string, sizeof(string), "Member 1: %s\n", OrgInfo[org][oMember1]);
strcat(membersList, string);
format(string, sizeof(string), "Member 2: %s\n", OrgInfo[org][oMember2]);
strcat(membersList, string);
.... 30 Code Very Long
ShowPlayerDialog(playerid, DIALOG_ORG_BACK, DIALOG_STYLE_TABLIST_HEADERS, "Membros da Organiza??o", membersList, "Voltar", "Fechar");
I would like to know if there is any way, to access the variable of each member without having to be one by one. Perhaps with the use of some repetition loop? It's possible?