opening file closes the server
#1

hey there, I'm working on something but I'm really sleepy (god bless coffee):

pawn Код:
CMD:asetname( playerid, params[] )
{
    new iVictim, newName[24];
    if( sscanf( params, "ds[24]", iVictim, newName ) )
        return ShowSyntaxMessage( playerid, "/asetname [playerid] [new name]" );

    if( !NameIsRP( newName ) )
        return ShowErrorMessage( playerid, "That name does not have a correct Firstname_Lastname format." );

    if( strlen( newName ) > 24 )
        return ShowErrorMessage( playerid, "That name is over 24 characters long." );

    new fileChk[32], oldName[32], pwBuff[256];
    format( oldName, 32, "SFRP/Accounts/%s.ini", GetName( iVictim ) );
    format( fileChk, 32, "SFRP/Accounts/%s.ini", newName );
    if( fexist( fileChk ) )
        return ShowErrorMessage( playerid, "That account already exists in the database." );

    printf("*debug 1");
    fremove( oldName );
    printf("*debug 2");
    format( oldName, 24, GetPName( iVictim ) );
    printf("*debug 3");
    INI_Open( UserPath( iVictim ) );
    printf("*debug 4");
    format( pwBuff, 256, "%s", INI_ReadString( "Password" ) );
    printf("*debug 5");
    INI_Close( );
    printf("*debug 6");

    SetPlayerName( iVictim, newName );
    printf("*debug 7");
    SaveUserData( iVictim, pwBuff );
    printf("*debug 8");
//blabalbalbalbalb
my server closes after debug 3 is printed. anyone could tell me why?
regards
Reply


Messages In This Thread
opening file closes the server - by admantis - 23.03.2012, 23:34
Re: opening file closes the server - by Babul - 23.03.2012, 23:41
Re: opening file closes the server - by antonio112 - 23.03.2012, 23:41
Re: opening file closes the server - by MP2 - 23.03.2012, 23:42
Respuesta: Re: opening file closes the server - by admantis - 23.03.2012, 23:44

Forum Jump:


Users browsing this thread: 1 Guest(s)