Advertisement
N1E7R4V

function StaminaRegen()

May 15th, 2021
1,138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.56 KB | None | 0 0
  1. function StaminaRegen()
  2.     for i = 0, MAX_PLAYERS - 1 do
  3.         --if IsPlayerConnected(i) == 1 then
  4.         if  Player[i].logged  == 1 then
  5.             if Player[i].Stamina < 100 then
  6.                 Player[i].Stamina = Player[i].Stamina + 5
  7.                 local res = mysql_query ( handler, "UPDATE `account` SET `stamina` = "..Player[i].Stamina.." WHERE `nick` = '"..Player[i].nick.."'");
  8.                 mysql_free_result(res);
  9.             end
  10.            
  11.             local hp = GetPlayerHealth(i)/GetPlayerMaxHealth(i)*100;
  12.             if hp > 80 and hp < 100 then
  13.                 SetPlayerHealth(i, GetPlayerHealth(i) + 1);
  14.             end
  15.            
  16.            
  17.         end
  18.     end
  19. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement