ShowPlayerDialog Bug
#1

This command:

Код:
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;
}
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

Код:
		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.");
				}
			}
		}
Yes, I have defined everything.
Reply
#2

DIALOG_HELPERS is 4500?
Reply
#3

Quote:
Originally Posted by Jefff
Посмотреть сообщение
DIALOG_HELPERS is 4500?
No, its
Код:
#define DIALOG_HELPERS	84176
#define DIALOG_HELPERS2 81848
Reply
#4

Quote:
Originally Posted by danielpalade
Посмотреть сообщение
No, its
Код:
#define DIALOG_HELPERS	84176
#define DIALOG_HELPERS2 81848
Then you need to change this:
Код:
ShowPlayerDialog(playerid, 4500, DIALOG_STYLE_LIST,"Server: Factions", szMessage, "Select", "Cancel");
to
Код:
ShowPlayerDialog(playerid, DIALOG_HELPERS, DIALOG_STYLE_LIST,"Server: Factions", szMessage, "Select", "Cancel");
By the way you are doing a database query on a loop, try to optimize it (I am not sure how your database structure and what you wanted from it though, so i have no idea to write the code for it, perhaps it's fine).
Reply
#5

Change
Quote:

ShowPlayerDialog(playerid, DIALOG_HELPERS, DIALOG_STYLE_LIST,"Server: Factions", szMessage, "Select", "Cancel");
SelFaction[playerid] = 0;

And At Dialog Response
PHP код:
        if(dialogid == DIALOG_HELPERS)
        {
            if(
response)
            {
                if(
listitem >= 1)
                {
                    new 
item listitem;
                    
format(playerVariables[playerid][pSelected], MAX_PLAYER_NAME"%s",Selected[item][snume]);
                    
ShowPlayerDialog(playeridDIALOG_HELPERS2DIALOG_STYLE_LIST"Select an action""Uninvite\nChangerank\nFwarn""Go""Cancel");
                }
                else
                {
                    
SendClientMessage(playeridCOLOR_GREY"You can't click on this item.");
                }
            }
        } 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)