08.10.2014, 17:25
Hi!. Estava testando oque eu jб aprendi no Pawno criando um sistema basico de fome, mais quando eu fui ver, o DOF2 nгo estava pegando o numero Int do meu .ini, Se alguem poder ajudar eu agradeзo. :/
Simplesmente ele nгo retorna nada, mais salvar, salva.
pawn Код:
//==============================================================================
#include <a_samp>
#include <a_http>
#include <ZCMD>
#include <DOF2>
#include <progress>
//==============================================================================
enum pInfo
{
pFome,
pSalva
}
//==============================================================================
forward ProgressBar(playerid);
//==============================================================================
new Bar:vhealth[MAX_PLAYERS] = {INVALID_BAR_ID, ...};
new name[MAX_PLAYER_NAME+1];
new PlayerInfo[MAX_PLAYERS][pInfo];
new File[200];
//==============================================================================
public OnFilterScriptInit()
{
SetTimer("ProgressBar", 1000, 1);
return 1;
}
public OnPlayerConnect(playerid)
{
GetPlayerName(playerid, name, sizeof(name));
format(File, sizeof(File), "pAdmin/Contas/%s.ini", name);
return Carregar(playerid);
}
public OnPlayerDisconnect(playerid)
{
DOF2_Exit();
return 1;
}
public ProgressBar(playerid)
{
if(PlayerInfo[playerid][pFome] <= 100)
{
SetProgressBarValue(vhealth[playerid], PlayerInfo[playerid][pFome]);
UpdateProgressBar(vhealth[playerid], playerid);
Salvar(playerid);
}
}
public OnPlayerSpawn(playerid)
{
vhealth[playerid] = CreateProgressBar(548.5, 250.0, _, _, 0x00FF00FF, 1000.0);
ShowProgressBarForPlayer(playerid, vhealth[playerid]);
return 1;
}
//==============================================================================
stock Carregar(playerid)
{
PlayerInfo[playerid][pFome] = DOF2_GetInt(File, "pFome");
return 1;
}
stock Salvar(playerid)
{
PlayerInfo[playerid][pSalva] = DOF2_SetInt(File, "pFome", PlayerInfo[playerid][pFome]);
DOF2_SaveFile();
return 1;
}
//==============================================================================
/*CMD:bar(playerid){
if(DOF2_FileExists(File))
{
SendClientMessage(playerid, 0xFFFFFFFF, "Existe.");
}
else
{
SendClientMessage(playerid, 0xFFFFFFFF, "Nгo existe.");
}
SendClientMessage(playerid, -1, File);
SendClientMessage(playerid, -1, PlayerInfo[playerid][pFome]);
return 1;
}*/