Problema com Dini.
#3

Quote:
Originally Posted by MiTToS
Посмотреть сообщение
Mostra o cуdigo.

PS: new Sootaque[256]; nгo precisa ser tamanho 256, vocк sу consegue imprimir 128 caracteres em sua tela, entгo pode deixar new Sootaque[128]; assim vocк economiza
Beleza, mas eu nunca entendi o porque disso... Se eu coloco 128 ou 256 oque eu vou economizar? hehe

Qual cуdigo quer que eu coloque?
Tem vбrios, vou tentar colocar todos.
Eu vou colocar o atual (o com dialog de lista que estб funcionando).

pawn Код:
new Sotaque[MAX_PLAYERS] = 0; //no top do gm
pawn Код:
enum info_p
{
    Name[40],Level,Money,Job,HouseKey,Org,Ip[20],Warnings,Banned,Admin,VipLevel,Kills,Deaths,Lider,NecessaryToUp,ToggleSkin,
    BankMoney,LogedTime,Loged,Cargo,JailTime,Jails,Crims,SkillMecanico,GameTime,MobileNumber,Respect,StoreKey,VHouseKey,Float:XOldPosH,Float:YOldPosH,Float:ZOldPosH,WantedLevel,Skin,Contrato,
    /*ToUpSkillAdvogado,ToUpSkillLadrao,ToUpSkillDetetive,ToUpSkillMedico*/ToUpSkillMecanico,SpawnAtHome,CarKey,
    bool:calling,caller,CarandiruTime,pMats,pGun2,pAmmo2,Drogas,PenaR,EP,BR,EPID,BRID,Imobilizado,TraficoDelay,Produtos,Agenda,
    VipDays,VipId,Cigarro,JobTime,Ammo,LastAmmo,Float:LastPosX,Float:LastPosY,Float:LastPosZ,LastInterior,pKey[128],AbastecimentoTime,CelPower,
    LAerea,LNautica,LTerrestre,PorteDeArmas,ValorDaPesca,PescaDelay,Iscas,SkinCasual,OnJob,Xp,Doenca,HospitalTime,Vacina,RezaDelay,MacumbaDelay,
    Terco,GalinhaPreta,Harpao,NoteBook,Mochila,Alcool,Garrafa,Veneno,Estilo,IntPass,Aplicacao,Nomedopai[256],Nomedamae[256],Anonascido,Mesnascido,Dianascido
};
pawn Код:
if(dialogid == EscolherSotaque)
{
        if(!response) return Kick(playerid);        
        if(listitem == 0)        
        {
        Sotaque[playerid] = 1    
        Tutorial[playerid] = 1;        
        SpawnPlayer(playerid);        
        }        
        else if(listitem == 1)        
        {
        Sotaque[playerid] = 2    
        Tutorial[playerid] = 1;        
        SpawnPlayer(playerid);        
        }        
        else if(listitem == 2)        
        {
        Sotaque[playerid] = 3    
        Tutorial[playerid] = 1;        
        SpawnPlayer(playerid);        
        }        
        else if(listitem == 3)        
        {
        Sotaque[playerid] = 4    
        Tutorial[playerid] = 1;        
        SpawnPlayer(playerid);        
        }
        return 1;
}
//O Response do dialog
pawn Код:
public SavePlayerConfig(playerid)
{
    new FilePath[256];
    new pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
    format(FilePath, sizeof(FilePath), "%s%s.ini",UserFiles,pname);
    if(!dini_Exists(FilePath))
    {
    }
    else if(PlayerInfo[playerid][Loged] == 1)
    {
        dini_Set(FilePath, "Name", PlayerInfo[playerid][Name]);
        dini_IntSet(FilePath, "Level", PlayerInfo[playerid][Level]);
        dini_IntSet(FilePath, "WantedLevel", PlayerInfo[playerid][WantedLevel]);
        dini_IntSet(FilePath, "Money", GetPlayerMoneyEx(playerid));
        dini_IntSet(FilePath, "Job", PlayerInfo[playerid][Job]);
        dini_IntSet(FilePath, "Org", PlayerInfo[playerid][Org]);
        dini_IntSet(FilePath, "Warnings", PlayerInfo[playerid][Warnings]);
        dini_IntSet(FilePath, "Banned", PlayerInfo[playerid][Banned]);
        dini_IntSet(FilePath, "Admin", PlayerInfo[playerid][Admin]);
        dini_IntSet(FilePath, "VipLevel", PlayerInfo[playerid][VipLevel]);
        dini_IntSet(FilePath, "Kills", PlayerInfo[playerid][Kills]);
        dini_IntSet(FilePath, "Deaths", PlayerInfo[playerid][Deaths]);

        dini_IntSet(FilePath, "BankMoney", PlayerInfo[playerid][BankMoney]);

        dini_IntSet(FilePath, "GameTime", PlayerInfo[playerid][GameTime]);

        dini_IntSet(FilePath, "Respect", PlayerInfo[playerid][Respect]);

        dini_IntSet(FilePath, "Cargo", PlayerInfo[playerid][Cargo]);

        dini_IntSet(FilePath, "JailTime", PlayerInfo[playerid][JailTime]);

        dini_IntSet(FilePath, "Jails", PlayerInfo[playerid][Jails]);

        dini_IntSet(FilePath, "Crims", PlayerInfo[playerid][Crims]);

        dini_IntSet(FilePath, "SkillMecanico", PlayerInfo[playerid][SkillMecanico]);
        dini_IntSet(FilePath, "Skin", PlayerInfo[playerid][Skin]);
        dini_IntSet(FilePath, "Lider", PlayerInfo[playerid][Lider]);
        dini_IntSet(FilePath, "NecessaryToUp", PlayerInfo[playerid][NecessaryToUp]);
        dini_IntSet(FilePath, "MobileNumber", PlayerInfo[playerid][MobileNumber]);
        dini_IntSet(FilePath, "ToUpSkillMecanico", PlayerInfo[playerid][ToUpSkillMecanico]);
        dini_IntSet(FilePath, "SpawnAtHome", PlayerInfo[playerid][SpawnAtHome]);
        dini_IntSet(FilePath, "Contrato", PlayerInfo[playerid][Contrato]);
        dini_IntSet(FilePath, "CarandiruTime", PlayerInfo[playerid][CarandiruTime]);
        dini_IntSet(FilePath, "pMats", PlayerInfo[playerid][pMats]);
        dini_IntSet(FilePath, "Drogas", PlayerInfo[playerid][Drogas]);
        dini_IntSet(FilePath, "PenaR", PlayerInfo[playerid][PenaR]);
        dini_IntSet(FilePath, "TraficoDelay", PlayerInfo[playerid][TraficoDelay]);
        dini_IntSet(FilePath, "Agenda", PlayerInfo[playerid][Agenda]);
        dini_IntSet(FilePath, "VipId", PlayerInfo[playerid][VipId]);
        dini_IntSet(FilePath, "JobTime", PlayerInfo[playerid][JobTime]);
        dini_IntSet(FilePath, "LNautica", PlayerInfo[playerid][LNautica]);
        dini_IntSet(FilePath, "LAerea", PlayerInfo[playerid][LAerea]);
        dini_IntSet(FilePath, "LTerrestre", PlayerInfo[playerid][LTerrestre]);
        dini_IntSet(FilePath, "PorteDeArmas", PlayerInfo[playerid][PorteDeArmas]);
        dini_IntSet(FilePath, "Iscas", PlayerInfo[playerid][Iscas]);
        dini_IntSet(FilePath, "ValorDaPesca", PlayerInfo[playerid][ValorDaPesca]);
        dini_IntSet(FilePath, "SkinCasual", PlayerInfo[playerid][SkinCasual]);
        dini_IntSet(FilePath, "Xp", PlayerInfo[playerid][Xp]);
        dini_IntSet(FilePath, "Doenca", PlayerInfo[playerid][Doenca]);
        dini_IntSet(FilePath, "HospitalTime", PlayerInfo[playerid][HospitalTime]);
        dini_IntSet(FilePath, "Vacina", PlayerInfo[playerid][Vacina]);
        dini_IntSet(FilePath, "Cigarro", PlayerInfo[playerid][Cigarro]);
        dini_IntSet(FilePath, "Terco", PlayerInfo[playerid][Terco]);
        dini_IntSet(FilePath, "GalinhaPreta", PlayerInfo[playerid][GalinhaPreta]);
        dini_IntSet(FilePath, "MacumbaDelay", PlayerInfo[playerid][MacumbaDelay]);
        dini_IntSet(FilePath, "RezaDelay", PlayerInfo[playerid][RezaDelay]);
        dini_IntSet(FilePath, "Harpao", PlayerInfo[playerid][Harpao]);
        dini_IntSet(FilePath, "NoteBook", PlayerInfo[playerid][NoteBook]);
        dini_IntSet(FilePath, "Mochila", PlayerInfo[playerid][Mochila]);
        dini_IntSet(FilePath, "Estilo", PlayerInfo[playerid][Estilo]);
        dini_IntSet(FilePath, "Aplicacao", PlayerInfo[playerid][Aplicacao]);
        dini_IntSet(FilePath, "Tutorial", Tutorial[playerid]);        
        dini_IntSet(FilePath, "Sotaque", Sotaque[playerid]);        
        dini_IntSet(FilePath, "Nomedopai", PlayerInfo[playerid][Nomedopai]);        
        dini_IntSet(FilePath, "Nomedamae", PlayerInfo[playerid][Nomedamae]);        
        dini_IntSet(FilePath, "Anonascido", PlayerInfo[playerid][Anonascido]);        
        dini_IntSet(FilePath, "Mesnascido", PlayerInfo[playerid][Mesnascido]);        
        dini_IntSet(FilePath, "Dianascido", PlayerInfo[playerid][Dianascido]);
        printf("Conta de %s salva com sucesso.",PlayerInfo[playerid][Name]);
    }
}

public LoadPlayerConfig(playerid)
{
    new FilePath[256];
    new pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
    format(FilePath, sizeof(FilePath), "%s%s.ini",UserFiles,pname);
    if(!dini_Exists(FilePath))
    {
        dini_Create(FilePath);
        dini_Set(FilePath, "Name", PlayerInfo[playerid][Name]);
        dini_IntSet(FilePath, "Level",1);
        dini_IntSet(FilePath, "Money",0);
        dini_IntSet(FilePath, "WantedLevel",0);
        dini_IntSet(FilePath, "Job", 0);
        dini_IntSet(FilePath, "Org", 0);
        dini_Set(FilePath, "Ip", PlayerInfo[playerid][Ip]);
        dini_IntSet(FilePath, "Warnings", 0);
        dini_IntSet(FilePath, "Banned", 0);
        dini_IntSet(FilePath, "Admin", 0);
        dini_IntSet(FilePath, "VipLevel", 0);
        dini_IntSet(FilePath, "Kills", 0);
        dini_IntSet(FilePath, "Deaths", 0);
        dini_IntSet(FilePath, "BankMoney", 500);
        dini_IntSet(FilePath, "GameTime", 0);
        dini_IntSet(FilePath, "Respect", 0);
        dini_IntSet(FilePath, "Cargo", 0);
        dini_IntSet(FilePath, "JailTime", -1);
        dini_IntSet(FilePath, "Jails", 0);
        dini_IntSet(FilePath, "Crims", 0);
        dini_IntSet(FilePath, "SkillMecanico", 0);
        dini_IntSet(FilePath, "Skin", 95);
        dini_IntSet(FilePath, "Lider", 0);
        dini_IntSet(FilePath, "NecessaryToUp", 6);
        dini_IntSet(FilePath, "MobileNumber", 0);
        dini_IntSet(FilePath, "ToUpSkillMecanico", 50);
        dini_IntSet(FilePath, "SpawnAtHome", 0);
        dini_IntSet(FilePath, "Contrato", 0);
        dini_IntSet(FilePath, "CarandiruTime", -1);
        dini_IntSet(FilePath, "pMats", 0);
        dini_IntSet(FilePath, "Drogas", 0);
        dini_IntSet(FilePath, "PenaR", 0);
        dini_IntSet(FilePath, "TraficoDelay", 0);
        dini_IntSet(FilePath, "Agenda", 0);
        dini_IntSet(FilePath, "VipId", -1);
        dini_IntSet(FilePath, "VipDays", -1);
        dini_IntSet(FilePath, "JobTime", 0);
        dini_IntSet(FilePath, "LNautica", 0);
        dini_IntSet(FilePath, "LAerea", 0);
        dini_IntSet(FilePath, "LTerrestre", 0);
        dini_IntSet(FilePath, "PorteDeArmas", 0);
        dini_IntSet(FilePath, "Iscas", 0);
        dini_IntSet(FilePath, "ValorDaPesca", 0);
        dini_IntSet(FilePath, "SkinCasual", 95);
        dini_IntSet(FilePath, "Xp", 95);
        dini_IntSet(FilePath, "Doenca", 0);
        dini_IntSet(FilePath, "HospitalTime", -1);
        dini_IntSet(FilePath, "Vacina", 0);
        dini_IntSet(FilePath, "Cigarro", 0);
        dini_IntSet(FilePath, "Terco", 0);
        dini_IntSet(FilePath, "GalinhaPreta", 0);
        dini_IntSet(FilePath, "MacumbaDelay", 0);
        dini_IntSet(FilePath, "RezaDelay", 0);
        dini_IntSet(FilePath, "Harpao", 0);
        dini_IntSet(FilePath, "NoteBook", 0);
        dini_IntSet(FilePath, "Mochila", 0);
        dini_IntSet(FilePath, "Estilo", 0);
        dini_IntSet(FilePath, "Aplicacao", 0);
        dini_IntSet(FilePath, "Tutorial", 1);
        dini_IntSet(FilePath, "Sotaque", 0);        
        dini_IntSet(FilePath, "Nomedopai", PlayerInfo[playerid][Nomedopai]);        
        dini_IntSet(FilePath, "Anonascido", PlayerInfo[playerid][Anonascido]);        
        dini_IntSet(FilePath, "Mesnascido", PlayerInfo[playerid][Mesnascido]);        
        dini_IntSet(FilePath, "Dianascido", PlayerInfo[playerid][Dianascido]);  
        GivePlayerMoneyEx(playerid,500);
        SetPlayerScore(playerid,1);
        printf("Conta de %s criada com sucesso.",PlayerInfo[playerid][Name]);
    }
    else
    {
        ResetPlayerMoneyEx(playerid);
        SetPlayerScore(playerid, dini_Int(FilePath, "Level"));
        PlayerInfo[playerid][Level] = dini_Int(FilePath, "Level");
        PlayerInfo[playerid][WantedLevel] = dini_Int(FilePath, "WantedLevel");
        GivePlayerMoneyEx(playerid,dini_Int(FilePath, "Money"));
        PlayerInfo[playerid][Job] = dini_Int(FilePath, "Job");
        PlayerInfo[playerid][Org] = dini_Int(FilePath, "Org");
        PlayerInfo[playerid][Warnings] = dini_Int(FilePath, "Warnings");
        PlayerInfo[playerid][Banned] = dini_Int(FilePath, "Banned");
        PlayerInfo[playerid][Admin] = dini_Int(FilePath, "Admin");
        PlayerInfo[playerid][VipLevel] = dini_Int(FilePath, "VipLevel");
        PlayerInfo[playerid][Kills] = dini_Int(FilePath, "Kills");
        PlayerInfo[playerid][Deaths] = dini_Int(FilePath, "Deaths");
        PlayerInfo[playerid][BankMoney] = dini_Int(FilePath, "BankMoney");
        PlayerInfo[playerid][GameTime] = dini_Int(FilePath, "GameTime");
        PlayerInfo[playerid][Respect] = dini_Int(FilePath, "Respect");
        PlayerInfo[playerid][Cargo] = dini_Int(FilePath, "Cargo");
        PlayerInfo[playerid][JailTime] = dini_Int(FilePath, "JailTime");
        PlayerInfo[playerid][Jails] = dini_Int(FilePath, "Jails");
        PlayerInfo[playerid][Crims] = dini_Int(FilePath, "Crims");
        PlayerInfo[playerid][SkillMecanico] = dini_Int(FilePath, "SkillMecanico");
        PlayerInfo[playerid][Lider] = dini_Int(FilePath, "Lider");
        PlayerInfo[playerid][Skin] = dini_Int(FilePath, "Skin");
        PlayerInfo[playerid][Cargo] = dini_Int(FilePath, "Cargo");
        PlayerInfo[playerid][NecessaryToUp] = dini_Int(FilePath, "NecessaryToUp");
        PlayerInfo[playerid][SpawnAtHome] = dini_Int(FilePath, "SpawnAtHome");
        PlayerInfo[playerid][Contrato] = dini_Int(FilePath, "Contrato");
        PlayerInfo[playerid][CarandiruTime] = dini_Int(FilePath, "CarandiruTime");
        PlayerInfo[playerid][pMats] = dini_Int(FilePath, "pMats");
        PlayerInfo[playerid][Drogas] = dini_Int(FilePath, "Drogas");
        PlayerInfo[playerid][PenaR] = dini_Int(FilePath, "PenaR");
        PlayerInfo[playerid][MobileNumber] = dini_Int(FilePath, "MobileNumber");
        PlayerInfo[playerid][ToUpSkillMecanico] = dini_Int(FilePath, "ToUpSkillMecanico");
        PlayerInfo[playerid][TraficoDelay] = dini_Int(FilePath, "TraficoDelay");
        PlayerInfo[playerid][Agenda] = dini_Int(FilePath, "Agenda");
        PlayerInfo[playerid][VipId] = dini_Int(FilePath, "VipId");
        PlayerInfo[playerid][VipDays] = dini_Int(FilePath, "VipDays");
        PlayerInfo[playerid][JobTime] = dini_Int(FilePath, "JobTime");
        PlayerInfo[playerid][LNautica] = dini_Int(FilePath, "LNautica");
        PlayerInfo[playerid][LAerea] = dini_Int(FilePath, "LAerea");
        PlayerInfo[playerid][LTerrestre] = dini_Int(FilePath, "LTerrestre");
        PlayerInfo[playerid][PorteDeArmas] = dini_Int(FilePath, "PorteDeArmas");
        PlayerInfo[playerid][Iscas] = dini_Int(FilePath, "Iscas");
        PlayerInfo[playerid][ValorDaPesca] = dini_Int(FilePath, "ValorDaPesca");
        PlayerInfo[playerid][SkinCasual] = dini_Int(FilePath, "SkinCasual");
        PlayerInfo[playerid][Xp] = dini_Int(FilePath, "Xp");
        PlayerInfo[playerid][Doenca] = dini_Int(FilePath, "Doenca");
        PlayerInfo[playerid][HospitalTime] = dini_Int(FilePath, "HospitalTime");
        PlayerInfo[playerid][Vacina] = dini_Int(FilePath, "Vacina");
        PlayerInfo[playerid][Cigarro] = dini_Int(FilePath, "Cigarro");
        PlayerInfo[playerid][Terco] = dini_Int(FilePath, "Terco");
        PlayerInfo[playerid][GalinhaPreta] = dini_Int(FilePath, "GalinhaPreta");
        PlayerInfo[playerid][MacumbaDelay] = dini_Int(FilePath, "MacumbaDelay");
        PlayerInfo[playerid][RezaDelay] = dini_Int(FilePath, "RezaDelay");
        PlayerInfo[playerid][Harpao] = dini_Int(FilePath, "Harpao");
        PlayerInfo[playerid][NoteBook] = dini_Int(FilePath, "NoteBook");
        PlayerInfo[playerid][Mochila] = dini_Int(FilePath, "Mochila");
        PlayerInfo[playerid][Estilo] = dini_Int(FilePath, "Estilo");
        PlayerInfo[playerid][Aplicacao] = dini_Int(FilePath, "Aplicacao");
        Sotaque[playerid] = dini_Int(FilePath, "Sotaque");
        Tutorial[playerid] = dini_Int(FilePath, "Tutorial");
        printf("Conta de %s carregada com sucesso.",PlayerInfo[playerid][Name]);
    }
    return 1;
}
OBS: Ignore o "Nomedopai", "Nomedamae", "Anonascido", "Mesnascido", "Dianascido".
Reply


Messages In This Thread
Problema com Dini. - by iansinho - 07.08.2011, 19:12
Re: Problema com Dini. - by MiTToS - 07.08.2011, 19:14
Re: Problema com Dini. - by iansinho - 07.08.2011, 19:24
Re: Problema com Dini. - by MiTToS - 07.08.2011, 19:30
Re: Problema com Dini. - by Ricop522 - 07.08.2011, 19:31
Re: Problema com Dini. - by MiTToS - 07.08.2011, 19:33
Re: Problema com Dini. - by iansinho - 07.08.2011, 19:36
Re: Problema com Dini. - by Ricop522 - 07.08.2011, 19:43
Re: Problema com Dini. - by iansinho - 07.08.2011, 20:06
Re: Problema com Dini. - by Ricop522 - 07.08.2011, 20:32

Forum Jump:


Users browsing this thread: 3 Guest(s)