21.11.2015, 01:34
Quote:
You are saving with "GroupsData" tag, but you don't load it. Try
pawn Код:
|
PHP код:
new gfile[64];
for(new i; i < MAX_GROUPS; i++)
{
format(gfile, sizeof(gfile), "Groups/%d.ini", i);
if(fexist(gfile))
{
INI_ParseFile(file, "LoadGroups_%s", .bExtra = true, .extra = i);
}
}
forward LoadGroups_GroupsData(id, name[], value[]);
public LoadGroups_GroupsData(id, name[], value[])
{
INI_String("GroupName", GroupInfo[id][gName],75);
INI_String("LeaderName", GroupInfo[id][gLeaderName], MAX_PLAYER_NAME);
INI_Int("Active", GroupInfo[id][gActive]);
return 1;
}
PHP код:
COMMAND:groups(playerid, params[])
{
ListGroups(playerid);
return 1;
}
stock ListGroups(playerid)
{
new count, string[512];
for (new i = 0; i < MAX_GROUPS; i++)
{
if(GroupInfo[i][gActive] == 1)
{
count++;
format(string, sizeof (string), "%s %s\n", string, GroupInfo[i][gName]);
}
}
if (!count) SendClientMessage(playerid, -1, "no groups");
else ShowPlayerDialog(playerid, 286, DIALOG_STYLE_MSGBOX, "Groups", string, "Close", "");
return 1;
}