[Ajuda] DOF2 nгo estб salvando
#6

Quote:
Originally Posted by willttoonn
View Post
//Essa funзгo aqui \/ jб faz o que estб abaixo desses ===
SalvarPlayer(playerid);

//O que tem aqui embaixo em verde, vocк pode tirar:
//================================================== ========
new file[155], aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, sizeof(aname));
format(file, sizeof(file), "Contas/%s.ini", aname);
DOF2_SetInt(file, "vSupremo", pSuper[playerid][Clan]);
DOF2_SetInt(file, "vClan", pSuper[playerid][Clan]);

printf(" eu me salvei tudo");
eu tentei fz isso dnv eu refiz tudo e nгo deu certo

PHP Code:
// NEW.PWN BY: $C0pAs
//===========================INCLUDES===================================//
#include <a_samp>
#include <ZCMD>
#include <sscanf>
#include <DOF2>
#define    CONTASS    "Contas/%s.ini"
//===========================NEWS AND FORWARDS==========================//
enum pSupremo
{
    
Supremo,
     
Clan
};
new 
pSuper[MAX_PLAYERS][pSupremo];
//======================================================================//
main()
{
}
//===========================PUBLICS====================================//
public OnGameModeExit()
{
    for(new 
0MAX_PLAYERSi++)
    {
        
SalvarPlayer(i);
    }
    
DOF2_Exit();
    return 
1;
}
public 
OnPlayerDisconnect(playeridreason)
{
    
SalvarPlayer(playerid);
    return 
1;
}
public 
OnPlayerSpawn(playerid)
{
    
CarregarPlayer(playerid);
      return 
1;
}
//===========================CMDS=====================================//
CMD:setsupremo(playeridparams[])
{
    new 
Levelidplayeraname[MAX_PLAYER_NAME], pname[MAX_PLAYER_NAME], file[155];
    if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1"[ ERRO ] {FF0000}Vocк nгo tem acesso a este comando!");
    if(
sscanf(params"dd"idplayerLevel)) return SendClientMessage(playerid, -1"[ ERRO] {FF0000}use: /setsupremo [playerid] [level 0-1]");
    if(
Level || Level 1) return SendClientMessage(playerid, -1"[ ERRO] {FF0000}Level invalido tente novamente (0-1)");
    
GetPlayerName(playeridanamesizeof(aname));
    
GetPlayerName(idplayerpnamesizeof(pname));
    
format(filesizeof(file), CONTASSpname);
    
DOF2_SetInt(file"Supremo"Level);
    
pSuper[idplayer][Supremo] = Level;
    
SalvarPlayer(idplayer);
    
printf(" eu me setei adm");
    return 
1;
}
//=================[STOCKS DO SERVIDOR]================
stock PegarNome(playerid)
{
    new 
Name[MAX_PLAYER_NAME];
    
GetPlayerName(playeridNameMAX_PLAYER_NAME);
    return 
Name;
}
stock SalvarPlayer(playerid)
{
    new 
pArquivos[50];
    
format(pArquivossizeof(pArquivos), CONTASSPegarNome(playerid));
    if(
DOF2_FileExists(pArquivos))
    {
        
DOF2_SetInt(pArquivos"vClan"pSuper[playerid][Clan]);
        
DOF2_SetInt(pArquivos"vSupremo"pSuper[playerid][Supremo]);
        
DOF2_SaveFile();
    }
    return 
1;
}
stock CarregarPlayer(playerid)
{
    new 
pArquivos[50];
    
format(pArquivossizeof(pArquivos), CONTASSPegarNome(playerid));
    if(
DOF2_FileExists(pArquivos))
    {
        
pSuper[playerid][Clan] = DOF2_GetInt(pArquivos"vClan");
        
pSuper[playerid][Supremo] = DOF2_GetInt(pArquivos"vSupremo");
    }
    return 
1;

Reply


Messages In This Thread
DOF2 nгo estб salvando - by zPawnu - 11.11.2015, 22:35
Re: DOF2 nгo estб salvando - by willttoonn - 11.11.2015, 23:47
Re: DOF2 nгo estб salvando - by Thider - 11.11.2015, 23:54
Re: DOF2 nгo estб salvando - by zPawnu - 11.11.2015, 23:55
Re: DOF2 nгo estб salvando - by willttoonn - 12.11.2015, 00:05
Re: DOF2 nгo estб salvando - by zPawnu - 12.11.2015, 00:20

Forum Jump:


Users browsing this thread: 1 Guest(s)