How could i create that?
#8

it doesn't show the reg dialog or invite
PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    switch( 
dialogid )
    {
        case 
DIALOG_REGISTER:
        {
            if (!
response) return Kick(playerid);
            if (
response)
            if (
isnull(inputtext)) return 1;
            new 
str[38];
            
GetPlayerName(playeridstr,sizeof(str));
            
format(strsizeof(str), "Invites/%s.txt"str);
            new 
File:file fopen(strio_write);
            
format(strsizeof(str), "%s"inputtext);
            
fwrite(filestr);
            
fclose(file);
            if(
response)
            {
                if(!
strlen(inputtext)) return ShowPlayerDialog(playeridDIALOG_REGISTERDIALOG_STYLE_INPUT""COL_WHITE"{FF0000}>>|{00CC00}Please Register{FF0000}|<<",""COL_RED"You have entered an invalid password or you didn't put password at all.\n"COL_WHITE"Type your password below to register a new account.","Register","Quit");
                new 
INI:File INI_Open(UserPath(playerid));
                
INI_SetTag(File,"data");
                
INI_WriteInt(File,"Password",udb_hash(inputtext));
                
INI_WriteInt(File,"Cash",0);
                
INI_WriteInt(File"Score"GetPlayerScore(playerid));
                
INI_WriteInt(File,"Admin",0);
                
INI_WriteInt(File,"Kills",0);
                
INI_WriteInt(File,"Deaths",0);
                
INI_Close(File);

                
SetSpawnInfo(playerid001958.331343.1215.36269.15000000);
                
SpawnPlayer(playerid);
                
ShowPlayerDialog(playeridDIALOG_SUCCESS_1DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"Great ! Please Relog to save your stats.!","Ok","");
                
TogglePlayerControllable(playerid0);
            }
        }

        case 
DIALOG_LOGIN:
        {
            if ( !
response ) return Kick playerid );
            if( 
response )
            {
                if(
udb_hash(inputtext) == PlayerInfo[playerid][pPass])
                {
                    
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra true, .extra playerid);
                    
GivePlayerMoney(playeridPlayerInfo[playerid][pCash]);
                    
SetPlayerScore(playeridPlayerInfo[playerid][pScore]);
                    
SendClientMessage(playerid1"{ff0000}[SERVER]{ffffff}: You have successfully logged in !");
                }
                else
                {
                    
ShowPlayerDialog(playeridDIALOG_LOGINDIALOG_STYLE_INPUT,""COL_WHITE"{FF0000}>>|{00CC00}Please Login{FF0000}|<<",""COL_RED"You have entered an incorrect password.\n"COL_WHITE"Type your password below to login.","Login","Quit");
                }
                return 
1;
            }
        }
    }
    return 
1;

Reply


Messages In This Thread
How could i create that? - by Glossy42O - 28.10.2014, 15:52
Re: How could i create that? - by Stinged - 28.10.2014, 16:21
Re: How could i create that? - by Glossy42O - 28.10.2014, 16:23
Re: How could i create that? - by Stinged - 28.10.2014, 16:26
Re: How could i create that? - by Glossy42O - 28.10.2014, 16:27
Re: How could i create that? - by Glossy42O - 28.10.2014, 17:35
Re: How could i create that? - by Rudy_ - 28.10.2014, 17:38
Re: How could i create that? - by Glossy42O - 28.10.2014, 17:55
Re: How could i create that? - by Glossy42O - 29.10.2014, 03:57
Re: How could i create that? - by Threshold - 29.10.2014, 04:43

Forum Jump:


Users browsing this thread: 1 Guest(s)