Y_Ini solution:
pawn Код:
new file[ 256 ];
new name[ 24 ];
GetPlayerName( playerid, name, 24 );
format( file, sizeof file, "SomeFolder/%s.ini", name );
new INI:PlayerAcc = INI_Open( file );
INI_WriteInt( PlayerAcc, "IsPlayerArmyLevel2", IsPlayerArmyLevel2[ playerid ] );
INI_WriteInt( PlayerAcc, "IsPlayerCopLevel2", IsPlayerCopLevel2[ playerid ] );
INI_WriteInt( PlayerAcc, "IsPlayerMafiaLevel2", IsPlayerMafiaLevel2[ playerid ] );
INI_WriteInt( PlayerAcc, "IsPlayerCivlianLevel2", IsPlayerCivlianLevel2[ playerid ] );
INI_WriteInt( PlayerAcc, "IsPlayerTerroristLevel2", IsPlayerTerroristLevel2[ playerid ] );
INI_Close( PlayerAcc );
The file of player if he is a level 2 cop will look like this:
Код:
IsPlayerArmyLevel2 = 0
IsPlayerCopLevel2 = 1
IsPlayerMafiaLevel2 = 0
IsPlayerCivlianLevel2 = 0
IsPlayerTerroristLevel2 = 0
Have fun. Hope you know how to load it.
So example of using my code:
pawn Код:
CMD:savemyleveltofile( playerid, params[ ] )
{
new file[ 256 ];
new name[ 24 ];
GetPlayerName( playerid, name, 24 );
format( file, sizeof file, "SomeFolder/%s.ini", name );
new INI:PlayerAcc = INI_Open( file );
INI_WriteInt( PlayerAcc, "IsPlayerArmyLevel2", IsPlayerArmyLevel2[ playerid ] );
INI_WriteInt( PlayerAcc, "IsPlayerCopLevel2", IsPlayerCopLevel2[ playerid ] );
INI_WriteInt( PlayerAcc, "IsPlayerMafiaLevel2", IsPlayerMafiaLevel2[ playerid ] );
INI_WriteInt( PlayerAcc, "IsPlayerCivlianLevel2", IsPlayerCivlianLevel2[ playerid ] );
INI_WriteInt( PlayerAcc, "IsPlayerTerroristLevel2", IsPlayerTerroristLevel2[ playerid ] );
INI_Close( PlayerAcc );
SendClientMessage( playerid, 0xAAAAAA, "Your status of your level 2 has been saved to userfile, directory: SA-MP server\scriptfiles\SomeFolder\yourname.ini" );
return 1;
}