SA-MP Forums Archive
[HELP]Hungry system help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [HELP]Hungry system help (/showthread.php?tid=412306)



[HELP]Hungry system help - Ryder1997 - 01.02.2013

Hi all , just downloaded one script with progress bar called hunger system.Here is link for FS:
https://sampforum.blast.hk/showthread.php?tid=352345

And when i compline it in pawno i got these errors:

C:\Users\Tin\Desktop\hungry.pwn(17) : error 017: undefined symbol "INVALID_BAR_ID"
C:\Users\Tin\Desktop\hungry.pwn(41) : error 017: undefined symbol "GetProgressBarValue"
C:\Users\Tin\Desktop\hungry.pwn(47) : error 017: undefined symbol "GetProgressBarValue"
C:\Users\Tin\Desktop\hungry.pwn(49) : error 017: undefined symbol "SetProgressBarValue"
C:\Users\Tin\Desktop\hungry.pwn(51) : error 017: undefined symbol "GetProgressBarValue"
C:\Users\Tin\Desktop\hungry.pwn(77) : error 017: undefined symbol "SetProgressBarValue"
C:\Users\Tin\Desktop\hungry.pwn(86) : error 017: undefined symbol "UpdateProgressBar"
C:\Users\Tin\Desktop\hungry.pwn(104) : error 017: undefined symbol "GetProgressBarValue"
C:\Users\Tin\Desktop\hungry.pwn(107) : error 017: undefined symbol "GetProgressBarValue"
C:\Users\Tin\Desktop\hungry.pwn(123) : error 017: undefined symbol "CreateProgressBar"
C:\Users\Tin\Desktop\hungry.pwn(123) : warning 213: tag mismatch
C:\Users\Tin\Desktop\hungry.pwn(124) : error 017: undefined symbol "ShowProgressBarForPlayer"
C:\Users\Tin\Desktop\hungry.pwn(126) : error 017: undefined symbol "SetProgressBarValue"
C:\Users\Tin\Desktop\hungry.pwn(132) : error 017: undefined symbol "SetProgressBarValue"
C:\Users\Tin\Desktop\hungry.pwn(146) : error 017: undefined symbol "SetProgressBarValue"
C:\Users\Tin\Desktop\hungry.pwn(153) : error 017: undefined symbol "SetProgressBarValue"
C:\Users\Tin\Desktop\hungry.pwn(160) : error 017: undefined symbol "SetProgressBarValue"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


16 Errors.



Here is code:

pawn Код:
// Hungry System By RipLagger
// Full Credited To Include Maker

#define FILTERSCRIPT

#include <a_samp>
#include <ProgressBar>
#include <dini>
#include <zcmd>

#if defined FILTERSCRIPT

#define COLOR_BLUE              0x0000BBAA
#define COLOR_LIGHTBLUE         0x33CCFFAA

new Text:Hungry;
new Bar:hungry[MAX_PLAYERS] = {INVALID_BAR_ID, ...};
forward ProgressBar();
forward update();

enum PlayerStats
{
    Hunger
};
new PInfo[MAX_PLAYERS][PlayerStats];


public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Loading Hungry System By RipLagger");
    print("--------------------------------------\n");
    SetTimer("ProgressBar", 180000, 1);
    SetTimer("update", 5000, 1);
   
    for(new playerid; playerid < MAX_PLAYERS; playerid++)
    {
        new Float:health;
        GetPlayerHealth(playerid, health);
        new HungryTime = SetPlayerHealth(playerid, health-5);
        if(GetProgressBarValue(hungry[playerid]) <= 0)
        {
            SetTimer("HungryTime", 30000, 1);
            SendClientMessage(playerid, COLOR_BLUE, "You Are Hungry Now, Go To The Restaurant To Eat Some Food");
            SendClientMessage(playerid, COLOR_BLUE, "If You're Not Going To Eat, You Will Lose Your Health Every 30 Seconds");
        }
        if(GetProgressBarValue(hungry[playerid]) <= 0)
        {
            SetProgressBarValue(hungry[playerid], 0);
        }
        if(GetProgressBarValue(hungry[playerid]) > 0)
        {
            KillTimer(HungryTime);
        }
    }

    Hungry = TextDrawCreate(538, 114, "Hunger");
    TextDrawColor(Hungry, 0xFFFF00AA);
    TextDrawBackgroundColor(Hungry, -1);
    TextDrawLetterSize(Hungry, 0.46, 1);
    TextDrawSetOutline(Hungry, 1);
    TextDrawSetProportional(Hungry, 0);
    TextDrawSetShadow(Hungry, 2);
    TextDrawUseBox(Hungry, 0);

    print("\n--------------------------------------");
    print(" Loaded Hungry System By RipLagger|Warning dont remove any credits");
    print("--------------------------------------\n");

    return 1;
}

public ProgressBar()
{
    for(new playerid; playerid < MAX_PLAYERS; playerid++)
    {
        SetProgressBarValue(hungry[playerid], GetProgressBarValue(hungry[playerid])-2);
    }
    return 1;
}

public update()
{
    for(new playerid; playerid < MAX_PLAYERS; playerid++)
    {
        UpdateProgressBar(hungry[playerid], playerid);
    }
    return 1;
}

#endif

public OnPlayerConnect(playerid)
{
    PInfo[playerid][Hunger] = 100;
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    new file[256],n[MAX_PLAYER_NAME];
    GetPlayerName(playerid,n,MAX_PLAYER_NAME);
    format(file,sizeof(file),"Stats/%s.txt",n);
    PInfo[playerid][Hunger] = floatround(GetProgressBarValue(hungry[playerid]));
    if(dini_Exists(file))
    {
        dini_IntSet(file,"Hunger",floatround(GetProgressBarValue(hungry[playerid])));
        return 1;
    }
    return 1;
}

public OnPlayerSpawn(playerid)
{
    new file[256],n[MAX_PLAYER_NAME];
    GetPlayerName(playerid,n,MAX_PLAYER_NAME);
    format(file,sizeof(file),"Stats/%s.txt",n);
    if(!dini_Exists(file))
    {
        dini_Create(file);
        dini_IntSet(file,"Hunger",100);
    }
    hungry[playerid] = CreateProgressBar(528.00, 115.00, 76.50, 8.50, 0x0000BBAA, 100.0);
    ShowProgressBarForPlayer(playerid, hungry[playerid]);
    TextDrawShowForPlayer(playerid, Hungry);
    SetProgressBarValue(hungry[playerid], dini_Int(file,"Hunger"));
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    SetProgressBarValue(hungry[playerid], 100);
    return 1;
}

CMD:eat(playerid,params[])
{
    new Float:health;
    GetPlayerHealth(playerid,health);
    if(health < 100 )
    {
        if(IsPlayerInRangeOfPoint(playerid, 20, 366.0248, -73.3478, 1001.5078))
        {
            GivePlayerMoney(playerid, -50);
            SetPlayerHealth(playerid,health+6);
            SetProgressBarValue(hungry[playerid], GetProgressBarValue(hungry[playerid])+15);
            return SendClientMessage(playerid, COLOR_BLUE, "Thanks For Buying Burger Enjoy The Food");
        }
        if(IsPlayerInRangeOfPoint(playerid, 50, 372.3520, -131.6510, 1001.4922))
        {
            GivePlayerMoney(playerid, -70);
            SetPlayerHealth(playerid,health+15);
            SetProgressBarValue(hungry[playerid], GetProgressBarValue(hungry[playerid])+25);
            return SendClientMessage(playerid, COLOR_BLUE, "Thanks For Buying Pizza Enjoy The Food");
        }
        if(!IsPlayerInRangeOfPoint(playerid, 50, 365.7158, -9.8873, 1001.8516))
        {
            GivePlayerMoney(playerid, -35);
            SetPlayerHealth(playerid,health+4);
            SetProgressBarValue(hungry[playerid], GetProgressBarValue(hungry[playerid])+12);
            return SendClientMessage(playerid, COLOR_BLUE, "Thanks For Buying Fried Chicken Enjoy The Food");
        }
    }
    else
    {
        return SendClientMessage(playerid, COLOR_BLUE, "Your hp is full.");
    }
    return 1;
}
















So can anybody help me?
Thanks


Re: [HELP]Hungry system help - kiss - 01.02.2013

Before anyone even tries to help you, but your code in pawn tags. Just like the code BBcode, but instead of writing code, use pawn.

[ pawn ] [ / pawn ] - without the spaces


Re: [HELP]Hungry system help - kiss - 01.02.2013

Quote:
Originally Posted by kiss
Посмотреть сообщение
Before anyone even tries to help you, but your code in pawn tags. Just like the code BBcode, but instead of writing code, use pawn.

[ pawn ] [ / pawn ] - without the spaces
EDIT:

Does you have ProgressBar.inc in your pawno/include folder? If not, then add it and compile it again!


Re: [HELP]Hungry system help - Ryder1997 - 01.02.2013

Yes and still got same errors


Re: [HELP]Hungry system help - DiegoRider - 29.09.2013

Probelm is : " #include <ProgressBar> " , you have include ?