[Ajuda] Dini para DOF2
#1

Olб.
Eu possuo esse sistema de salvamento de usuбrio em meu servidor em formato dini_..., eu queria por ele para DOF2, pois eu estou achando que com dini_ nгo estб salvando a conta de players, salva 95%.
Porйm 5% nгo sгo salvos...
Alguйm ajuda a passar esse sistema de dini_ para DOF2 ?

pawn Code:
public SalvarUsuario(playerid)
{
    if(Logado[playerid] == true){
    new conta[256], banco[256];
    new Float:x, Float:y, Float:z, Float:a;
    format(conta, sizeof(conta), DIRETORIO, nome(playerid));
    format(banco, sizeof(banco), BANCO, nome(playerid));
    if(SkinComprada[playerid] == true){
    dini_IntSet(conta, "Skin", GetPlayerSkin(playerid));}
    dini_IntSet(conta, "Procurado", GetPlayerWantedLevel(playerid));
    dini_IntSet(conta, "Level", Level[playerid]);
    dini_IntSet(conta, "Experiencia", Experiencia[playerid]);
    dini_IntSet(conta, "Gasolina", Gasolina[playerid]);
    dini_IntSet(conta, "Galao", GalaoCombustivel[playerid]);
    dini_IntSet(conta, "Profissao", Profissao[playerid]);
    dini_IntSet(conta, "Dinheiro", GetPlayerMoneyEx(playerid));
    dini_IntSet(conta, "Terrestre", Habilitacoes[playerid][HAB_TERRESTRE]);
    dini_IntSet(conta, "Aerea", Habilitacoes[playerid][HAB_AEREA]);
    dini_IntSet(conta, "Nautica", Habilitacoes[playerid][HAB_NAUTICA]);
    dini_BoolSet(conta, "Porte", Habilitacoes[playerid][HAB_PORTE]);
    dini_IntSet(conta, "Aulas", Aulas[playerid]);
    dini_IntSet(conta, "Lutas", GetPlayerFightingStyle(playerid));
    GetPlayerFacingAngle(playerid, a);
    GetPlayerPos(playerid, x, y, z);
    dini_FloatSet(conta, "X", x);
    dini_FloatSet(conta, "Y", y);
    dini_FloatSet(conta, "Z", z);
    dini_FloatSet(conta, "A", a);
    dini_BoolSet(conta, "Preso", Preso[playerid]);
    dini_IntSet(conta, "ConvenioMedico", ConvenioMedico[playerid]);
    dini_IntSet(conta, "Interior", GetPlayerInterior(playerid));
    dini_IntSet(conta, "Pescas", QtPescas[playerid]);
    dini_IntSet(conta, "Cacas", QtCacas[playerid]);
    dini_FloatSet(conta, "Interior", GetPlayerInterior(playerid));}
    return 1;
}
Reply
#2

pawn Code:
DOF2_SetInt(conta, "Skin", GetPlayerSkin(playerid)); //dini_IntSet
DOF2_SetBool(conta, "Preso", Preso[playerid]); //dini_BoolSet
DOF2_SetFloat(conta, "x", x); //dini_FloatSet
DOF2_SaveFile(); //Salva o Arquivo
DOF2_Exit(); //Coloque isso na CallBack OnGamemodeExit();
Acho que jб da pra converter sabendo isso...
Reply
#3

pawn Code:
public SalvarUsuario(playerid)
{
    if(Logado[playerid] == true){
    new conta[256], banco[256];
    new Float:x, Float:y, Float:z, Float:a;
    format(conta, sizeof(conta), DIRETORIO, nome(playerid));
    format(banco, sizeof(banco), BANCO, nome(playerid));
    if(SkinComprada[playerid] == true){
    DOF2_SetInt(conta, "Skin", GetPlayerSkin(playerid));}
    DOF2_SetInt(conta, "Procurado", GetPlayerWantedLevel(playerid));
    DOF2_SetInt(conta, "Level", Level[playerid]);
    DOF2_SetInt(conta, "Experiencia", Experiencia[playerid]);
    DOF2_SetInt(conta, "Gasolina", Gasolina[playerid]);
    DOF2_SetInt(conta, "Galao", GalaoCombustivel[playerid]);
    DOF2_SetInt(conta, "Profissao", Profissao[playerid]);
    DOF2_SetInt(conta, "Dinheiro", GetPlayerMoneyEx(playerid));
    DOF2_SetInt(conta, "Terrestre", Habilitacoes[playerid][HAB_TERRESTRE]);
    DOF2_SetInt(conta, "Aerea", Habilitacoes[playerid][HAB_AEREA]);
    DOF2_SetInt(conta, "Nautica", Habilitacoes[playerid][HAB_NAUTICA]);
    DOF2_SetBool(conta, "Porte", Habilitacoes[playerid][HAB_PORTE]);
    DOF2_SetInt(conta, "Aulas", Aulas[playerid]);
    DOF2_SetInt(conta, "Lutas", GetPlayerFightingStyle(playerid));
    GetPlayerFacingAngle(playerid, a);
    GetPlayerPos(playerid, x, y, z);
    DOF2_SetFloat(conta, "X", x);
    DOF2_SetFloat(conta, "Y", y);
    DOF2_SetFloat(conta, "Z", z);
    DOF2_SetFloat(conta, "A", a);
    DOF2_SetBool(conta, "Preso", Preso[playerid]);
    DOF2_SetInt(conta, "ConvenioMedico", ConvenioMedico[playerid]);
    DOF2_SetInt(conta, "Interior", GetPlayerInterior(playerid));
    DOF2_SetInt(conta, "Pescas", QtPescas[playerid]);
    DOF2_SetInt(conta, "Cacas", QtCacas[playerid]);
    DOF2_SetFloat(conta, "Interior", GetPlayerInterior(playerid));
    DOF2_SaveFile();}
    return 1;
}
CTRL + H OWNA!!!
Reply
#4

Quote:
Originally Posted by paulor
View Post
pawn Code:
public SalvarUsuario(playerid)
{
    if(Logado[playerid] == true){
    new conta[256], banco[256];
    new Float:x, Float:y, Float:z, Float:a;
    format(conta, sizeof(conta), DIRETORIO, nome(playerid));
    format(banco, sizeof(banco), BANCO, nome(playerid));
    if(SkinComprada[playerid] == true){
    DOF2_SetInt(conta, "Skin", GetPlayerSkin(playerid));}
    DOF2_SetInt(conta, "Procurado", GetPlayerWantedLevel(playerid));
    DOF2_SetInt(conta, "Level", Level[playerid]);
    DOF2_SetInt(conta, "Experiencia", Experiencia[playerid]);
    DOF2_SetInt(conta, "Gasolina", Gasolina[playerid]);
    DOF2_SetInt(conta, "Galao", GalaoCombustivel[playerid]);
    DOF2_SetInt(conta, "Profissao", Profissao[playerid]);
    DOF2_SetInt(conta, "Dinheiro", GetPlayerMoneyEx(playerid));
    DOF2_SetInt(conta, "Terrestre", Habilitacoes[playerid][HAB_TERRESTRE]);
    DOF2_SetInt(conta, "Aerea", Habilitacoes[playerid][HAB_AEREA]);
    DOF2_SetInt(conta, "Nautica", Habilitacoes[playerid][HAB_NAUTICA]);
    DOF2_SetBool(conta, "Porte", Habilitacoes[playerid][HAB_PORTE]);
    DOF2_SetInt(conta, "Aulas", Aulas[playerid]);
    DOF2_SetInt(conta, "Lutas", GetPlayerFightingStyle(playerid));
    GetPlayerFacingAngle(playerid, a);
    GetPlayerPos(playerid, x, y, z);
    DOF2_SetFloat(conta, "X", x);
    DOF2_SetFloat(conta, "Y", y);
    DOF2_SetFloat(conta, "Z", z);
    DOF2_SetFloat(conta, "A", a);
    DOF2_SetBool(conta, "Preso", Preso[playerid]);
    DOF2_SetInt(conta, "ConvenioMedico", ConvenioMedico[playerid]);
    DOF2_SetInt(conta, "Interior", GetPlayerInterior(playerid));
    DOF2_SetInt(conta, "Pescas", QtPescas[playerid]);
    DOF2_SetInt(conta, "Cacas", QtCacas[playerid]);
    DOF2_SetFloat(conta, "Interior", GetPlayerInterior(playerid));
    DOF2_SaveFile();}
    return 1;
}
CTRL + H OWNA!!!
Quando vou salvar uma vбriavel bool, preciso usar
pawn Code:
DOF2_SetBool
?

LOL.
Reply
#5

Quote:
Originally Posted by @Riichard
View Post
Quando vou salvar uma vбriavel bool, preciso usar
pawn Code:
DOF2_SetBool
?

LOL.
Deveria conhecer as funзхes do DOF2 jб neh!

pawn Code:
native DOF2_SetFile(file[]);
native DOF2_LoadFile();
native DOF2_SaveFile();
native DOF2_ParseFile(file[],extraid,bool:callback=true);
native DOF2_ReparseFile(file[],extraid,bool:callback=true);
native DOF2_WriteFile();
native DOF2_PrintFile(comment[]="");
native DOF2_GetString(file[],key[],tag[]="");
native DOF2_GetStringEx(file[],key[],result[],size,tag[]="");
native Float:DOF2_GetFloat(file[],key[]);
native DOF2_GetInt(file[],key[],tag[]="");
native DOF2_GetHex(file[],key[],tag[]="");
native DOF2_GetBin(file[],key[],tag[]="");
native bool:DOF2_GetBool(file[],key[],tag[]="");
native DOF2_SetString(file[],key[],value[],tag[]="");
native DOF2_SetFloat(file[],key[],Float:value);
native DOF2_SetInt(file[],key[],value,tag[]="");
native DOF2_SetHex(file[],key[],value,tag[]="");
native DOF2_SetBin(file[],key[],value,tag[]="");
native DOF2_SetBool(file[],key[],bool:value,tag[]="");
native DOF2_IsSet(file[],key[],tag[]="");
native DOF2_Unset(file[],key[],tag[]="");
native DOF2_FileExists(file[]);
native DOF2_RemoveFile(file[]);
native DOF2_CreateFile(file[],password[]="");
native DOF2_RenameFile(oldfile[],newfile[]);
native DOF2_RenameKey(file[],oldkey[],newkey[],tag[]="");
native DOF2_CopyFile(filetocopy[],newfile[]);
native DOF2_CheckLogin(file[],password[]);
native DOF2_File(user[]);
native DOF2_ParseInt();
native DOF2_ParseFloat();
native DOF2_ParseBool();
native DOF2_ParseBin();
native DOF2_ParseHex();
native DOF2_SetUTF8(bool:set);
native bool:DOF2_GetUTF8();
native DOF2_GetFile();
native DOF2_MakeBackup(file[]);
native DOF2_RemoveSection (file [], tag []);
native DOF2_SectionExists (file [], tag []);
native DOF2_SortSection (file [], tag [], bool: ignorecase = true, bool: ascending = true);
native DOF2_SortAllSections (file [], bool: ignorecase = true, bool: ascending = true);
native DOF2_SetCaseSensitivity (bool: set);
native DOF2_GetCaseSensitivity ();
Reply
#6

Quote:
Originally Posted by paulor
View Post
Deveria conhecer as funзхes do DOF2 jб neh!

pawn Code:
native DOF2_SetFile(file[]);
native DOF2_LoadFile();
native DOF2_SaveFile();
native DOF2_ParseFile(file[],extraid,bool:callback=true);
native DOF2_ReparseFile(file[],extraid,bool:callback=true);
native DOF2_WriteFile();
native DOF2_PrintFile(comment[]="");
native DOF2_GetString(file[],key[],tag[]="");
native DOF2_GetStringEx(file[],key[],result[],size,tag[]="");
native Float:DOF2_GetFloat(file[],key[]);
native DOF2_GetInt(file[],key[],tag[]="");
native DOF2_GetHex(file[],key[],tag[]="");
native DOF2_GetBin(file[],key[],tag[]="");
native bool:DOF2_GetBool(file[],key[],tag[]="");
native DOF2_SetString(file[],key[],value[],tag[]="");
native DOF2_SetFloat(file[],key[],Float:value);
native DOF2_SetInt(file[],key[],value,tag[]="");
native DOF2_SetHex(file[],key[],value,tag[]="");
native DOF2_SetBin(file[],key[],value,tag[]="");
native DOF2_SetBool(file[],key[],bool:value,tag[]="");
native DOF2_IsSet(file[],key[],tag[]="");
native DOF2_Unset(file[],key[],tag[]="");
native DOF2_FileExists(file[]);
native DOF2_RemoveFile(file[]);
native DOF2_CreateFile(file[],password[]="");
native DOF2_RenameFile(oldfile[],newfile[]);
native DOF2_RenameKey(file[],oldkey[],newkey[],tag[]="");
native DOF2_CopyFile(filetocopy[],newfile[]);
native DOF2_CheckLogin(file[],password[]);
native DOF2_File(user[]);
native DOF2_ParseInt();
native DOF2_ParseFloat();
native DOF2_ParseBool();
native DOF2_ParseBin();
native DOF2_ParseHex();
native DOF2_SetUTF8(bool:set);
native bool:DOF2_GetUTF8();
native DOF2_GetFile();
native DOF2_MakeBackup(file[]);
native DOF2_RemoveSection (file [], tag []);
native DOF2_SectionExists (file [], tag []);
native DOF2_SortSection (file [], tag [], bool: ignorecase = true, bool: ascending = true);
native DOF2_SortAllSections (file [], bool: ignorecase = true, bool: ascending = true);
native DOF2_SetCaseSensitivity (bool: set);
native DOF2_GetCaseSensitivity ();
Conheзo, porйm estб DOF2_SetBool, ainda nгo tinha reparado.
Reply
#7

Salve Isso em um .txt para quando tiver duvida voce ja tenha como converter

pawn Code:
dini_Exists             DOF2_FileExists
dini_Remove             DOF2_RemoveFile
dini_Create             DOF2_CreateFile
dini_Set                DOF2_SetString
dini_Get                DOF2_GetString
dini_IntSet             DOF2_SetInt
dini_Int                DOF2_GetInt
dini_BoolSet            DOF2_SetBool
dini_Bool               DOF2_GetBool
dini_FloatSet           DOF2_SetFloat
dini_Float              DOF2_GetFloat
dini_Unset              DOF2_Unset
dini_Isset              DOF2_IsSet
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)