// Pra carregar os Dados
public OnPlayerSpawn(playerid)
{
if(DOF2_IsSet("LLADMIN/Admins.txt", Nome(playerid)))
{
PlayerDados[playerid][Admin] = DOF2_GetInt("LLADMIN/Admins.txt", Nome(playerid));
}
format(StringContas, sizeof(StringContas), "LLADMIN/Contas/%s.txt", Nome(playerid));
#if SPAWNAR_HQ == 1
if((PlayerDados[playerid][Admin] > 0) || (PlayerDados[playerid][Helper] == true))
{
SetTimerEx("NovoSpawn", 500, false, "i", playerid);
}
#endif
SetTimerEx("VerificarPreso", 1000, false, "i", playerid);
ResetPlayerWeapons(playerid);
#if USAR_SISTEMA_REGISTRO == 0
if(!DOF2_FileExists(StringContas))
{
DOF2_CreateFile(StringContas);
DOF2_SetInt(StringContas, "Matou", 0);
DOF2_SetInt(StringContas, "Morreu", 0);
DOF2_SetInt(StringContas, "Grana", 0);
DOF2_SetInt(StringContas, "Emprego"));
DOF2_SetInt(StringContas,"Skin"));
//DOF2_SetInt(StringContas, "Admin", 0);
//DOF2_SetBool(StringContas, "Helper", false);
DOF2_SetInt(StringContas, "Advertencias", 0);
DOF2_SetInt(StringContas, "Preso", 0);
//DOF2_SetBool(StringContas, "Vip", false);
PlayerDados[playerid][Logado] = true;
}
if(DOF2_FileExists(StringContas))
{
PlayerDados[playerid][Matou] = DOF2_GetInt(StringContas, "Matou");
PlayerDados[playerid][Morreu] = DOF2_GetInt(StringContas, "Morreu");
if(DOF2_IsSet("LLADMIN/Admins.txt", Nome(playerid)))
{
PlayerDados[playerid][Admin] = DOF2_GetInt("LLADMIN/Admins.txt", Nome(playerid));
}
PlayerDados[playerid][Advertencias] = DOF2_GetInt(StringContas, "Advertencias");
GivePlayerMoney(playerid, DOF2_GetInt(StringContas, "Grana"));
PlayerDados[playerid][Preso] = DOF2_GetInt(StringContas, "Preso");
if(DOF2_IsSet("LLADMIN/Helpers.txt", Nome(playerid)))
{
PlayerDados[playerid][Helper] = DOF2_GetBool("LLADMIN/Vips.txt", Nome(playerid));
}
if(DOF2_IsSet("LLADMIN/Vips.txt", Nome(playerid)))
{
PlayerDados[playerid][Vip] = DOF2_GetBool("LLADMIN/Vips.txt", Nome(playerid));
}
//PlayerDados[playerid][Helper] = DOF2_GetBool(StringContas, "Helper");
//PlayerDados[playerid][Vip] = DOF2_GetBool(StringContas, "Vip");
if((PlayerDados[playerid][Admin] > 0) && (PlayerDados[playerid][Logado] == false))
{
PlayerDados[playerid][Logado] = true;
format(String, sizeof(String), "Logado de Admin Nнvel %d", PlayerDados[playerid][Admin]);
SendClientMessage(playerid, AZUL_CLARO, String);
format(String, sizeof(String), "~w~Admin ~g~%s ~y~Online", Nome(playerid));
GameTextForAll(String, 1000, 1);
PlayerDados[playerid][Trabalhando] = true;
SendClientMessage(playerid, AZUL_CLARO, "Vocк estб trabalhando, para jogar use /jogar");
SetPlayerColor(playerid, 0x24E9FFFF);
SetPlayerHealth(playerid, 999999);
}
}
#endif
return 0;
}
// Pra salvar os Dados
stock SalvarDados(playerid)
{
format(StringContas, sizeof(StringContas), "LLADMIN/Contas/%s.txt", Nome(playerid));
DOF2_SetInt(StringContas, "Matou", PlayerDados[playerid][Matou]);
DOF2_SetInt(StringContas, "Morreu", PlayerDados[playerid][Morreu]);
DOF2_SetInt(StringContas, "Grana", GetPlayerMoney(playerid));
DOF2_SetInt(StringContas, "Advertencias", PlayerDados[playerid][Advertencias]);
DOF2_SetInt(StringContas, "Preso", PlayerDados[playerid][Preso]);
DOF2_SetInt(StringContas, "Skin", GetPlayerSkin(playerid));
DOF2_SetInt(StringContas,"Emprego",Emprego[playerid]);
if(PlayerDados[playerid][Vip] == false)
{
if(DOF2_IsSet("LLADMIN/Vips.txt", Nome(playerid)))
{
DOF2_Unset("LLADMIN/Vips.txt", Nome(playerid));
}
}
if(PlayerDados[playerid][Helper] == false)
{
if(DOF2_IsSet("LLADMIN/Helpers.txt", Nome(playerid)))
{
DOF2_Unset("LLADMIN/Helpers.txt", Nome(playerid));
}
}
if(PlayerDados[playerid][Vip] == true)
{
DOF2_SetBool("LLADMIN/Vips.txt", Nome(playerid), true);
}
if(PlayerDados[playerid][Helper] == true)
{
DOF2_SetBool("LLADMIN/Helpers.txt", Nome(playerid), true);
}
if(PlayerDados[playerid][Admin] > 0)
{
DOF2_SetInt("LLADMIN/Admins.txt", Nome(playerid), PlayerDados[playerid][Admin]);
}
DOF2_SaveFile();
return 1;
}
Eu atй faria isso,mas o problema й que o FS original nгo salva Skin e Emprego,isso foram modificaзхes minhas.
|