attach a dialog to login system
#1

how can i attach a dialog to my login system
i need add this
Quote:

ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Login", "Please type your password below to log in.", "Log In", "Leave");

ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Register", "Please type in a password to register your account", "Register", "Leave");

to this
PHP код:
//-------------------------------[Login]--------------------------------------------------------------------------
    
if (strcmp(cmd"/login"true) ==)
    {
        if(
IsPlayerConnected(playerid))
        {
            new 
tmppass[64];
            if(
gPlayerLogged[playerid] == 1)
            {
                
SendClientMessage(playeridCOLOR_WHITE"SERVER: You are already logged in.");
                return 
1;
            }
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_GRAD1"USAGE: /login [password]");
                return 
1;
            }
            
strmid(tmppasstmp0strlen(cmdtext), 255);
            
Encrypt(tmppass);
            
OnPlayerLogin(playerid,tmppass);
        }
        return 
1;
    }
    if (
strcmp(cmd"/register"true) ==)
    {
        if(
IsPlayerConnected(playerid))
        {
            if(
gPlayerLogged[playerid] == 1)
            {
                
SendClientMessage(playeridCOLOR_WHITE"SERVER: You are already logged in.");
                return 
1;
            }
            
GetPlayerName(playeridsendernamesizeof(sendername));
            
format(stringsizeof(string), "%s.ini"sendername);
            new 
FilehFile fopen(stringio_read);
            if (
hFile)
            {
                
SendClientMessage(playeridCOLOR_YELLOW"That Username is already taken, please choose a different one.");
                
fclose(hFile);
                return 
1;
            }
            new 
tmppass[64];
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_GRAD1"USAGE: /register [password]");
                return 
1;
            }
            
strmid(tmppasstmp0strlen(cmdtext), 255);
            
Encrypt(tmppass);
            
OnPlayerRegister(playerid,tmppass);
        }
        return 
1;
    } 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)