[Pedido] Sistema de salvamento..
#10

Quote:
Originally Posted by Leopawno
Посмотреть сообщение
Hasted esse dai nao salva eu queria uma "base".. PF !
Vai salvar ;P

pawn Код:
#include <DOF2>

//OnPlayerConnect(playerid)
    new arquivo[34], playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername, sizeof(playername));
    format(arquivo, sizeof(arquivo), "%s.ini", playername);
    Profissao[playerid] = DOF2_GetInt(arquivo, "Profissao");
//OnPlayerDisconnect
    new arquivo[34], playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername, sizeof(playername));
    format(arquivo, sizeof(arquivo), "%s.ini", playername);
    if(DOF2_FileExists(arquivo))
    {
        DOF2_SetInt(arquivo, "Profissao", Profissao[playerid]);
    }
    else
    {
        DOF2_CreateFile(arquivo);
        DOF2_SetInt(arquivo, "Profissao", Profissao[playerid]);
    }
//e em OnGameModeExit
    DOF2_Exit();
Reply


Messages In This Thread
Sistema de salvamento.. - by Leopawno - 27.09.2013, 00:18
Re: Sistema de salvamento.. - by Juniiro3 - 27.09.2013, 00:20
Re: Sistema de salvamento.. - by Leopawno - 27.09.2013, 00:24
Re: Sistema de salvamento.. - by Juniiro3 - 27.09.2013, 00:24
Re: Sistema de salvamento.. - by HatedS - 27.09.2013, 00:29
Re: Sistema de salvamento.. - by Leopawno - 27.09.2013, 00:30
Re: Sistema de salvamento.. - by PT - 27.09.2013, 00:38
Re: Sistema de salvamento.. - by HatedS - 27.09.2013, 00:42
Re: Sistema de salvamento.. - by Leopawno - 27.09.2013, 00:43
Re: Sistema de salvamento.. - by HatedS - 27.09.2013, 00:50

Forum Jump:


Users browsing this thread: 1 Guest(s)