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
format( oldName, 24, "%s", GetPName( iVictim ) );
UserPath is not defined or formatted as string. only used in the crashing line (INI_Open)
|
UserPath is not defined or formatted as string. only used in the crashing line (INI_Open)
|