19.12.2013, 15:41
Okay, so I have a dynamic faction system in progress but I am getting stuck at the editing name part..
My problem is that the name does not show up, or even saves, one the name has been entered. I am fairly new to dynamics in dialogs, so sorry if it's something simple..
What have I done wrong, and how can I fix it
pawn Код:
CMD:editfaction(playerid, params[])
{
new string[128], id;
if(PlayerInfo[playerid][pAdmin] < 5) return SCM(playerid, COLOR_MGREY, "ERROR: You do not have authority to use this command.");
else
{
format(string,sizeof(string), "1) %s\n2) %s\n3) %s\n4) %s\n5) %s\n6) %s\n7) %s\n8) %s\n9) %s\n10) %s\n11) %s\n12) %s\n13) %s\n14) %s\n15) %s\n", FInfo[id][fName]);
ShowPlayerDialog(playerid, DIALOG_EDITFAC, DIALOG_STYLE_LIST, "IRG:RP - Dynamic Group Editor", string, "Select", "Exit");
}
return 1;
}
pawn Код:
if(dialogid == DIALOG_EDITFAC)
{
if(response)
{
if(listitem == 0)
{
new string[128];
format(string,sizeof(string), "Name: %s\nFaction Type:", FInfo[1][fName]);
ShowPlayerDialog(playerid, DIALOG_EDITFAC1, DIALOG_STYLE_LIST, "IRG:RP - Dynamic Group Editor", string, "Select", "Exit");
}
}
return 1;
}
pawn Код:
if(dialogid == DIALOG_EDITFAC1)
{
if(response)
{
if(listitem == 0)
{
new string[128];
format(string,sizeof(string), "Please enter the new name of the faction below\n\n");
ShowPlayerDialog(playerid, DIALOG_EDITFAC2, DIALOG_STYLE_INPUT, "IRG:RP - Edit Faction Name", string, "Select", "Exit");
}
}
return 1;
}
if(dialogid == DIALOG_EDITFAC2)
{
if(response)
{
new name[40], Fam, id;
Fam = PlayerInfo[playerid][pFaction];
FInfo[Fam][fName] = name;
SaveFac(id);
}
else
{
new string[128];
format(string,sizeof(string), "Name: %s\nFaction Type:", FInfo[1][fName]);
ShowPlayerDialog(playerid, DIALOG_EDITFAC1, DIALOG_STYLE_LIST, "IRG:RP - Dynamic Group Editor", string, "Select", "Exit");
}
}
What have I done wrong, and how can I fix it