Error, Help - 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: Error, Help (
/showthread.php?tid=315399)
Error, Help -
seanny - 02.02.2012
Hello, I am getting this error, It does not show the dialog, It wont show the register or login dialog.
pawn Код:
#define DIALOG_REGISTER 1
#define DIALOG_LOGIN 2
#define DIALOG_SUCCESS_1 3
#define DIALOG_SUCCESS_2 4
#define DIALOG_AGE 5
public OnPlayerConnect(playerid)
{
if(fexist(UserPath(playerid)))
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE"Type your password below to login.","Login","Quit");
}
else
{
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Registering...",""COL_WHITE"Type your password below to register a new account.","Register","Quit");
}
return 1;
}
Re: Error, Help -
2KY - 03.02.2012
Take reference to mine.
pawn Код:
#define d_JOIN1 1
#define d_JOIN2 2
#define d_REGISTER 3
#define d_LOGIN 4
#define YOUR_ACCOUNT_DIRECTORY "PTB/Accounts/%s.ini"
//Leave .ini on the end - This is the extension and is vital!
pawn Код:
public OnPlayerConnect(playerid)
{
if(fexist(FindAccountPath(playerid)))
{
ShowPlayerDialog(playerid, d_JOIN2, DIALOG_STYLE_LIST, "{68C20E}Processing Center", "Login\nHow to Play\nCredits", "Select", "Quit"),
p_ViewingDialog[playerid] = d_JOIN2;
}
else
{
ShowPlayerDialog(playerid, d_JOIN1, DIALOG_STYLE_LIST, "{68C20E}Processing Center", "Register\nHow to Play\nCredits", "Select", "Quit"),
p_ViewingDialog[playerid] = d_JOIN1;
}
p_LastKill[playerid] = "None";
p_State{playerid} = 1;
return true;
}
pawn Код:
stock FindAccountPath(playerid)
{
new
string[128],
p_Name[MAX_PLAYER_NAME]
;
GetPlayerName(playerid, p_Name, sizeof(p_Name));
format(string, sizeof(string), YOUR_ACCOUNT_DIRECTORY, p_Name);
return string;
}