pawn Код:
/* OnPlayerConnect */
public OnPlayerConnect(playerid)
{
/* Getting the players name */
GetPlayerName(playerid, pName, sizeof(pName));
/* Formatting the location of the file. */
format(File, sizeof(File), FileLocation, pName);
/* Checking if accounts exists. In this case it doesnt, so were going to show the register dialog */
if(!dini_Exists(File))
{
format(Message, sizeof(Message), "Welcome %s,\n\nYou are new here please enter a new password to register!", pName);
ShowPlayerDialog(playerid, DIALOG_REG, DIALOG_STYLE_INPUT, "Account | Register", Message, "Register", "Leave");
}
/* Checking if accounts exists. In this case it does, so were going to show the login dialog */
if(dini_Exists(File))
{
format(Message, sizeof(Message), "Welcome back %s,\n\Please enter your password to login!", pName);
ShowPlayerDialog(playerid, DIALOG_LOG, DIALOG_STYLE_INPUT, "Account | Login", Message, "Login", "Leave");
}
return 1;
}