DjoLe11

Untitled

Jul 27th, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. public OnPlayerUpdate(playerid)
  2. {
  3. new Keys, ud, lr;
  4. GetPlayerKeys(playerid, Keys, ud, lr);
  5. if(CheckCrouch[playerid] == 1)
  6. {
  7. switch(WeaponID[playerid])
  8. {
  9. case 24, 25, 34:
  10. {
  11. if((Keys & KEY_CROUCH) && !((Keys & KEY_FIRE) || (Keys & KEY_HANDBRAKE)) && GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK )
  12. {
  13. if(Ammo[playerid][GetPlayerWeapon(playerid)] > GetPlayerAmmo(playerid))
  14. {
  15. OnPlayerCBug(playerid);
  16. }
  17. }
  18. }
  19. }
  20. }
  21.  
  22. if(!ud && !lr) { NotMoving[playerid] = 2;
  23. }
  24. else { NotMoving[playerid] = 0;
  25. }
  26. {
  27.  
  28. new drunknew;
  29. drunknew = GetPlayerDrunkLevel(playerid);
  30.  
  31. if (drunknew < 100)
  32. {
  33. SetPlayerDrunkLevel(playerid, 2000);
  34. } else
  35. {
  36. if (pDrunkLevelLast[playerid] != drunknew)
  37. {
  38. new wfps = pDrunkLevelLast[playerid] - drunknew;
  39.  
  40. if ((wfps > 0) && (wfps < 200))
  41. pFPS[playerid] = wfps;
  42.  
  43. pDrunkLevelLast[playerid] = drunknew;
  44. }
  45. new Float:hp,Float:arm;
  46. GetPlayerHealth(playerid,hp);
  47. GetPlayerArmour(playerid,arm);
  48.  
  49. if(InDM[playerid] == 0)
  50. {
  51. if(hp <= 99.0) return SetPlayerHealth(playerid, 100.0);
  52. if(arm <= 99.0) return SetPlayerArmour(playerid, 100.0);
  53. }
  54.  
  55. }
  56. return 1;
  57. }
  58. }
Advertisement
Add Comment
Please, Sign In to add comment