How can i do it?
#1

Hello guys, How can i make my Script when your Registered it say Account Founded! Use /login [Password] to login
when not it should say "Please use /Register [Password] To register new account

here's a little code
pawn Код:
else
        {
            gPlayerAccount[playerid] = 1;
            format(string, sizeof(string), "Account Founded! use /login [password]", playrname);
            SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
            gPlayerLogged[playerid] = 0;
            return 1;
        }
    }
    else
    {
        gPlayerAccount[playerid] = 0;
        format(string, sizeof(string),"Please use /register[password] To Register", playrname);
        SendClientMessage(playerid, COLOR_LIGHTBLUE,string);
        gPlayerLogged[playerid] = 0;
        return 1;
    }
    #endif
    return 1;
}
Reply
#2

What are you using to save your stats ?
Reply
#3

i use V-Admin and i guess V-ADmin use Dini - Dutils
pawn Код:
if(fexist(connect))
    {
        #if AUTO_LOGIN_ENABLED
        new tmp[50],tmp2[256]; GetPlayerIp(playerid,tmp,50); tmp2 = dini_Get(connect,"IP");
        if(!strcmp(tmp,tmp2,true))
        {
            format(string, sizeof(string), "Welcome back %s ! You have been automatically logged in by your IP. ", playrname);
            SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
            gPlayerLogged[playerid] = 1;
            new playername2[MAX_PLAYER_NAME];
            GetPlayerName(playerid, playername2, sizeof(playername2));
            format(string2, sizeof(string2), "V-Admin/Users/%s.ini", playername2);
            new File: UserFile = fopen(string2, io_read);
            if ( UserFile )
            {
                new PassData[256];
                new keytmp[256], valtmp[256];
                fread( UserFile , PassData , sizeof( PassData ) );
                keytmp = ini_GetKey( PassData );
                if( strcmp( keytmp , "Password" , true ) == 0 )
                {
                    valtmp = ini_GetValue( PassData );
                    strmid(PlayerInfo[playerid][pPassword], valtmp, 0, strlen(valtmp)-1, 255);
                    new key[ 256 ] , val[ 256 ];
                    new Data[ 256 ];
                    while ( fread( UserFile , Data , sizeof( Data ) ) )
                    {
                        key = ini_GetKey( Data );
                        if( strcmp( key , "AdminLevel" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pAdmin] = strval( val ); }
                        if( strcmp( key , "Warnings" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pWarns] = strval( val ); }
                        if( strcmp( key , "Level" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pLevel] = strval( val ); }
                        if( strcmp( key , "Kills" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pKills] = strval( val ); }
                        if( strcmp( key , "Deaths" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pDeaths] = strval( val ); }
                        if( strcmp( key , "Money" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pCash] = strval( val ); }
                        if( strcmp( key , "Bank" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pBank] = strval( val ); }
                        if( strcmp( key , "Skin" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pSkin] = strval( val ); }
                        if( strcmp( key , "TimesConnected" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pTimes] = strval( val ); }
                        if( strcmp( key , "PlayingHours" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pHours] = strval( val ); }
                        if( strcmp( key , "PlayingMinutes" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pMins] = strval( val ); }
                        if( strcmp( key , "DayRegistered" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pDate1] = strval( val ); }
                        if( strcmp( key , "MonthRegistered" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pDate2] = strval( val ); }
                        if( strcmp( key , "YearRegistered" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pDate3] = strval( val ); }
                    }//end while
                    fclose(UserFile);//close the file after everything has been read in the while
                    gPlayerLogged[playerid] = 1;
                }
            }
        }
        else
        {
            gPlayerAccount[playerid] = 1;
            format(string, sizeof(string), "Account Founded! use /login [password]", playrname);
            SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
            gPlayerLogged[playerid] = 0;
            return 1;
        }
    }
    else
    {
        gPlayerAccount[playerid] = 0;
        format(string, sizeof(string),"Please use /register[password] To Register", playrname);
        SendClientMessage(playerid, COLOR_LIGHTBLUE,string);
        gPlayerLogged[playerid] = 0;
        return 1;
    }
    #endif
    return 1;
}
when i register and then relog it asks for Register again.. and i can even login and register at that time
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)