SA-MP Forums Archive
Dialog not appearing? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Dialog not appearing? (/showthread.php?tid=386965)



Dialog not appearing? - RLGaming - 22.10.2012

pawn Код:
public OnPlayerConnect(playerid)
{
    if(fexist(UserSavePath(playerid)))
    {
        new string[128], string2[128];
        format(string, sizeof(string), ""GM_NAME" Login: (%s)", GetPlayerNameEx(playerid));
        format(string, sizeof(string), "%s, we have found your account registered in the database!\nPlease login to continue.", GetPlayerNameEx(playerid));
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, string, string2, "Login", "Close");
    }
    else
    {
        new string[128], string2[128];
        format(string, sizeof(string), ""GM_NAME" Registration: (%s)", GetPlayerNameEx(playerid));
        format(string, sizeof(string), "%s, we cannot find this name registered in the database!\nPlease enter a password to register.", GetPlayerNameEx(playerid));
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, string, string2, "Register", "Close");
    }
    gPlayerLogged[playerid] = 0;
    return 1;
}
It doesn't show, it just shows me a camera pos and thats it, any help


Re: Dialog not appearing? - RedJohn - 22.10.2012

Код:
public OnPlayerConnect(playerid)
{
	if(fexist(UserSavePath(playerid)))
	{
	        new string[128], string2[128];
		format(string, sizeof(string), ""GM_NAME" Login: (%s)", GetPlayerNameEx(playerid));
		format(string2, sizeof(string2), "%s, we have found your account registered in the database!\nPlease login to continue.", GetPlayerNameEx(playerid));
		ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, string, string2, "Login", "Close");
	}
	else
	{
 		new string[128], string2[128];
		format(string, sizeof(string), ""GM_NAME" Registration: (%s)", GetPlayerNameEx(playerid));
		format(string2, sizeof(string2), "%s, we cannot find this name registered in the database!\nPlease enter a password to register.", GetPlayerNameEx(playerid));
		ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, string, string2, "Register", "Close");
	}
	gPlayerLogged[playerid] = 0;
	return 1;
}



Re: Dialog not appearing? - HyDrAtIc - 22.10.2012

Both of you are wrong,you should put the dialog id not the dialog name!

Код:
public OnPlayerConnect(playerid)
{
	if(fexist(UserSavePath(playerid)))
	{
	    new string[128], string2[128];
		format(string, sizeof(string), ""GM_NAME" Login: (%s)", GetPlayerNameEx(playerid));
		format(string, sizeof(string), "%s, we have found your account registered in the database!\nPlease login to continue.", GetPlayerNameEx(playerid));
		ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, string, string2, "Login", "Close");
	}
	else
	{
 		new string[128], string2[128];
		format(string, sizeof(string), ""GM_NAME" Registration: (%s)", GetPlayerNameEx(playerid));
		format(string, sizeof(string), "%s, we cannot find this name registered in the database!\nPlease enter a password to register.", GetPlayerNameEx(playerid));
		ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, string, string2, "Register", "Close");
	}
	gPlayerLogged[playerid] = 0;
	return 1;
}
In:

Код:
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, string, string2, "Register", "Close");
Remove DIALOG_LOGIN and replace it with the DIALOG_LOGIN id that you defined in top of your script.

Example:

Код:
#define DIALOG_LOGIN 3
So your code should be like this:

Код:
public OnPlayerConnect(playerid)
{
	if(fexist(UserSavePath(playerid)))
	{
	    new string[128], string2[128];
		format(string, sizeof(string), ""GM_NAME" Login: (%s)", GetPlayerNameEx(playerid));
		format(string, sizeof(string), "%s, we have found your account registered in the database!\nPlease login to continue.", GetPlayerNameEx(playerid));
		ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, string, string2, "Login", "Close");
	}
	else
	{
 		new string[128], string2[128];
		format(string, sizeof(string), ""GM_NAME" Registration: (%s)", GetPlayerNameEx(playerid));
		format(string, sizeof(string), "%s, we cannot find this name registered in the database!\nPlease enter a password to register.", GetPlayerNameEx(playerid));
		ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_INPUT, string, string2, "Register", "Close");
	}
	gPlayerLogged[playerid] = 0;
	return 1;
}



Re: Dialog not appearing? - RedJohn - 22.10.2012

For you information, if there is no #define DIALOG_LOGIN 3 in his script he couldn't compile it and start server so DIALOG_LOGIN is defined.


Re: Dialog not appearing? - HyDrAtIc - 22.10.2012

Quote:
Originally Posted by RedJohn
Посмотреть сообщение
For you information, if there is no #define DIALOG_LOGIN 3 in his script he couldn't compile it and start server so DIALOG_LOGIN is defined.
What the hell?

Can't you read?

Quote:
Originally Posted by James_Nick
Посмотреть сообщение
........
In:

Код:
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, string, string2, "Register", "Close");
Remove DIALOG_LOGIN and replace it with the DIALOG_LOGIN id that you defined in top of your script.

Example:

Код:
#define DIALOG_LOGIN 3
......
Wear a glasses bro,I said only example!


Re: Dialog not appearing? - RedJohn - 22.10.2012

Whatever.


Re: Dialog not appearing? - HyDrAtIc - 22.10.2012

Quote:
Originally Posted by RedJohn
Посмотреть сообщение
Whatever.
Learn to script before posting a post.


Re: Dialog not appearing? - RedJohn - 22.10.2012

RLGaming, do you have #define DIALOG_LOGIN in your script


Re: Dialog not appearing? - RLGaming - 22.10.2012

Yep, as well as a DEFINE_REGISTER


Re: Dialog not appearing? - RedJohn - 22.10.2012

Did you tried my first post?