Strange Dialog issue
#1

Dialog 1:
Код:
if(dialogid == DIALOG_EVENTJOIN+1)
    {
        if(response)
        {
            PeopleInEvent ++;
            IsInEvent[playerid] = 1;
            TogglePlayerControllable(playerid,0);
            
            new Float:X,Y,Z;
            GetPlayerPos(playerid,Float:X,Float:Y,Float:Z);
            
            new Random = random(sizeof(StartPositions));
            SetPlayerPos(playerid, StartPositions[Random][0], StartPositions[Random][1], StartPositions[Random][2]);
            
		}
		else
		{
		    SendClientMessage(playerid, -1, "You declined to join an event.");
		    VotedFor[playerid][1] = 0;
		    EventVoteType[1] -= 1;
		    HasVoted[playerid] = 0;
		    WillParticipate[playerid] = 0;
		}
		return 1;
	}
Dialog 2:

Код:
if(dialogid == DIALOG_TVCT) // Terrorists vs Counter Terrorists
	{
	    if(response) // voted
	    {
	 		HasVoted[playerid] = 1;
	    	SendClientMessage(playerid, -1, "Thanks for the Vote! You voted for 'Terrorists vs Counter Terrorists'.");
	    	EventVoteType[0] += 1;
	    	VotedFor[playerid][0] = 1;
	    	WillParticipate[playerid] = 1;
		}
		else
		{
		    strcat(szDialog, "{8585C2}Event Name\t{8585C2}Event Type\t{8585C2}Current Votes");
			format(String, sizeof String, "\n{008000}Terrorists vs Counter Terrorists\t {800080}TDM\t{FF8000}%d Votes", EventVoteType[0]);
		    strcat(szDialog, String);
			format(String, sizeof String, "\n{008000}I the Conquer\t {800080}DM\t{FF8000}%d Votes",EventVoteType[1]);
		    strcat(szDialog, String);
			format(String, sizeof String, "\n{008000}Don't let them take it!\t {800080}TDM\t{FF8000}%d Votes",EventVoteType[2]);
		    strcat(szDialog, String);
		    
		    ShowPlayerDialog(playerid, DIALOG_EVENT, DIALOG_STYLE_TABLIST_HEADERS, "{0080FF}Vote for your favorite event", szDialog, "Next", "Close");
		}
		return 1;
	}
So the problem is really strange "dialog 2" response buttons are responding with things scripted in "dialog 1"... I mean i don't get it how is that possible.

Here is when I show dialogs:

Код:
if(dialogid == DIALOG_EVENT)
    {
        if(response)
        {
            if(listitem == 0) // Terrorists vs Counter Terrorists
            {
                ShowPlayerDialog(playerid, DIALOG_TVCT, DIALOG_STYLE_MSGBOX, "{0080FF}Event Description", "{0080FF}Event Name: {008000}Terrorists vs Counter Terrorists!\n{0080FF}Event Type: {800080}Team Deathmatch", "Vote", "Back");
                

			}
			if(listitem == 1) // / I the conquer
            {
            	ShowPlayerDialog(playerid, DIALOG_ITC, DIALOG_STYLE_MSGBOX, "{0080FF}Event Description", "{0080FF}Event Name: {008000}I the Conquer!\n{0080FF}Event Type: {800080}Deathmatch", "Vote", "Back");


			}
			if(listitem == 2) // Don't let them take it!
            {
                ShowPlayerDialog(playerid, DIALOG_DLTTI, DIALOG_STYLE_MSGBOX, "{0080FF}Event Description", "{0080FF}Event Name: {008000}Don't let them take it!\n{0080FF}Event Type: {800080}Team Deathmatch", "Vote", "Back");
            

			}
        }
        else
        {
            SendClientMessage(playerid, -1, "You closed the dialog.");
        }
        return 1;
    }
If you need any other part of the code just let me know.
Reply
#2

Show us #define DIALOG_EVENTJOIN and #define DIALOG_TVCT, I think your problem is there.
Reply
#3

Код:
enum
{
    DIALOG_EVENT,
    DIALOG_RESULT,
    DIALOG_EVENTJOIN,
    DIALOG_TVCT,
    DIALOG_ITC,
    DIALOG_DLTTI
}
Reply
#4

Quote:
Originally Posted by Lajko1
Посмотреть сообщение
Код:
if(dialogid == DIALOG_EVENTJOIN+1)
Quote:
Originally Posted by Lajko1
Посмотреть сообщение
Код:
enum
{
    DIALOG_EVENT,
    DIALOG_RESULT,
    DIALOG_EVENTJOIN, // 2
    DIALOG_TVCT, // 3
    DIALOG_ITC,
    DIALOG_DLTTI
}
That +1 makes them conflict because they both use dialogid 3.
Reply
#5

As I said - yes, your problem is there.
U need to add a new DIALOG_EVENTJOIN1 and use it.
Reply
#6

Fixed, you two are correct, ty
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)