08.10.2014, 20:31
Ficou assim:
Tentei de vбrias formas mais nгo retorna nada :/ fiz em outros Filterscripts mais tambйm nгo retorna nada...
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)
{
Carregar(playerid);
return Carregar(playerid);
}
public OnPlayerSpawn(playerid)
{
vhealth[playerid] = CreateProgressBar(548.5, 250.0, _, _, 0x00FF00FF, 1000.0);
ShowProgressBarForPlayer(playerid, vhealth[playerid]);
return 1;
}
public ProgressBar(playerid)
{
if(PlayerInfo[playerid][pFome] <= 100)
{
SetProgressBarValue(vhealth[playerid], PlayerInfo[playerid][pFome]);
UpdateProgressBar(vhealth[playerid], playerid);
Salvar(playerid);
}
}
public OnPlayerDisconnect(playerid)
{
DOF2_Exit();
return 1;
}
//==============================================================================
Nome(id)
{
//new nick[25];
GetPlayerName(id, name, sizeof(name));
return name;
}
GetFile(id)
{
new fileplayer[45];
format(File, sizeof(File), "pAdmin/Contas/%s.ini", Nome(id));
return fileplayer;
}
stock Carregar(playerid)
{
PlayerInfo[playerid][pFome] = DOF2_GetInt(GetFile(playerid), "pFome");
return 1;
}
stock Salvar(playerid)
{
PlayerInfo[playerid][pSalva] = DOF2_SetInt(GetFile(playerid), "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.");
}
format(File, sizeof(File), "pAdmin/Contas/%s.ini", name);
SendClientMessage(playerid, -1, File);
SendClientMessage(playerid, -1, PlayerInfo[playerid][pFome]);
return 1;
}