After shutting down the server.
#1

Hey,

After I shutting down the server and turn it on again and enter the server I need to register again..

Here are my lines:

pawn Code:
if(PlayerInfo[playerid][pRegisted] == 1)
        {
        INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE"You are already registered, write your chosen password to log in! ","Login","Quit");
        }
        else
        {
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Registering...",""COL_WHITE"Welcome to CHANGEME, Our database tell us your new here, chose your password to register!","Register","Quit");
        }
Can someone help me please ?
Reply
#2

ur not already using this :
pawn Code:
if(PlayerInfo[playerid][pRegisted] == 1)
Then why you are using it :-
pawn Code:
else
        {
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Registering...",""COL_WHITE"Welcome to CHANGEME, Our database tell us your new here, chose your password to register!","Register","Quit");
        }
Reply
#3

The problem is not in that code ,the problem is in the code where the PlayerInfo[playerid][pRegistered] is set.
Could you please give that snippet of code??
Reply
#4

pawn Code:
if(PlayerInfo[playerid][pRegisted] == 1 && 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"You are already registered, write your chosen password to log in! ","Login","Quit");
        }
        else
        {
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Registering...",""COL_WHITE"Welcome to CHANGEME, Our database tell us your new here, chose your password to register!","Register","Quit");
        }
also where is the saving function ?
try this or u can remove the "PlayerInfo[playerid][pRegisted] == 1 &&"
Reply
#5

Quote:
Originally Posted by Glad2BeHere
View Post
pawn Code:
if(PlayerInfo[playerid][pRegisted] == 1 && 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"You are already registered, write your chosen password to log in! ","Login","Quit");
        }
        else
        {
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Registering...",""COL_WHITE"Welcome to CHANGEME, Our database tell us your new here, chose your password to register!","Register","Quit");
        }
try this
How would that help??He says that he is getting a register dialog.That tells is that the INI_PraseFile is not reached.The statements in the else is executed.Hence there is the problem in the pRegistered Variable(Setting it wrong or something)
Reply
#6

try
pawn Code:
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"You are already registered, write your chosen password to log in! ","Login","Quit");
        }
        else
        {
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Registering...",""COL_WHITE"Welcome to CHANGEME, Our database tell us your new here, chose your password to register!","Register","Quit");
        }
Reply
#7

Quote:
Originally Posted by Avi Raj
View Post
ur not already using this :
pawn Code:
if(PlayerInfo[playerid][pRegisted] == 1)
Then why you are using it :-
pawn Code:
else
        {
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Registering...",""COL_WHITE"Welcome to CHANGEME, Our database tell us your new here, chose your password to register!","Register","Quit");
        }
Quote:
Originally Posted by Yashas
View Post
The problem is not in that code ,the problem is in the code where the PlayerInfo[playerid][pRegistered] is set.
Could you please give that snippet of code??
Quote:
Originally Posted by Glad2BeHere
View Post
try
pawn Code:
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"You are already registered, write your chosen password to log in! ","Login","Quit");
        }
        else
        {
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Registering...",""COL_WHITE"Welcome to CHANGEME, Our database tell us your new here, chose your password to register!","Register","Quit");
        }
Can't bro,I have an RP questionnaire so I need the player to answer them and agter he finished it he is fully registered,that is why I am using it..

Here are the codes where pRegisted defined:

in the Pinfo:
[pawn]
pRegisted
[pawn]
Load user Data:
pawn Code:
INI_Int("Registed", PlayerInfo[playerid][pRegisted]);
Login and registration code:
pawn Code:
if(PlayerInfo[playerid][pRegisted] == 1)
        {
        INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE"You are already registered, write your chosen password to log in! ","Login","Quit");
        }
        if(PlayerInfo[playerid][pRegisted] == 0)
        {
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Registering...",""COL_WHITE"Welcome to CHANGEME, Our database tell us your new here, chose your password to register!","Register","Quit");
        }
onplayerdisconnect
pawn Code:
new INI:File = INI_Open(UserPath(playerid));
        INI_WriteInt(File,"Registed", PlayerInfo[playerid][pRegisted]);
    INI_Close(File);
At the end of the questionnaire
pawn Code:
PlayerInfo[playerid][pRegisted] = 1;
Reply
#8

UP..
Reply
#9

In addition to Y_Less's post, put a simple
pawn Code:
print("Server is shutting down now");
in OnGameModeExit to confirm it gets called. You can do the same for OnPlayerDisconnect.

If it doesn't, you're doing something wrong with shutting it down.
Reply
#10

Quote:
Originally Posted by Y_Less
View Post
HOW do you shut down the server?
I am just pressing the "X" buttom on the dos,its a private server no Linux.. :\

Quote:
Originally Posted by Revo
View Post
In addition to Y_Less's post, put a simple
pawn Code:
print("Server is shutting down now");
in OnGameModeExit to confirm it gets called. You can do the same for OnPlayerDisconnect.

If it doesn't, you're doing something wrong with shutting it down.
I putted that line on those publics but its the same .. :\
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)