Dio skripte:
// Hungry System By RipLagger
// Full Credited To Include Maker
#define FILTERSCRIPT
#include
#include
#include
#include
#if defined FILTERSCRIPT
#define COLOR_BLUE 0x0000BBAA
#define COLOR_LIGHTBLUE 0x33CCFFAA
new Text:Hungry;
new Bar:hungry = {INVALID_BAR_ID, ...};
forward ProgressBar();
forward update();
enum PlayerStats
{
Hunger
};
new PInfo;
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) <= 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) <= 0)
{
SetProgressBarValue(hungry, 0);
}
if(GetProgressBarValue(hungry) > 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, GetProgressBarValue(hungry)-2);
}
return 1;
}
public update()
{
for(new playerid; playerid < MAX_PLAYERS; playerid++)
{
UpdateProgressBar(hungry, playerid);
}
return 1;
}
#endif
public OnPlayerConnect(playerid)
{
PInfo = 100;
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
new file,n;
GetPlayerName(playerid,n,MAX_PLAYER_NAME);
format(file,sizeof(file),"Stats/%s.txt",n);
PInfo = floatround(GetProgressBarValue(hungry));
if(dini_Exists(file))
{
dini_IntSet(file,"Hunger",floatround(GetProgressBarValue(hungry)));
return 1;
}
return 1;
}
public OnPlayerSpawn(playerid)
{
new file,n;
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 = CreateProgressBar(528.00, 115.00, 76.50, 8.50, 0x0000BBAA, 100.0);
ShowProgressBarForPlayer(playerid, hungry);
TextDrawShowForPlayer(playerid, Hungry);
SetProgressBarValue(hungry, dini_Int(file,"Hunger"));
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
SetProgressBarValue(hungry, 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, GetProgressBarValue(hungry)+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, GetProgressBarValue(hungry)+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, GetProgressBarValue(hungry)+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;
}Detaljni opis problema😄akle treba mi pomoc kako da stavim kada ovaj helth spadne na 0 da se svakih 30 sekundi pocne trosit igracu health mislim ovo je novi bar u helthu i on je 100 i kada on spadne na 0 da mu se pocne trosit pravi health svakih 30 sekundi
Slike/video://
