If the player disconnected.
#1

Hello

I stuck with my roleplay registration system.
When I registering to my server and exit in the middle of the questionnaire and get back to the game,it tells me to log in and I didn't finish the registration..
In the player log it was like this when I logout the server:
[pawm]
Registed = 0
[/pawn]
and its great but when I enter my server it ask me to log in and not to register..

Here is my registration code:
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
       if (RegistrationStep[playerid] == 0)
       {
        new plname[MAX_PLAYER_NAME];
        GetPlayerName(playerid, plname, sizeof(plname));
        new string[256];
        format(string, sizeof(string), "Database/%s.ini", plname);
        if(!fexist(string))
        {
            PlayerInfo[playerid][pRegisted] = 0;
        }
        else if(fexist(string))
        {
            PlayerInfo[playerid][pRegisted] = 1;
        }
        if(fexist(string))//gPlayerAccount[playerid] != 0)
        {
        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 if(!fexist(string))
        {
        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");
        }
    }
    else SpawnPlayer(playerid);
    return 1;
}
Thank you guys <3
Reply
#2

At OnPlayerdisconnect:
Код:
if (RegistrationStep[playerid] >= 0)
{
PlayerInfo[playerid][pRegisted] = 0;
}
Reply
#3

Quote:
Originally Posted by RaZzZzoR
Посмотреть сообщение
At OnPlayerdisconnect:
Код:
if (RegistrationStep[playerid] >= 0)
{
PlayerInfo[playerid][pRegisted] = 0;
}
Its the same thing bro ..
Reply
#4

There's no need to use those registered[playerid]=0/1 Use only fexist and thats all.
Reply
#5

Quote:
Originally Posted by HurtLocker
Посмотреть сообщение
There's no need to use those registered[playerid]=0/1 Use only fexist and thats all.
I can't bro because I have a RP questionnaire and I want them to finish it before start playing,even if I use fexist,when the player exit the game in the middle of the registration it tells him to login and not to register..
Reply
#6

Still, don't use registered[playerid]. But when a player tries to get rid of the dialog, make it reappear until the player answers it. with if (!response)-->show the same dialog.
Reply
#7

Quote:
Originally Posted by HurtLocker
Посмотреть сообщение
Still, don't use registered[playerid]. But when a player tries to get rid of the dialog, make it reappear until the player answers it. with if (!response)-->show the same dialog.
But if the player answer the wrong answer in the RP questionnaire it kick him and then the player need to relog.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)