07.06.2013, 13:01
Try.
pawn Код:
forward HungryLost();
public HungryLost() // Must be a public.
{
for(new i; i<MAX_PLAYERS; i++) // Loop for all players
{
new TDstring[150];
format(TDstring, sizeof(TDstring), "Hunger: %d %", PlayerInfo[i][pHunger]);
new Float:Health;
GetPlayerHealth(i, Health);
if(!aDuty[i] && !mDuty[i])
{
if(PlayerInfo[i][pHunger] >= 1)
{
PlayerInfo[i][pHunger] --;
TextDrawSetString(PlayerInfo[i][pHunger], TDstring);
}
else
{
SetPlayerHealth(i,Health-5);
PlayerInfo[i][pHungry] = 1;
PlayerInfo[i][pHunger] = 0;
TextDrawSetString(PlayerInfo[i][pHunger], TDstring);
}
}
}
return 1;
}