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;
}
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();
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;
}
pawn Code:
|
DOF2_SetBool
Quando vou salvar uma vбriavel bool, preciso usar
pawn Code:
LOL. |
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 ();
Deveria conhecer as funзхes do DOF2 jб neh!
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