04.07.2014, 03:37
Guys, i have a hunger problem here... The hunger bar is keep decreasing but when i go /eat in a restaurant it doesnt increasing... I dont know why... And here's the code of that
Код:
CMD:eat(playerid,params[]) { new idx = GetPlayerVirtualWorld(playerid)-100; if(PlayerInfo[playerid][pHunger] < 100 ) { if(GetPVarInt(playerid, "OverHungry") != 0 || GetPVarType(playerid, "OverHungry")!=0) { KillTimer(GetPVarInt(playerid, "OverHungry")); DeletePVar(playerid, "OverHungry"); } if(GetPVarInt(playerid, "HungerTimer") == 0 || GetPVarType(playerid, "HungerTimer")==0) { new hunger = SetTimerEx("HungerTime", 80*1000, 1, "d", playerid); SetPVarInt(playerid, "HungerTimer", hunger); } if(IsAtFoodStore(playerid)) { if(idx>0 && BizInfo[idx][bProducts] <=0) { SendClientMessageEx(playerid, COLOR_GRAD2, " This business doesnt have products!"); return 1; } if(idx>0 && BizInfo[idx][bProducts] >0) { GivePlayerCash(playerid, -1000); BizInfo[idx][bMoney] += 1000; BizInfo[idx][bProducts] -= 5; BizInfo[idx][bSold] ++; } PlayerInfo[playerid][pHunger]+=200; SendClientMessage(playerid, COLOR_WHITE, "You are eating here!"); } } else { SendClientMessage(playerid, COLOR_BLUE, "Your stomach is full!"); } return 1; }