PHP код:
stock SalvarDadosPlayer(playerid)
{
static Float:PosX, Float:PosY, Float:PosZ, Float:Vida, Float:Colete;
GetPlayerHealth(playerid, Vida);
GetPlayerArmour(playerid, Colete);
GetPlayerPos(playerid, PosX, PosY, PosZ);
format(arquivo, sizeof(arquivo), ContasPlayers, getName(playerid));
if(!DOF2_FileExist(arquivo)) return 0x1;
DOF2_SetInt(arquivo, "Dinheiro", GetPlayerMoney(playerid));
DOF2_SetInt(arquivo, "Level", GetPlayerScore(playerid));
DOF2_SetInt(arquivo, "Exp",PlayerInfo[playerid][Exp]);
DOF2_SetInt(arquivo, "LevelProcurado", GetPlayerWantedLevel(playerid));
DOF2_SetInt(arquivo, "Algemado",PlayerInfo[playerid][Algemado]);
DOF2_SetInt(arquivo, "Skin", GetPlayerSkin(playerid));
DOF2_SetFloat(arquivo, "Vida", Vida);
DOF2_SetFloat(arquivo, "Colete", Colete);
DOF2_SetFloat(arquivo, "PosX", PosX);
DOF2_SetFloat(arquivo, "PosY", PosY);
DOF2_SetFloat(arquivo, "PosZ", PosZ);
DOF2_SetInt(arquivo, "Interior", GetPlayerInterior(playerid));
DOF2_SetInt(arquivo, "VirtualWorld", GetPlayerVirtualWorld(playerid));
DOF2_SetInt(arquivo, "TemConta", PlayerInfo[playerid][TemConta]);
DOF2_SetInt(arquivo, "Saldo", PlayerInfo[playerid][Saldo]);
DOF2_SetInt(arquivo, "Admin", PlayerInfo[playerid][Admin]);
DOF2_SetInt(arquivo, "Profissao",PlayerProf[playerid]);
DOF2_SetInt(arquivo, "Gasolina",Gasolina[playerid]);
DOF2_SetInt(arquivo, "Morreu", Morreu[playerid]);
DOF2_SetInt(arquivo, "Matou", Matou[playerid]);
DOF2_SetInt(arquivo, "Convenio", PlayerInfo[playerid][Convenio]);
DOF2_SetInt(arquivo, "Plano", PlayerInfo[playerid][Plano]);
DOF2_SaveFile();
return 0x1;
}
stock CarregarDadosPlayer(playerid)
{
format(arquivo, sizeof(arquivo), ContasPlayers, getName(playerid));
if(!DOF2_FileExist(arquivo)) return 0x1;
GivePlayerMoney(playerid, DOF2_GetInt(arquivo, "Dinheiro"));
SetPlayerScore(playerid, DOF2_GetInt(arquivo, "Level"));
SetPlayerSkin(playerid, DOF2_GetInt(arquivo, "SkinAtual"));
SetPlayerWantedLevel(playerid, DOF2_GetInt(arquivo, "LevelProcurado"));
Morreu[playerid] = DOF2_GetInt(arquivo, "Morreu");
Matou[playerid] = DOF2_GetInt(arquivo, "Matou");
PlayerInfo[playerid][Admin] = DOF2_GetInt(arquivo, "Admin");
PlayerInfo[playerid][TemConta] = DOF2_GetInt(arquivo, "TemConta");
PlayerInfo[playerid][Saldo] = DOF2_GetInt(arquivo, "Saldo");
PlayerInfo[playerid][Level] = DOF2_GetInt(arquivo, "Level");
PlayerInfo[playerid][Dinheiro] = DOF2_GetInt(arquivo, "Dinheiro");
PlayerProf[playerid] = DOF2_GetInt(arquivo, "Profissao");
PlayerInfo[playerid][Exp] = DOF2_GetInt(arquivo, "Exp");
Gasolina[playerid] = DOF2_GetInt(arquivo, "Gasolina");
PlayerInfo[playerid][Algemado] = DOF2_GetInt(arquivo, "Algemado");
PlayerInfo[playerid][Plano] = DOF2_GetInt(arquivo, "Plano");
PlayerInfo[playerid][Convenio] = DOF2_GetInt(arquivo, "Convenio");
return 0x1;
}