23.03.2012, 23:34
hey there, I'm working on something but I'm really sleepy (god bless coffee):
my server closes after debug 3 is printed. anyone could tell me why?
regards
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
regards