PDA

View Full Version : Issue with a cmd


Mike861
10/03/2018, 09:35 AM
So this command is supposed to show the members of organization you're in.However, if you visit a checkpoint of other organizations/factions you can click on members in that dialogbox and you get another box saying Kick Member or Check activity which shouldn't be available for foreign organization members.How do i fix that?
CMD:
CMD:members(playerid, params[])
{
new string[50], tmp2[256], giveplayer[MAX_PLAYER_NAME], temp1, temp2;
if (GetPVarInt(playerid, "playerorg") == 0) return SendClientMessage2(playerid, COLOR_RED, "Error: You aren't in an organization!");
if (orgleader[playerid] == 0) return SendClientMessage2(playerid, COLOR_RED, "Error: You aren't the (co)leader of an organization.");
format(string, 10, "org%d", GetPVarInt(playerid, "playerorg"));
temp2 = dini_Int(AddDirFile(dir_orgfiles, string), "maxmembers");
new tmp3[2048], tmp4[2048], tmp5[2048];
for (new o = 1; o <= temp2; o++)
{
format(giveplayer, 12, "member%d", o);
tmp2 = dini_Get(AddDirFile(dir_orgfiles, string), giveplayer);
if (strcmp(tmp2, "server", false) != 0)
{
temp1 = dini_Int(AddDirFile(dir_userfiles, tmp2), "orgleader");
tmp4 = dini_Get(AddDirFile(dir_userfiles, tmp2), "RankName");
tmp5 = dini_Get(AddDirFile(dir_userfiles, tmp2), "RankColor");
if (temp1 == 1)
{
if (dini_Isset(AddDirFile(dir_userfiles, tmp2), "RankName"))
{
format(tmp3, sizeof(tmp3), "%s%s\t{%s}%s\t%s\tLeader", tmp3, tmp2, tmp5,tmp4);
format(tmp3, sizeof(tmp3), "%s\n", tmp3, tmp2, tmp5,tmp4);
}
else
{
format(tmp3, sizeof(tmp3), "%s%s\t""\tLeader", tmp3, tmp2);
format(tmp3, sizeof(tmp3), "%s\n", tmp3, tmp2);
}
}
else if (temp1 == 2)
{
if (dini_Isset(AddDirFile(dir_userfiles, tmp2), "RankName"))
{
format(tmp3, sizeof(tmp3), "%s%s\t{%s}%s\t%s\tCo-Leader", tmp3, tmp2, tmp5,tmp4);
format(tmp3, sizeof(tmp3), "%s\n", tmp3, tmp2, tmp5, tmp4);
}
else
{
format(tmp3, sizeof(tmp3), "%s%s\t""\tCo-Leader", tmp3, tmp2);
format(tmp3, sizeof(tmp3), "%s\n", tmp3, tmp2);
}
}
else if (dini_Isset(AddDirFile(dir_userfiles, tmp2), "RankName"))
{
format(tmp3, sizeof(tmp3), "%s%s\t{%s}%s", tmp3, tmp2, tmp5,tmp4);
format(tmp3, sizeof(tmp3), "%s\n", tmp3, tmp2, tmp5, tmp4);
}
else
{
format(tmp3, sizeof(tmp3), "%s%s", tmp3, tmp2);
format(tmp3, sizeof(tmp3), "%s\n", tmp3, tmp2);
}
}
}
format(tmp2, sizeof(tmp2), "%s members list", dini_Get(AddDirFile(dir_orgfiles, string), "name"));
ShowPlayerDialog2(playerid, DIALOG_OMEMBERS + playerid, DIALOG_STYLE_TABLIST, tmp2, tmp3, "Select", "Cancel");
SendClientMessage2(playerid, COLOR_PEACH, "You are viewing your organizations member list.");
return 1;
}