[Ajuda] Salvar Score do player em pasta na scriptfiles.
#7

Quote:
Originally Posted by humildadeforever
Посмотреть сообщение
Sу ler tutoriais ou analisar FSs que usam sistema de salvamento.
Em DOF2:
Код:
Salvar(playerid)
{
    new arquivo_conta[50], nome_player[MAX_PLAYER_NAME];
    GetPlayerName(playerid, nome_player, sizeof(nome_player));
    format(arquivo_conta, sizeof(arquivo_conta),"Contas/%s.ini", nome_player);
    if(!DOF2_FileExists(arquivo_conta))
    {
           DOF2_CreateFile(arquivo_conta);
           Salvar(playerid);
           return 1;
   }
   DOF2_SetInt(arquivo_conta,"Level", GetPlayerScore(playerid));
   DOF2_SaveFile();
   return 1;
}

Load(playerid)
{
    new arquivo_conta[50], nome_player[MAX_PLAYER_NAME];
    GetPlayerName(playerid, nome_player, sizeof(nome_player));
    format(arquivo_conta, sizeof(arquivo_conta),"Contas/%s.ini", nome_player);
    if(!DOF2_FileExists(arquivo_conta))
    {
          SetPlayerScore(playerid, 1);
          return 1;
   }
   SetPlayerScore(playerid, DOF2_GetInt(arquivo_conta,"Level"));
   return 1;
}
pawn Код:
C:\Users\Lucas\Desktop\Servidor\gamemodes\GM.pwn(655) : warning 217: loose indentation
C:\Users\Lucas\Desktop\Servidor\gamemodes\GM.pwn(673) : warning 203: symbol is never used: "DOF2_Exit"
C:\Users\Lucas\Desktop\Servidor\gamemodes\GM.pwn(673) : warning 203: symbol is never used: "Load"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


3 Warnings.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)