23.02.2016, 23:22
This command:
Should show me a dialog with all the helpers from the database.
It does. Now when I select a helper from the list, it should send me to a different dialog.
That doesn't work.
This is my OnDialogResponse
Yes, I have defined everything.
Код:
CMD:factions(playerid, params[])
{
new members;
format(szMessage, sizeof(szMessage), "Factions:");
for(new xf = 0; xf < MAX_GROUPS; xf++)
{
if(strlen(groupVariables[xf][gGroupName]) >= 1 && strcmp(groupVariables[xf][gGroupName], "None", true))
{
new stringy2[256];
mysql_format(handle, stringy2, 256, "SELECT * FROM `playeraccounts` WHERE `playerGroup` = '%d'", xf);
new Cache: resultx = mysql_query (handle, stringy2);
members = cache_get_row_count();
cache_delete(resultx);
format(szMessage, sizeof(szMessage),"%s\n%s [%d/%d]", szMessage, groupVariables[xf][gGroupName], members, groupVariables[xf][gSlots]);
}
}
ShowPlayerDialog(playerid, 4500, DIALOG_STYLE_LIST,"Server: Factions", szMessage, "Select", "Cancel");
SelFaction[playerid] = 0;
return 1;
}
It does. Now when I select a helper from the list, it should send me to a different dialog.
That doesn't work.
This is my OnDialogResponse
Код:
case DIALOG_HELPERS:
{
if(response)
{
if(listitem >= 1)
{
new item = listitem;
format(playerVariables[playerid][pSelected], MAX_PLAYER_NAME, "%s",Selected[item][snume]);
ShowPlayerDialog(playerid, DIALOG_HELPERS2, DIALOG_STYLE_LIST, "Select an action", "Uninvite\nChangerank\nFwarn", "Go", "Cancel");
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You can't click on this item.");
}
}
}


