TORETTO28
Компетентный
Привет. Столкнулся с такой проблемой в системе голода.
А именно: Когда сытость ровна 0 игрок не умирает.
Помогите пожалуйста.
А именно: Когда сытость ровна 0 игрок не умирает.
Помогите пожалуйста.
Я так понял что то не так в этих кодах.
PHP:
stock HPCheck()
{
foreach (new i : Player)
{
new Float:health;
GetPlayerHealth(i,health);
PlayerPlaySound(i, 1069, 0.0, 0.0, 0.0);
if(PINFO[i][pSitost] >= 1){ PINFO[i][pSitost] -=1; }
if(PINFO[i][pSitost] == 10 || PINFO[i][pSitost] == 5) { SendMe(i, 0x8FEC4AAA, "Вы проголодались!"); }
if(health <= 10.0 && PINFO[i][pLVL] < 3) { }
else
{
if(PINFO[i][pSitost] <= 0){ SetPlayerHealthAC(i, health - 3.0); }
}
}
return true;
}
PHP:
stock GiveSitost(playerid, amount)
{
SetProgressBarValue(sitosti, PINFO[playerid][pSitost]);
UpdateProgressBar(sitosti, playerid);
PINFO[playerid][pSitost] += amount;
if(PINFO[playerid][pSitost] > 100) { PINFO[playerid][pSitost] = 100;}
SendMes(playerid, 0x99CC00FF, "Уровень голода: {FFFFFF}%i из 100",PINFO[playerid][pSitost]);
return true;
}
