// Enum
enum InfoPlayer
{
bool:UsaTag, // isto й somente para verificar se o jogador usa uma tag
Tag[10] // Jб tentei atй tirar o [10], mas nгo adianta
};
// new
new Player[MAX_PLAYERS][InfoPlayer];
// Quando cria a conta, seta os valores
DOF2_CreateFile( GetPlayerArquivo( playerid ) );
DOF2_SetBool( GetPlayerArquivo( playerid ), "UsaTag", false);
DOF2_SetString( GetPlayerArquivo( playerid ), "Tag", "Nenhuma");
// salvar as informзхes dos jogadores
SavePlayer(playerid)
{
if( DOF2_FileExists( GetPlayerArquivo( playerid ) ) )
{
DOF2_CreateFile(GetPlayerArquivo(playerid));
DOF2_SetBool( GetPlayerArquivo( playerid ), "UsaTag", Player[playerid][ UsaTag ] );
DOF2_SetString( GetPlayerArquivo( playerid ), "Tag", Player[playerid][ Tag ] );
DOF2_SaveFile();
}
return 1;
}
// Carregar as informaзхes dos jogadores
LoadPlayer(playerid)
{
if( DOF2_FileExists( GetPlayerArquivo( playerid ) ) )
{
Player[ playerid ][ UsaTag ] = DOF2_GetBool( GetPlayerArquivo( playerid ), "UsaTag" );
Player[ playerid ][ Tag ] = DOF2_GetString( GetPlayerArquivo(playerid), "Tag");
}
}
GetPlayerArquivo(playerid)
{
new ArquivoPlayer[ 30 ];
format( ArquivoPlayer, sizeof( ArquivoPlayer ), Contas, GetPlayerNameEx( playerid ) );
return ArquivoPlayer;
}
Player[ playerid ][ Tag ] = DOF2_GetString( GetPlayerArquivo(playerid), "Tag");
C:\Users\Allan\Desktop\Servidor\gamemodes\GM.pwn(10327) : error 047: array sizes do not match, or destination array is too small
format(Player[ playerid ][ Tag ], sizeof(Player[ playerid ][ Tag ]), "%s", DOF2_GetString( GetPlayerArquivo(playerid), "Tag"));
strmid(Player[ playerid ][ Tag ], DOF2_GetString( GetPlayerArquivo(playerid), "Tag"), 0, strlen(DOF2_GetString( GetPlayerArquivo(playerid), "Tag")), MAX_PLAYER_NAME);
DOF2_GetStringEx( GetPlayerArquivo(playerid), "Tag", Player[ playerid ][ Tag ]);
PHP код:
|