[Ajuda] Resetando Conta ao fazer login
#1

Eu uso a include DOF2, salvar nгo й o problema, fica tudo perfeito, o problema, й na hora de carregar, que reseta tudo, se alguem puder me ajudar! Ao invйs de carregar o que ta no arquivo ele reseta o que ta no arquivo!

Uso as includes:
PHP код:
#include <a_samp>
#include <foreach>
#include <zcmd>
#include <DOF2>
#include <mSelection>
#include <Streamer>
#include <sscanf> 
PHP код:
stock CarregarPlayer(playerid)
{
    new 
Arquivodelogin[256];
    
format(Arquivodeloginsizeof(Arquivodelogin), "Contas/%s.ini"Nome(playerid));
    if(
DOF2_FileExists(Arquivodelogin))
    {
        
PlayerInfo[playerid][pAdmin] = DOF2_GetInt(Arquivodelogin"Administrador");
        
PlayerInfo[playerid][pMod] = DOF2_GetInt(Arquivodelogin"Moderador");
        
PlayerInfo[playerid][pAju] = DOF2_GetInt(Arquivodelogin"Ajudante");
        
PlayerInfo[playerid][pDono] = DOF2_GetInt(Arquivodelogin"Dono");
        
SetPlayerScore(playeridDOF2_GetInt(Arquivodelogin"Level"));
        
PlayerInfo[playerid][pRespeito] = DOF2_GetInt(Arquivodelogin"EXP");
        
//SetPlayerSkin(playerid, DOF2_GetInt(Arquivodelogin, "Skin"));
        
PlayerInfo[playerid][pMatou] = DOF2_GetInt(Arquivodelogin"Matou");
        
PlayerInfo[playerid][pMorreu] = DOF2_GetInt(Arquivodelogin"Morreu");
        
GivePlayerMoney(playeridDOF2_GetInt(Arquivodelogin"Dinheiro"));
        
PlayerInfo[playerid][pProfissao] = DOF2_GetInt(Arquivodelogin,"Profissao");
        
PlayerInfoplayerid ][ pSpawn ] = DOF2_GetInt(Arquivodelogin,"Spawn");
        
PlayerInfoplayerid ][ pTCasa ] = DOF2_GetInt(Arquivodelogin,"Casa" );
        
PlayerInfoplayerid ][ pImpostos ] = DOF2_GetInt(Arquivodelogin,"Impostos");
        
PlayerInfoplayerid ][ pAtrasados ] = DOF2_GetInt(Arquivodelogin,"Atrasados");
        
pVip[playerid][0]= DOF2_GetInt(Arquivodelogin,"pVTime");
        
pVip[playerid][1] = DOF2_GetInt(Arquivodelogin,"pVip");
        
EmpresaInfo[playerid][Numero] = DOF2_GetInt(Arquivodelogin,"EmpresaID");
        
PlayerInfoplayerid ][ pContratado ] = DOF2_GetInt(Arquivodelogin,"Contratado");
    
        
        
PlayerInfo[playerid][pGalaoGasolina] = DOF2_GetInt(Arquivodelogin,"LitrosGalao");
        
PlayerInfo[playerid][pTemGalao] = DOF2_GetInt(Arquivodelogin,"TemGalao");
        
PlayerInfo[playerid][pCelular] = DOF2_GetInt(Arquivodelogin,"CelNumero");
        
PlayerInfo[playerid][pPhoneBook] = DOF2_GetInt(Arquivodelogin,"AgendaTel");
        
PlayerInfo[playerid][pCreditos] = DOF2_GetInt(Arquivodelogin,"Creditos");
        
PlayerInfo[playerid][pFightingStyle] = DOF2_GetInt(Arquivodelogin,"EstiloLuta");
        
PlayerInfo[playerid][pCarLic] = DOF2_GetInt(Arquivodelogin,"LicencaCarro");
        
PlayerInfo[playerid][pBarcoLic] = DOF2_GetInt(Arquivodelogin,"LicencaBarco");
        
PlayerInfo[playerid][pAviaoLic] = DOF2_GetInt(Arquivodelogin,"LicencaAviao");
        
PlayerInfo[playerid][pLicArma] = DOF2_GetInt(Arquivodelogin,"LicencaArma");
        
PlayerInfo[playerid][pCadeia] = DOF2_GetInt(Arquivodelogin,"Preso");
        
PlayerInfo[playerid][pAbuser] = DOF2_GetInt(Arquivodelogin,"Abuser");
        
PlayerInfo[playerid][pCongelado] = DOF2_GetBool(Arquivodelogin"pCongelado");
        
PlayerInfo[playerid][pCalado] = DOF2_GetBool(Arquivodelogin"pCalado");
        
PlayerInfo[playerid][pCapacete] = DOF2_GetInt(Arquivodelogin,"Capacete");
        
PlayerInfo[playerid][pBoombox] = DOF2_GetInt(Arquivodelogin,"Boombox");
        
PlayerInfo[playerid][pAlgemado] = DOF2_GetInt(Arquivodelogin,"Algemado");
        
PlayerInfo[playerid][pRelogioCor] = DOF2_GetInt(Arquivodelogin,"Cor_Relogio");
        
PlayerInfo[playerid][pSegUP] = DOF2_GetInt(Arquivodelogin,"SegUP");
        
PlayerInfo[playerid][pMinUP] = DOF2_GetInt(Arquivodelogin,"MinUP");
        
PlayerInfo[playerid][pLocal] = DOF2_GetInt(Arquivodelogin"Local");
        
PlayerInfo[playerid][pTem_Kit] = DOF2_GetInt(Arquivodelogin,"KitFavela");
        
SetPlayerInterior(playeridDOF2_GetInt(Arquivodelogin"Interior"));
        
    
/*    PlayerInfo[playerid][pPosX] = DOF2_GetFloat(Arquivodelogin, "pPosX");
        PlayerInfo[playerid][pPosY] = DOF2_GetFloat(Arquivodelogin, "pPosY");
        PlayerInfo[playerid][pPosZ] = DOF2_GetFloat(Arquivodelogin, "pPosZ");
        PlayerInfo[playerid][pPosA] = DOF2_GetFloat(Arquivodelogin, "pPosA");*/
        
        
for(new 0sizeof(Registro); i++) { TextDrawHideForPlayer(playeridRegistro[i]);}
        
CancelSelectTextDraw(playerid);
        if(
PlayerInfoplayerid ][ pTCasa ] == && PlayerInfoplayerid ][ pSpawn ] == )
        {
            
SpawnCasaplayerid );
        }
        else
        {
            
SetSpawnInfo(playerid0DOF2_GetInt(Arquivodelogin"Skin"), DOF2_GetFloat(Arquivodelogin"pPosX"),DOF2_GetFloat(Arquivodelogin"pPosY"),DOF2_GetFloat(Arquivodelogin"pPosZ"),DOF2_GetFloat(Arquivodelogin"pPosA"),000000);
            
SpawnPlayer(playerid);
        }
    }
    return 
1;

Reply
#2

Tenta ae

PHP код:
stock CarregarPlayer(playerid)
{
    new 
Arquivodelogin[256];
    
format(Arquivodeloginsizeof(Arquivodelogin), "Contas/%s.ini"Nome(playerid));
    if(
DOF2_FileExists(Arquivodelogin))
    {
        
PlayerInfo[playerid][pAdmin] = DOF2_SetInt(Arquivodelogin"Administrador");
        
PlayerInfo[playerid][pMod] = DOF2_SetInt(Arquivodelogin"Moderador");
        
PlayerInfo[playerid][pAju] = DOF2_SetInt(Arquivodelogin"Ajudante");
        
PlayerInfo[playerid][pDono] = DOF2_SetInt(Arquivodelogin"Dono");
        
SetPlayerScore(playeridDOF2_SetInt(Arquivodelogin"Level"));
        
PlayerInfo[playerid][pRespeito] = DOF2_SetInt(Arquivodelogin"EXP");
        
//SetPlayerSkin(playerid, DOF2_SetInt(Arquivodelogin, "Skin"));
        
PlayerInfo[playerid][pMatou] = DOF2_SetInt(Arquivodelogin"Matou");
        
PlayerInfo[playerid][pMorreu] = DOF2_SetInt(Arquivodelogin"Morreu");
        
GivePlayerMoney(playeridDOF2_SetInt(Arquivodelogin"Dinheiro"));
        
PlayerInfo[playerid][pProfissao] = DOF2_SetInt(Arquivodelogin,"Profissao");
        
PlayerInfoplayerid ][ pSpawn ] = DOF2_SetInt(Arquivodelogin,"Spawn");
        
PlayerInfoplayerid ][ pTCasa ] = DOF2_SetInt(Arquivodelogin,"Casa" );
        
PlayerInfoplayerid ][ pImpostos ] = DOF2_SetInt(Arquivodelogin,"Impostos");
        
PlayerInfoplayerid ][ pAtrasados ] = DOF2_SetInt(Arquivodelogin,"Atrasados");
        
pVip[playerid][0]= DOF2_SetInt(Arquivodelogin,"pVTime");
        
pVip[playerid][1] = DOF2_SetInt(Arquivodelogin,"pVip");
        
EmpresaInfo[playerid][Numero] = DOF2_SetInt(Arquivodelogin,"EmpresaID");
        
PlayerInfoplayerid ][ pContratado ] = DOF2_SetInt(Arquivodelogin,"Contratado");
        
PlayerInfo[playerid][pGalaoGasolina] = DOF2_SetInt(Arquivodelogin,"LitrosGalao");
        
PlayerInfo[playerid][pTemGalao] = DOF2_SetInt(Arquivodelogin,"TemGalao");
        
PlayerInfo[playerid][pCelular] = DOF2_SetInt(Arquivodelogin,"CelNumero");
        
PlayerInfo[playerid][pPhoneBook] = DOF2_SetInt(Arquivodelogin,"AgendaTel");
        
PlayerInfo[playerid][pCreditos] = DOF2_SetInt(Arquivodelogin,"Creditos");
        
PlayerInfo[playerid][pFightingStyle] = DOF2_SetInt(Arquivodelogin,"EstiloLuta");
        
PlayerInfo[playerid][pCarLic] = DOF2_GetInt(Arquivodelogin,"LicencaCarro");
        
PlayerInfo[playerid][pBarcoLic] = DOF2_SetInt(Arquivodelogin,"LicencaBarco");
        
PlayerInfo[playerid][pAviaoLic] = DOF2_SetInt(Arquivodelogin,"LicencaAviao");
        
PlayerInfo[playerid][pLicArma] = DOF2_SetInt(Arquivodelogin,"LicencaArma");
        
PlayerInfo[playerid][pCadeia] = DOF2_SetInt(Arquivodelogin,"Preso");
        
PlayerInfo[playerid][pAbuser] = DOF2_SetInt(Arquivodelogin,"Abuser");
        
PlayerInfo[playerid][pCongelado] = DOF2_SetBool(Arquivodelogin"pCongelado");
        
PlayerInfo[playerid][pCalado] = DOF2_SetBool(Arquivodelogin"pCalado");
        
PlayerInfo[playerid][pCapacete] = DOF2_SetInt(Arquivodelogin,"Capacete");
        
PlayerInfo[playerid][pBoombox] = DOF2_SetInt(Arquivodelogin,"Boombox");
        
PlayerInfo[playerid][pAlgemado] = DOF2_SetInt(Arquivodelogin,"Algemado");
        
PlayerInfo[playerid][pRelogioCor] = DOF2_SetInt(Arquivodelogin,"Cor_Relogio");
        
PlayerInfo[playerid][pSegUP] = DOF2_SetInt(Arquivodelogin,"SegUP");
        
PlayerInfo[playerid][pMinUP] = DOF2_SetInt(Arquivodelogin,"MinUP");
        
PlayerInfo[playerid][pLocal] = DOF2_SetInt(Arquivodelogin"Local");
        
PlayerInfo[playerid][pTem_Kit] = DOF2_SetInt(Arquivodelogin,"KitFavela");
        
SetPlayerInterior(playeridDOF2_SetInt(Arquivodelogin"Interior"));
    
/*    PlayerInfo[playerid][pPosX] = DOF2_SetFloat(Arquivodelogin, "pPosX");
        PlayerInfo[playerid][pPosY] = DOF2_SetFloat(Arquivodelogin, "pPosY");
        PlayerInfo[playerid][pPosZ] = DOF2_SetFloat(Arquivodelogin, "pPosZ");
        PlayerInfo[playerid][pPosA] = DOF2_SetFloat(Arquivodelogin, "pPosA");*/
        
for(new 0sizeof(Registro); i++) { TextDrawHideForPlayer(playeridRegistro[i]);}
        
CancelSelectTextDraw(playerid);
        if(
PlayerInfoplayerid ][ pTCasa ] == && PlayerInfoplayerid ][ pSpawn ] == )
        {
            
SpawnCasaplayerid );
        }
        else
        {
            
SetSpawnInfo(playerid0DOF2_SetInt(Arquivodelogin"Skin"), DOF2_SetFloat(Arquivodelogin"pPosX"),DOF2_SetFloat(Arquivodelogin"pPosY"),DOF2_SetFloat(Arquivodelogin"pPosZ"),DOF2_SetFloat(Arquivodelogin"pPosA"),000000);
            
SpawnPlayer(playerid);
        }
    }
    return 
1;

Reply
#3

Quote:
Originally Posted by IgorLuiz
Посмотреть сообщение
Tenta ae

PHP код:
stock CarregarPlayer(playerid)
{
    new 
Arquivodelogin[256];
    
format(Arquivodeloginsizeof(Arquivodelogin), "Contas/%s.ini"Nome(playerid));
    if(
DOF2_FileExists(Arquivodelogin))
    {
        
PlayerInfo[playerid][pAdmin] = DOF2_SetInt(Arquivodelogin"Administrador");
        
PlayerInfo[playerid][pMod] = DOF2_SetInt(Arquivodelogin"Moderador");
        
PlayerInfo[playerid][pAju] = DOF2_SetInt(Arquivodelogin"Ajudante");
        
PlayerInfo[playerid][pDono] = DOF2_SetInt(Arquivodelogin"Dono");
        
SetPlayerScore(playeridDOF2_SetInt(Arquivodelogin"Level"));
        
PlayerInfo[playerid][pRespeito] = DOF2_SetInt(Arquivodelogin"EXP");
        
//SetPlayerSkin(playerid, DOF2_SetInt(Arquivodelogin, "Skin"));
        
PlayerInfo[playerid][pMatou] = DOF2_SetInt(Arquivodelogin"Matou");
        
PlayerInfo[playerid][pMorreu] = DOF2_SetInt(Arquivodelogin"Morreu");
        
GivePlayerMoney(playeridDOF2_SetInt(Arquivodelogin"Dinheiro"));
        
PlayerInfo[playerid][pProfissao] = DOF2_SetInt(Arquivodelogin,"Profissao");
        
PlayerInfoplayerid ][ pSpawn ] = DOF2_SetInt(Arquivodelogin,"Spawn");
        
PlayerInfoplayerid ][ pTCasa ] = DOF2_SetInt(Arquivodelogin,"Casa" );
        
PlayerInfoplayerid ][ pImpostos ] = DOF2_SetInt(Arquivodelogin,"Impostos");
        
PlayerInfoplayerid ][ pAtrasados ] = DOF2_SetInt(Arquivodelogin,"Atrasados");
        
pVip[playerid][0]= DOF2_SetInt(Arquivodelogin,"pVTime");
        
pVip[playerid][1] = DOF2_SetInt(Arquivodelogin,"pVip");
        
EmpresaInfo[playerid][Numero] = DOF2_SetInt(Arquivodelogin,"EmpresaID");
        
PlayerInfoplayerid ][ pContratado ] = DOF2_SetInt(Arquivodelogin,"Contratado");
        
PlayerInfo[playerid][pGalaoGasolina] = DOF2_SetInt(Arquivodelogin,"LitrosGalao");
        
PlayerInfo[playerid][pTemGalao] = DOF2_SetInt(Arquivodelogin,"TemGalao");
        
PlayerInfo[playerid][pCelular] = DOF2_SetInt(Arquivodelogin,"CelNumero");
        
PlayerInfo[playerid][pPhoneBook] = DOF2_SetInt(Arquivodelogin,"AgendaTel");
        
PlayerInfo[playerid][pCreditos] = DOF2_SetInt(Arquivodelogin,"Creditos");
        
PlayerInfo[playerid][pFightingStyle] = DOF2_SetInt(Arquivodelogin,"EstiloLuta");
        
PlayerInfo[playerid][pCarLic] = DOF2_GetInt(Arquivodelogin,"LicencaCarro");
        
PlayerInfo[playerid][pBarcoLic] = DOF2_SetInt(Arquivodelogin,"LicencaBarco");
        
PlayerInfo[playerid][pAviaoLic] = DOF2_SetInt(Arquivodelogin,"LicencaAviao");
        
PlayerInfo[playerid][pLicArma] = DOF2_SetInt(Arquivodelogin,"LicencaArma");
        
PlayerInfo[playerid][pCadeia] = DOF2_SetInt(Arquivodelogin,"Preso");
        
PlayerInfo[playerid][pAbuser] = DOF2_SetInt(Arquivodelogin,"Abuser");
        
PlayerInfo[playerid][pCongelado] = DOF2_SetBool(Arquivodelogin"pCongelado");
        
PlayerInfo[playerid][pCalado] = DOF2_SetBool(Arquivodelogin"pCalado");
        
PlayerInfo[playerid][pCapacete] = DOF2_SetInt(Arquivodelogin,"Capacete");
        
PlayerInfo[playerid][pBoombox] = DOF2_SetInt(Arquivodelogin,"Boombox");
        
PlayerInfo[playerid][pAlgemado] = DOF2_SetInt(Arquivodelogin,"Algemado");
        
PlayerInfo[playerid][pRelogioCor] = DOF2_SetInt(Arquivodelogin,"Cor_Relogio");
        
PlayerInfo[playerid][pSegUP] = DOF2_SetInt(Arquivodelogin,"SegUP");
        
PlayerInfo[playerid][pMinUP] = DOF2_SetInt(Arquivodelogin,"MinUP");
        
PlayerInfo[playerid][pLocal] = DOF2_SetInt(Arquivodelogin"Local");
        
PlayerInfo[playerid][pTem_Kit] = DOF2_SetInt(Arquivodelogin,"KitFavela");
        
SetPlayerInterior(playeridDOF2_SetInt(Arquivodelogin"Interior"));
    
/*    PlayerInfo[playerid][pPosX] = DOF2_SetFloat(Arquivodelogin, "pPosX");
        PlayerInfo[playerid][pPosY] = DOF2_SetFloat(Arquivodelogin, "pPosY");
        PlayerInfo[playerid][pPosZ] = DOF2_SetFloat(Arquivodelogin, "pPosZ");
        PlayerInfo[playerid][pPosA] = DOF2_SetFloat(Arquivodelogin, "pPosA");*/
        
for(new 0sizeof(Registro); i++) { TextDrawHideForPlayer(playeridRegistro[i]);}
        
CancelSelectTextDraw(playerid);
        if(
PlayerInfoplayerid ][ pTCasa ] == && PlayerInfoplayerid ][ pSpawn ] == )
        {
            
SpawnCasaplayerid );
        }
        else
        {
            
SetSpawnInfo(playerid0DOF2_SetInt(Arquivodelogin"Skin"), DOF2_SetFloat(Arquivodelogin"pPosX"),DOF2_SetFloat(Arquivodelogin"pPosY"),DOF2_SetFloat(Arquivodelogin"pPosZ"),DOF2_SetFloat(Arquivodelogin"pPosA"),000000);
            
SpawnPlayer(playerid);
        }
    }
    return 
1;

Ele quer ler o que estб salvo no arquivo, nгo setar o conteъdo.

-
Acredito que o erro estava nisso.
Код:
stock CarregarPlayer(playerid) 
{ 
    new Arquivodelogin[256];
    new Nome[MAX_PLAYER_NAME];
    GetPlayerName(playerid,Nome,sizeof(Nome));
    format(Arquivodelogin, sizeof(Arquivodelogin), "Contas/%s.ini", Nome); 
    if(DOF2_FileExists(Arquivodelogin)) 
    { 
        PlayerInfo[playerid][pAdmin] = DOF2_GetInt(Arquivodelogin, "Administrador"); 
        PlayerInfo[playerid][pMod] = DOF2_GetInt(Arquivodelogin, "Moderador"); 
        PlayerInfo[playerid][pAju] = DOF2_GetInt(Arquivodelogin, "Ajudante"); 
        PlayerInfo[playerid][pDono] = DOF2_GetInt(Arquivodelogin, "Dono"); 
        SetPlayerScore(playerid, DOF2_GetInt(Arquivodelogin, "Level")); 
        PlayerInfo[playerid][pRespeito] = DOF2_GetInt(Arquivodelogin, "EXP"); 
        //SetPlayerSkin(playerid, DOF2_GetInt(Arquivodelogin, "Skin")); 
        PlayerInfo[playerid][pMatou] = DOF2_GetInt(Arquivodelogin, "Matou"); 
        PlayerInfo[playerid][pMorreu] = DOF2_GetInt(Arquivodelogin, "Morreu"); 
        GivePlayerMoney(playerid, DOF2_GetInt(Arquivodelogin, "Dinheiro")); 
        PlayerInfo[playerid][pProfissao] = DOF2_GetInt(Arquivodelogin,"Profissao"); 
        PlayerInfo[ playerid ][ pSpawn ] = DOF2_GetInt(Arquivodelogin,"Spawn"); 
        PlayerInfo[ playerid ][ pTCasa ] = DOF2_GetInt(Arquivodelogin,"Casa" ); 

        PlayerInfo[ playerid ][ pImpostos ] = DOF2_GetInt(Arquivodelogin,"Impostos"); 
        PlayerInfo[ playerid ][ pAtrasados ] = DOF2_GetInt(Arquivodelogin,"Atrasados"); 
        pVip[playerid][0]= DOF2_GetInt(Arquivodelogin,"pVTime"); 
        pVip[playerid][1] = DOF2_GetInt(Arquivodelogin,"pVip"); 
        EmpresaInfo[playerid][Numero] = DOF2_GetInt(Arquivodelogin,"EmpresaID"); 
        PlayerInfo[ playerid ][ pContratado ] = DOF2_GetInt(Arquivodelogin,"Contratado"); 
     
         
        PlayerInfo[playerid][pGalaoGasolina] = DOF2_GetInt(Arquivodelogin,"LitrosGalao"); 
        PlayerInfo[playerid][pTemGalao] = DOF2_GetInt(Arquivodelogin,"TemGalao"); 
        PlayerInfo[playerid][pCelular] = DOF2_GetInt(Arquivodelogin,"CelNumero"); 
        PlayerInfo[playerid][pPhoneBook] = DOF2_GetInt(Arquivodelogin,"AgendaTel"); 
        PlayerInfo[playerid][pCreditos] = DOF2_GetInt(Arquivodelogin,"Creditos"); 
        PlayerInfo[playerid][pFightingStyle] = DOF2_GetInt(Arquivodelogin,"EstiloLuta"); 
        PlayerInfo[playerid][pCarLic] = DOF2_GetInt(Arquivodelogin,"LicencaCarro"); 
        PlayerInfo[playerid][pBarcoLic] = DOF2_GetInt(Arquivodelogin,"LicencaBarco"); 
        PlayerInfo[playerid][pAviaoLic] = DOF2_GetInt(Arquivodelogin,"LicencaAviao"); 
        PlayerInfo[playerid][pLicArma] = DOF2_GetInt(Arquivodelogin,"LicencaArma"); 
        PlayerInfo[playerid][pCadeia] = DOF2_GetInt(Arquivodelogin,"Preso"); 
        PlayerInfo[playerid][pAbuser] = DOF2_GetInt(Arquivodelogin,"Abuser"); 
        PlayerInfo[playerid][pCongelado] = DOF2_GetBool(Arquivodelogin, "pCongelado"); 
        PlayerInfo[playerid][pCalado] = DOF2_GetBool(Arquivodelogin, "pCalado"); 
        PlayerInfo[playerid][pCapacete] = DOF2_GetInt(Arquivodelogin,"Capacete"); 
        PlayerInfo[playerid][pBoombox] = DOF2_GetInt(Arquivodelogin,"Boombox"); 
        PlayerInfo[playerid][pAlgemado] = DOF2_GetInt(Arquivodelogin,"Algemado"); 
        PlayerInfo[playerid][pRelogioCor] = DOF2_GetInt(Arquivodelogin,"Cor_Relogio"); 
        PlayerInfo[playerid][pSegUP] = DOF2_GetInt(Arquivodelogin,"SegUP"); 
        PlayerInfo[playerid][pMinUP] = DOF2_GetInt(Arquivodelogin,"MinUP"); 
        PlayerInfo[playerid][pLocal] = DOF2_GetInt(Arquivodelogin, "Local"); 
        PlayerInfo[playerid][pTem_Kit] = DOF2_GetInt(Arquivodelogin,"KitFavela"); 
        SetPlayerInterior(playerid, DOF2_GetInt(Arquivodelogin, "Interior")); 
         
    /*    PlayerInfo[playerid][pPosX] = DOF2_GetFloat(Arquivodelogin, "pPosX"); 
        PlayerInfo[playerid][pPosY] = DOF2_GetFloat(Arquivodelogin, "pPosY"); 
        PlayerInfo[playerid][pPosZ] = DOF2_GetFloat(Arquivodelogin, "pPosZ"); 
        PlayerInfo[playerid][pPosA] = DOF2_GetFloat(Arquivodelogin, "pPosA");*/ 
         
        for(new i = 0; i < sizeof(Registro); i++) { TextDrawHideForPlayer(playerid, Registro[i]);} 
        CancelSelectTextDraw(playerid); 

        if(PlayerInfo[ playerid ][ pTCasa ] == 1 && PlayerInfo[ playerid ][ pSpawn ] == 1 ) 
        { 
            SpawnCasa( playerid ); 
        } 
        else 
        { 
            SetSpawnInfo(playerid, 0, DOF2_GetInt(Arquivodelogin, "Skin"), DOF2_GetFloat(Arquivodelogin, "pPosX"),DOF2_GetFloat(Arquivodelogin, "pPosY"),DOF2_GetFloat(Arquivodelogin, "pPosZ"),DOF2_GetFloat(Arquivodelogin, "pPosA"),0, 0, 0, 0, 0, 0); 
            SpawnPlayer(playerid); 
        } 
    } 
    return 1; 
}
Reply
#4

Quote:
Originally Posted by LucasDias
Посмотреть сообщение
Eu uso a include DOF2, salvar nгo й o problema, fica tudo perfeito, o problema, й na hora de carregar, que reseta tudo, se alguem puder me ajudar! Ao invйs de carregar o que ta no arquivo ele reseta o que ta no arquivo!

Uso as includes:
PHP код:
#include <a_samp>
#include <foreach>
#include <zcmd>
#include <DOF2>
#include <mSelection>
#include <Streamer>
#include <sscanf> 
PHP код:
stock CarregarPlayer(playerid)
{
    new 
Arquivodelogin[256];
    
format(Arquivodeloginsizeof(Arquivodelogin), "Contas/%s.ini"Nome(playerid));
    if(
DOF2_FileExists(Arquivodelogin))
    {
        
PlayerInfo[playerid][pAdmin] = DOF2_GetInt(Arquivodelogin"Administrador");
        
PlayerInfo[playerid][pMod] = DOF2_GetInt(Arquivodelogin"Moderador");
        
PlayerInfo[playerid][pAju] = DOF2_GetInt(Arquivodelogin"Ajudante");
        
PlayerInfo[playerid][pDono] = DOF2_GetInt(Arquivodelogin"Dono");
        
SetPlayerScore(playeridDOF2_GetInt(Arquivodelogin"Level"));
        
PlayerInfo[playerid][pRespeito] = DOF2_GetInt(Arquivodelogin"EXP");
        
//SetPlayerSkin(playerid, DOF2_GetInt(Arquivodelogin, "Skin"));
        
PlayerInfo[playerid][pMatou] = DOF2_GetInt(Arquivodelogin"Matou");
        
PlayerInfo[playerid][pMorreu] = DOF2_GetInt(Arquivodelogin"Morreu");
        
GivePlayerMoney(playeridDOF2_GetInt(Arquivodelogin"Dinheiro"));
        
PlayerInfo[playerid][pProfissao] = DOF2_GetInt(Arquivodelogin,"Profissao");
        
PlayerInfoplayerid ][ pSpawn ] = DOF2_GetInt(Arquivodelogin,"Spawn");
        
PlayerInfoplayerid ][ pTCasa ] = DOF2_GetInt(Arquivodelogin,"Casa" );
        
PlayerInfoplayerid ][ pImpostos ] = DOF2_GetInt(Arquivodelogin,"Impostos");
        
PlayerInfoplayerid ][ pAtrasados ] = DOF2_GetInt(Arquivodelogin,"Atrasados");
        
pVip[playerid][0]= DOF2_GetInt(Arquivodelogin,"pVTime");
        
pVip[playerid][1] = DOF2_GetInt(Arquivodelogin,"pVip");
        
EmpresaInfo[playerid][Numero] = DOF2_GetInt(Arquivodelogin,"EmpresaID");
        
PlayerInfoplayerid ][ pContratado ] = DOF2_GetInt(Arquivodelogin,"Contratado");
    
        
        
PlayerInfo[playerid][pGalaoGasolina] = DOF2_GetInt(Arquivodelogin,"LitrosGalao");
        
PlayerInfo[playerid][pTemGalao] = DOF2_GetInt(Arquivodelogin,"TemGalao");
        
PlayerInfo[playerid][pCelular] = DOF2_GetInt(Arquivodelogin,"CelNumero");
        
PlayerInfo[playerid][pPhoneBook] = DOF2_GetInt(Arquivodelogin,"AgendaTel");
        
PlayerInfo[playerid][pCreditos] = DOF2_GetInt(Arquivodelogin,"Creditos");
        
PlayerInfo[playerid][pFightingStyle] = DOF2_GetInt(Arquivodelogin,"EstiloLuta");
        
PlayerInfo[playerid][pCarLic] = DOF2_GetInt(Arquivodelogin,"LicencaCarro");
        
PlayerInfo[playerid][pBarcoLic] = DOF2_GetInt(Arquivodelogin,"LicencaBarco");
        
PlayerInfo[playerid][pAviaoLic] = DOF2_GetInt(Arquivodelogin,"LicencaAviao");
        
PlayerInfo[playerid][pLicArma] = DOF2_GetInt(Arquivodelogin,"LicencaArma");
        
PlayerInfo[playerid][pCadeia] = DOF2_GetInt(Arquivodelogin,"Preso");
        
PlayerInfo[playerid][pAbuser] = DOF2_GetInt(Arquivodelogin,"Abuser");
        
PlayerInfo[playerid][pCongelado] = DOF2_GetBool(Arquivodelogin"pCongelado");
        
PlayerInfo[playerid][pCalado] = DOF2_GetBool(Arquivodelogin"pCalado");
        
PlayerInfo[playerid][pCapacete] = DOF2_GetInt(Arquivodelogin,"Capacete");
        
PlayerInfo[playerid][pBoombox] = DOF2_GetInt(Arquivodelogin,"Boombox");
        
PlayerInfo[playerid][pAlgemado] = DOF2_GetInt(Arquivodelogin,"Algemado");
        
PlayerInfo[playerid][pRelogioCor] = DOF2_GetInt(Arquivodelogin,"Cor_Relogio");
        
PlayerInfo[playerid][pSegUP] = DOF2_GetInt(Arquivodelogin,"SegUP");
        
PlayerInfo[playerid][pMinUP] = DOF2_GetInt(Arquivodelogin,"MinUP");
        
PlayerInfo[playerid][pLocal] = DOF2_GetInt(Arquivodelogin"Local");
        
PlayerInfo[playerid][pTem_Kit] = DOF2_GetInt(Arquivodelogin,"KitFavela");
        
SetPlayerInterior(playeridDOF2_GetInt(Arquivodelogin"Interior"));
        
    
/*    PlayerInfo[playerid][pPosX] = DOF2_GetFloat(Arquivodelogin, "pPosX");
        PlayerInfo[playerid][pPosY] = DOF2_GetFloat(Arquivodelogin, "pPosY");
        PlayerInfo[playerid][pPosZ] = DOF2_GetFloat(Arquivodelogin, "pPosZ");
        PlayerInfo[playerid][pPosA] = DOF2_GetFloat(Arquivodelogin, "pPosA");*/
        
        
for(new 0sizeof(Registro); i++) { TextDrawHideForPlayer(playeridRegistro[i]);}
        
CancelSelectTextDraw(playerid);
        if(
PlayerInfoplayerid ][ pTCasa ] == && PlayerInfoplayerid ][ pSpawn ] == )
        {
            
SpawnCasaplayerid );
        }
        else
        {
            
SetSpawnInfo(playerid0DOF2_GetInt(Arquivodelogin"Skin"), DOF2_GetFloat(Arquivodelogin"pPosX"),DOF2_GetFloat(Arquivodelogin"pPosY"),DOF2_GetFloat(Arquivodelogin"pPosZ"),DOF2_GetFloat(Arquivodelogin"pPosA"),000000);
            
SpawnPlayer(playerid);
        }
    }
    return 
1;

Nгo parecer ter nada de errado..
Pode ser que 256 cйlulas da variбvel Arquivodelogin esteja, sendo poucas.

Faзa DEBUGs para ver se esta lendo o cуdigo da stock CarregarPlayer
Reply
#5

Quote:
Originally Posted by Monotox
Посмотреть сообщение
Ele quer ler o que estб salvo no arquivo, nгo setar o conteъdo.
vdd. sorry!
Reply
#6

Vocк verificou na pasta Scriptfiles, se quando vocк desconecta do server ela salva a conta?
Reply
#7

Quote:
Originally Posted by Monotox
Посмотреть сообщение
Ele quer ler o que estб salvo no arquivo, nгo setar o conteъdo.

-
Acredito que o erro estava nisso.
Код:
stock CarregarPlayer(playerid) 
{ 
    new Arquivodelogin[256];
    new Nome[MAX_PLAYER_NAME];
    GetPlayerName(playerid,Nome,sizeof(Nome));
    format(Arquivodelogin, sizeof(Arquivodelogin), "Contas/%s.ini", Nome); 
    if(DOF2_FileExists(Arquivodelogin)) 
    { 
        PlayerInfo[playerid][pAdmin] = DOF2_GetInt(Arquivodelogin, "Administrador"); 
        PlayerInfo[playerid][pMod] = DOF2_GetInt(Arquivodelogin, "Moderador"); 
        PlayerInfo[playerid][pAju] = DOF2_GetInt(Arquivodelogin, "Ajudante"); 
        PlayerInfo[playerid][pDono] = DOF2_GetInt(Arquivodelogin, "Dono"); 
        SetPlayerScore(playerid, DOF2_GetInt(Arquivodelogin, "Level")); 
        PlayerInfo[playerid][pRespeito] = DOF2_GetInt(Arquivodelogin, "EXP"); 
        //SetPlayerSkin(playerid, DOF2_GetInt(Arquivodelogin, "Skin")); 
        PlayerInfo[playerid][pMatou] = DOF2_GetInt(Arquivodelogin, "Matou"); 
        PlayerInfo[playerid][pMorreu] = DOF2_GetInt(Arquivodelogin, "Morreu"); 
        GivePlayerMoney(playerid, DOF2_GetInt(Arquivodelogin, "Dinheiro")); 
        PlayerInfo[playerid][pProfissao] = DOF2_GetInt(Arquivodelogin,"Profissao"); 
        PlayerInfo[ playerid ][ pSpawn ] = DOF2_GetInt(Arquivodelogin,"Spawn"); 
        PlayerInfo[ playerid ][ pTCasa ] = DOF2_GetInt(Arquivodelogin,"Casa" ); 

        PlayerInfo[ playerid ][ pImpostos ] = DOF2_GetInt(Arquivodelogin,"Impostos"); 
        PlayerInfo[ playerid ][ pAtrasados ] = DOF2_GetInt(Arquivodelogin,"Atrasados"); 
        pVip[playerid][0]= DOF2_GetInt(Arquivodelogin,"pVTime"); 
        pVip[playerid][1] = DOF2_GetInt(Arquivodelogin,"pVip"); 
        EmpresaInfo[playerid][Numero] = DOF2_GetInt(Arquivodelogin,"EmpresaID"); 
        PlayerInfo[ playerid ][ pContratado ] = DOF2_GetInt(Arquivodelogin,"Contratado"); 
     
         
        PlayerInfo[playerid][pGalaoGasolina] = DOF2_GetInt(Arquivodelogin,"LitrosGalao"); 
        PlayerInfo[playerid][pTemGalao] = DOF2_GetInt(Arquivodelogin,"TemGalao"); 
        PlayerInfo[playerid][pCelular] = DOF2_GetInt(Arquivodelogin,"CelNumero"); 
        PlayerInfo[playerid][pPhoneBook] = DOF2_GetInt(Arquivodelogin,"AgendaTel"); 
        PlayerInfo[playerid][pCreditos] = DOF2_GetInt(Arquivodelogin,"Creditos"); 
        PlayerInfo[playerid][pFightingStyle] = DOF2_GetInt(Arquivodelogin,"EstiloLuta"); 
        PlayerInfo[playerid][pCarLic] = DOF2_GetInt(Arquivodelogin,"LicencaCarro"); 
        PlayerInfo[playerid][pBarcoLic] = DOF2_GetInt(Arquivodelogin,"LicencaBarco"); 
        PlayerInfo[playerid][pAviaoLic] = DOF2_GetInt(Arquivodelogin,"LicencaAviao"); 
        PlayerInfo[playerid][pLicArma] = DOF2_GetInt(Arquivodelogin,"LicencaArma"); 
        PlayerInfo[playerid][pCadeia] = DOF2_GetInt(Arquivodelogin,"Preso"); 
        PlayerInfo[playerid][pAbuser] = DOF2_GetInt(Arquivodelogin,"Abuser"); 
        PlayerInfo[playerid][pCongelado] = DOF2_GetBool(Arquivodelogin, "pCongelado"); 
        PlayerInfo[playerid][pCalado] = DOF2_GetBool(Arquivodelogin, "pCalado"); 
        PlayerInfo[playerid][pCapacete] = DOF2_GetInt(Arquivodelogin,"Capacete"); 
        PlayerInfo[playerid][pBoombox] = DOF2_GetInt(Arquivodelogin,"Boombox"); 
        PlayerInfo[playerid][pAlgemado] = DOF2_GetInt(Arquivodelogin,"Algemado"); 
        PlayerInfo[playerid][pRelogioCor] = DOF2_GetInt(Arquivodelogin,"Cor_Relogio"); 
        PlayerInfo[playerid][pSegUP] = DOF2_GetInt(Arquivodelogin,"SegUP"); 
        PlayerInfo[playerid][pMinUP] = DOF2_GetInt(Arquivodelogin,"MinUP"); 
        PlayerInfo[playerid][pLocal] = DOF2_GetInt(Arquivodelogin, "Local"); 
        PlayerInfo[playerid][pTem_Kit] = DOF2_GetInt(Arquivodelogin,"KitFavela"); 
        SetPlayerInterior(playerid, DOF2_GetInt(Arquivodelogin, "Interior")); 
         
    /*    PlayerInfo[playerid][pPosX] = DOF2_GetFloat(Arquivodelogin, "pPosX"); 
        PlayerInfo[playerid][pPosY] = DOF2_GetFloat(Arquivodelogin, "pPosY"); 
        PlayerInfo[playerid][pPosZ] = DOF2_GetFloat(Arquivodelogin, "pPosZ"); 
        PlayerInfo[playerid][pPosA] = DOF2_GetFloat(Arquivodelogin, "pPosA");*/ 
         
        for(new i = 0; i < sizeof(Registro); i++) { TextDrawHideForPlayer(playerid, Registro[i]);} 
        CancelSelectTextDraw(playerid); 

        if(PlayerInfo[ playerid ][ pTCasa ] == 1 && PlayerInfo[ playerid ][ pSpawn ] == 1 ) 
        { 
            SpawnCasa( playerid ); 
        } 
        else 
        { 
            SetSpawnInfo(playerid, 0, DOF2_GetInt(Arquivodelogin, "Skin"), DOF2_GetFloat(Arquivodelogin, "pPosX"),DOF2_GetFloat(Arquivodelogin, "pPosY"),DOF2_GetFloat(Arquivodelogin, "pPosZ"),DOF2_GetFloat(Arquivodelogin, "pPosA"),0, 0, 0, 0, 0, 0); 
            SpawnPlayer(playerid); 
        } 
    } 
    return 1; 
}
nгo entendi a diferenзa, seria sу a de pegar o nome do player?
Reply
#8

Quote:
Originally Posted by Cleyson
Посмотреть сообщение
Nгo parecer ter nada de errado..
Pode ser que 256 cйlulas da variбvel Arquivodelogin esteja, sendo poucas.

Faзa DEBUGs para ver se esta lendo o cуdigo da stock CarregarPlayer
como eu poderia fazer um debug nessa stock?

colocar um printf(""); la ?
Reply
#9

Quote:
Originally Posted by LucasDias
Посмотреть сообщение
como eu poderia fazer um debug nessa stock?

colocar um printf(""); la ?
Adicione no final da stock
PHP код:
    print ( "DEBUG: Dados Carregados" ) ; 
Depois verifique no "server_log.txt"

Ex:
PHP код:
[13:38:57DEBUGDados Carregados
[13:38:59Debug information 
Reply
#10

Quote:
Originally Posted by IgorLuiz
Посмотреть сообщение
Adicione no final da stock
PHP код:
    print ( "DEBUG: Dados Carregados" ) ; 
Depois verifique no "server_log.txt"

Ex:
PHP код:
[13:38:57DEBUGDados Carregados
[13:38:59Debug information 
Apareceu a mensagem, e carregou, porйm resetou a skin, e se eu adicionar algo pra carregar, ele reseta a conta toda do player..

@EDIT
aparece a mensagem, mas mesmo assim a conta й resetada!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)