Dialog Help PLEASE!
#1

So i have started to create my own server and i recently put in a dialog, the dialog appears fine and when i click a option it is meant to teleport me to the place i clicked but in stead it pops up the please log in dialog and when i login it just says, Welcome

Why dont it teleport me PLEASE HELP


Please help

Код:
case DIALOG_LOGIN:
        {
            if ( !response ) return Kick ( playerid );
            if( response )
            {
                if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
                {
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    new
                        tmp2[ 256 ],
                        playername2[ MAX_PLAYER_NAME ]
					;
	    			GetPlayerName(playerid, playername2, sizeof(playername2));
   					format(tmp2, sizeof(tmp2), "~w~Welcome ~n~~g~%s", playername2);
					GameTextForPlayer(playerid, tmp2, 5000, 1);
					SetTimerEx("UnsetFirstSpawn", 5000, false, "i", playerid);
                    GivePlayerCash(playerid, PlayerInfo[playerid][pCash]);
   					SetSpawnInfo(playerid, PlayerInfo[playerid][pTeam], PlayerInfo[playerid][pSkin], PlayerInfo[playerid][pPos_x], PlayerInfo[playerid][pPos_y], PlayerInfo[playerid][pPos_z], 1.0, -1, -1, -1, -1, -1, -1);
				}
                else
                {
                    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Login","You have entered an incorrect password.\nType your password below to login.","Login","Quit");
                }
                return 1;
            }
        }
    }
    if(dialogid == 2)
	{
		if(response)
		{
			new message[256+1];
			if(listitem == 0)
			{
			format(message, 256, "You selected Los Santos Police Department, And got teleported to there!", listitem);
		  	SendClientMessage(playerid, 0xFFFFFFFF, message);
		  	SetPlayerPos(playerid, 1535.5732,-1675.6609,13.3828);
 			}
			if(listitem == 1)
			{
			  format(message, 256, "You selected Unity Station, And got teleported to there!", listitem);
			  SendClientMessage(playerid, 0xFFFFFFFF, message);
			  SetPlayerPos(playerid, 1729.6116,-1855.1116,13.4141);
	 	      return 1;
  			}
		}
	}
	return 0;
}
Reply
#2

Show us how you show the dialog, I think you have incorrect dialog id put in the ShowPlayerDialog line
Reply
#3

Quote:
Originally Posted by WooTFTW
Посмотреть сообщение
Show us how you show the dialog, I think you have incorrect dialog id put in the ShowPlayerDialog line

CMD:teleport(playerid, param[])
{
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Teleport Menu", "Unity Station \n Los Santos Police Department", "Select", "Cancel");
return 1;
}
Reply
#4

I think you have a line like this #define DIALOG_LOGIN 2?
Then you should change it to #define DIALOG_LOGIN 3
Reply
#5

Quote:
Originally Posted by WooTFTW
Посмотреть сообщение
I think you have a line like this #define DIALOG_LOGIN 2?
Then you should change it to #define DIALOG_LOGIN 3

#define DIALOG_REGISTER 1
#define DIALOG_LOGIN 2
#define DIALOG_AGE 3
#define DIALOG_SEX 4


I have that what should i change
Reply
#6

pawn Код:
case DIALOG_LOGIN:
        {
            if ( !response ) return Kick ( playerid );
            if( response )
            {
                if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
                {
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    new
                        tmp2[ 256 ],
                        playername2[ MAX_PLAYER_NAME ]
                    ;
                    GetPlayerName(playerid, playername2, sizeof(playername2));
                    format(tmp2, sizeof(tmp2), "~w~Welcome ~n~~g~%s", playername2);
                    GameTextForPlayer(playerid, tmp2, 5000, 1);
                    SetTimerEx("UnsetFirstSpawn", 5000, false, "i", playerid);
                    GivePlayerCash(playerid, PlayerInfo[playerid][pCash]);
                    SetSpawnInfo(playerid, PlayerInfo[playerid][pTeam], PlayerInfo[playerid][pSkin], PlayerInfo[playerid][pPos_x], PlayerInfo[playerid][pPos_y], PlayerInfo[playerid][pPos_z], 1.0, -1, -1, -1, -1, -1, -1);
                }
                else
                {
                    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Login","You have entered an incorrect password.\nType your password below to login.","Login","Quit");
                }
                return 1;
            }
        }
    }
    if(dialogid == 5)
    {
        if(response)
        {
            new message[256+1];
            if(listitem == 0)
            {
            format(message, 256, "You selected Los Santos Police Department, And got teleported to there!", listitem);
            SendClientMessage(playerid, 0xFFFFFFFF, message);
            SetPlayerPos(playerid, 1535.5732,-1675.6609,13.3828);
            }
            if(listitem == 1)
            {
              format(message, 256, "You selected Unity Station, And got teleported to there!", listitem);
              SendClientMessage(playerid, 0xFFFFFFFF, message);
              SetPlayerPos(playerid, 1729.6116,-1855.1116,13.4141);
              return 1;
            }
        }
    }
    return 0;
}
pawn Код:
CMD:teleport(playerid, param[])
{
ShowPlayerDialog(playerid, 5, DIALOG_STYLE_LIST, "Teleport Menu", "Unity Station \n Los Santos Police Department", "Select", "Cancel");
return 1;
}
Here, this should fix it.
You should work on your scripting style tho, because its inefficent.
Reply
#7

Quote:
Originally Posted by WooTFTW
Посмотреть сообщение
pawn Код:
case DIALOG_LOGIN:
        {
            if ( !response ) return Kick ( playerid );
            if( response )
            {
                if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
                {
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    new
                        tmp2[ 256 ],
                        playername2[ MAX_PLAYER_NAME ]
                    ;
                    GetPlayerName(playerid, playername2, sizeof(playername2));
                    format(tmp2, sizeof(tmp2), "~w~Welcome ~n~~g~%s", playername2);
                    GameTextForPlayer(playerid, tmp2, 5000, 1);
                    SetTimerEx("UnsetFirstSpawn", 5000, false, "i", playerid);
                    GivePlayerCash(playerid, PlayerInfo[playerid][pCash]);
                    SetSpawnInfo(playerid, PlayerInfo[playerid][pTeam], PlayerInfo[playerid][pSkin], PlayerInfo[playerid][pPos_x], PlayerInfo[playerid][pPos_y], PlayerInfo[playerid][pPos_z], 1.0, -1, -1, -1, -1, -1, -1);
                }
                else
                {
                    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Login","You have entered an incorrect password.\nType your password below to login.","Login","Quit");
                }
                return 1;
            }
        }
    }
    if(dialogid == 5)
    {
        if(response)
        {
            new message[256+1];
            if(listitem == 0)
            {
            format(message, 256, "You selected Los Santos Police Department, And got teleported to there!", listitem);
            SendClientMessage(playerid, 0xFFFFFFFF, message);
            SetPlayerPos(playerid, 1535.5732,-1675.6609,13.3828);
            }
            if(listitem == 1)
            {
              format(message, 256, "You selected Unity Station, And got teleported to there!", listitem);
              SendClientMessage(playerid, 0xFFFFFFFF, message);
              SetPlayerPos(playerid, 1729.6116,-1855.1116,13.4141);
              return 1;
            }
        }
    }
    return 0;
}
pawn Код:
CMD:teleport(playerid, param[])
{
ShowPlayerDialog(playerid, 5, DIALOG_STYLE_LIST, "Teleport Menu", "Unity Station \n Los Santos Police Department", "Select", "Cancel");
return 1;
}
Here, this should fix it.
You should work on your scripting style tho, because its inefficent.

Sorry, im new to scripting just looking at some tutorials what is the best way to script
Reply
#8

Quote:
Originally Posted by Scripter12345
Посмотреть сообщение
Sorry, im new to scripting just looking at some tutorials what is the best way to script
It's alright, I scripted like that when I was new to scripting too, just keep learning.
Reply
#9

Quote:
Originally Posted by WooTFTW
Посмотреть сообщение
It's alright, I scripted like that when I was new to scripting too, just keep learning.
It still did not work


I have this


Код:
case DIALOG_LOGIN:
        {
            if ( !response ) return Kick ( playerid );
            if( response )
            {
                if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
                {
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    new
                        tmp2[ 256 ],
                        playername2[ MAX_PLAYER_NAME ]
					;
	    			GetPlayerName(playerid, playername2, sizeof(playername2));
   					format(tmp2, sizeof(tmp2), "~w~Welcome ~n~~g~%s", playername2);
					GameTextForPlayer(playerid, tmp2, 5000, 1);
					SetTimerEx("UnsetFirstSpawn", 5000, false, "i", playerid);
                    GivePlayerCash(playerid, PlayerInfo[playerid][pCash]);
   					SetSpawnInfo(playerid, PlayerInfo[playerid][pTeam], PlayerInfo[playerid][pSkin], PlayerInfo[playerid][pPos_x], PlayerInfo[playerid][pPos_y], PlayerInfo[playerid][pPos_z], 1.0, -1, -1, -1, -1, -1, -1);
				}
                else
                {
                    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Login","You have entered an incorrect password.\nType your password below to login.","Login","Quit");
                }
                return 1;
            }
        }
    }
    if(dialogid == 5)
	{
		if(response)
		{
			new message[256+1];
			if(listitem == 0)
			{
			format(message, 256, "You selected Los Santos Police Department, And got teleported to there!", listitem);
		  	SendClientMessage(playerid, 0xFFFFFFFF, message);
		  	SetPlayerPos(playerid, 1535.5732,-1675.6609,13.3828);
 			}
			if(listitem == 1)
			{
			  format(message, 256, "You selected Unity Station, And got teleported to there!", listitem);
			  SendClientMessage(playerid, 0xFFFFFFFF, message);
			  SetPlayerPos(playerid, 1729.6116,-1855.1116,13.4141);
	 	      return 1;
  			}
		}
	}
	return 0;
}
Код:
CMD:teleport(playerid, param[])
{
    ShowPlayerDialog(playerid, 5, DIALOG_STYLE_LIST, "Teleport Menu", "Unity Station \n Los Santos Police Department", "Select", "Cancel");
	return 1;
}
Should i add something on to this ?


Код:
#define DIALOG_REGISTER 1
#define DIALOG_LOGIN 2
#define	DIALOG_AGE 3
#define DIALOG_SEX 4
Reply
#10

Try changing the 5 to 10000, maybe you have other dialogs which uses the same id
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)