03.06.2013, 19:26
Hello, I got a hunger & thirst system on my server. And when there is more players online, the hunger & thirst goes up faster than it should.
Here is the forward/new codes:
OnPlayerSpawn:
OnPlayerDeath:
Public:
I cant figure out whats wrong, I have been looking for a while and still cant find what is wrong.
EDIT: Progress bar dont update all the time either when you eat
Here is the forward/new codes:
Код:
ew Bar:Hunger[MAX_PLAYERS] = {INVALID_BAR_ID, ...};
new Bar:Thirst[MAX_PLAYERS] = {INVALID_BAR_ID, ...};
new Hungry[MAX_PLAYERS];
new Thirsty[MAX_PLAYERS];
forward hunger(playerid);
forward thirsty(playerid);
//forward ProgressBar();
new hungertimer[MAX_PLAYERS];
new thirsttimer[MAX_PLAYERS];
new GetUp[MAX_PLAYERS];
forward getuptimer(playerid);
Код:
hungertimer[playerid] = SetTimerEx("hunger", 1200000, true, "i", playerid);
thirsttimer[playerid] = SetTimerEx("thirsty", 1200000, true, "i", playerid);
Код:
KillTimer(hungertimer[playerid]);
KillTimer(thirsttimer[playerid]);
DestroyProgressBar(Hunger[playerid]);
DestroyProgressBar(Thirst[playerid]);
Код:
public hunger(playerid)
{
Hungry[playerid] = Hungry[playerid] += 1;
//hungertimer[playerid] = SetTimerEx("hunger", 1200000, false, "i", playerid);
return 1;
}
public thirsty(playerid)
{
Thirsty[playerid] = Thirsty[playerid] += 1;
//thirsttimer[playerid] = SetTimerEx("thirsty", 1200000, false, "i", playerid);
return 1;
}
EDIT: Progress bar dont update all the time either when you eat


