N1E7R4V

function GiveExp

Jun 14th, 2021
468
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function GiveExp(pid, val)
  2. {
  3. if (pid == null)
  4. {
  5.     //botu ne daem exp
  6. }
  7. else
  8. {
  9.    
  10.     local realtime = date();
  11.     local hours = realtime.hour;
  12.     if(hours >= 10 && hours <= 23)
  13.     {
  14.    
  15.         if(val+getPlayerExp(pid) >= getPlayerNextLvlExp(pid))
  16.         {
  17.         setPlayerLevel(pid, getPlayerLevel(pid)+1);
  18.         setPlayerLp(pid, getPlayerLp(pid)+1);
  19.         setPlayerMaxHealth(pid, getPlayerMaxHealth(pid)+5);
  20.         callClientFunc(pid,"showNotification", " LVL UP ");
  21.         setPlayerNextLvlExp(pid, getPlayerNextLvlExp(pid) + (getPlayerLevel(pid) + 1) * 500)
  22.         GiveExp(pid, val);
  23.         }
  24.         else
  25.         {
  26.             setPlayerExp(pid, val+getPlayerExp(pid))
  27.             callClientFunc(pid,"showNotification", "Опыт +"+val);
  28.         }
  29.     }
  30.     else
  31.     {
  32.         callClientFunc(pid,"showNotification", "Вы не можете получать опыт с 0:00 до 10:00 по МСК");
  33.     }
  34. }
  35. }
RAW Paste Data