[Ajuda] DOF2 Nгo pega Numero(int)
#5

Ficou assim:
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;
}
Tentei de vбrias formas mais nгo retorna nada :/ fiz em outros Filterscripts mais tambйm nгo retorna nada...
Reply


Messages In This Thread
DOF2 Nгo pega Numero(int) - by CLANdok - 08.10.2014, 17:25
Re: DOF2 Nгo pega Numero(int) - by MultiKill - 08.10.2014, 19:39
Re: DOF2 Nгo pega Numero(int) - by CLANdok - 08.10.2014, 19:43
Re: DOF2 Nгo pega Numero(int) - by MultiKill - 08.10.2014, 19:53
Re: DOF2 Nгo pega Numero(int) - by CLANdok - 08.10.2014, 20:31
Re: DOF2 Nгo pega Numero(int) - by MultiKill - 08.10.2014, 20:34
Re: DOF2 Nгo pega Numero(int) - by CLANdok - 08.10.2014, 21:04
Re: DOF2 Nгo pega Numero(int) - by MultiKill - 08.10.2014, 21:14
Re: DOF2 Nгo pega Numero(int) - by CLANdok - 08.10.2014, 21:35
Re: DOF2 Nгo pega Numero(int) - by MultiKill - 08.10.2014, 21:38

Forum Jump:


Users browsing this thread: 1 Guest(s)