Problem With INI (+REP for helper)
#1

Register Dialog:
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    switch( dialogid )
    {
        case DIALOG_REGISTER:
        {
            if (!response) return Kick(playerid);
            if(response)
            {
                if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""Red"Registering...",""WHITE"You have entered an "Red"Invalid Password.\n"WHITE"Type your "Red"Password "WHITE"below to register a new account.","Register","Quit");
                new INI:File = INI_Open(UserPath(playerid));
                INI_SetTag(File,"data");
                GetPlayerName(playerid,PlayerInfo[playerid][pUsername],MAX_PLAYER_NAME);
                INI_WriteString(File,"Username",PlayerInfo[playerid][pUsername]);
                INI_WriteInt(File,"Password",udb_hash(inputtext));
................................
Login Dialog:
pawn Код:
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(playerid, PlayerInfo[playerid][pCash]);
i have this on player register & login but the problem is that when ever a player joins into my server and leaves without registering the account is saved on the next time if other player puts the same name instead of register dialog login dialog is appeared please help me fix that
Reply


Messages In This Thread
Problem With INI (+REP for helper) - by Danyal - 19.02.2012, 09:59
Re: Problem With INI (+REP for helper) - by emokidx - 19.02.2012, 10:02
Re: Problem With INI (+REP for helper) - by Danyal - 19.02.2012, 10:05
Re: Problem With INI (+REP for helper) - by emokidx - 19.02.2012, 10:10
Re: Problem With INI (+REP for helper) - by L0zaix - 19.02.2012, 10:13
Re: Problem With INI (+REP for helper) - by Danyal - 19.02.2012, 11:13

Forum Jump:


Users browsing this thread: 1 Guest(s)