hunger.pwn 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /*
  2. /$$ /$$ /$$$$$$ /$$$$$$$ /$$$$$$$
  3. | $$$ | $$ /$$__ $$ | $$__ $$| $$__ $$
  4. | $$$$| $$| $$ \__/ | $$ \ $$| $$ \ $$
  5. | $$ $$ $$| $$ /$$$$ /$$$$$$| $$$$$$$/| $$$$$$$/
  6. | $$ $$$$| $$|_ $$|______/| $$__ $$| $$____/
  7. | $$\ $$$| $$ \ $$ | $$ \ $$| $$
  8. | $$ \ $$| $$$$$$/ | $$ | $$| $$
  9. |__/ \__/ \______/ |__/ |__/|__/
  10. Hunger System
  11. Next Generation Gaming, LLC
  12. (created by Next Generation Gaming Development Team)
  13. * Copyright (c) 2016, Next Generation Gaming, LLC
  14. *
  15. * All rights reserved.
  16. *
  17. * Redistribution and use in source and binary forms, with or without modification,
  18. * are not permitted in any case.
  19. *
  20. *
  21. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  22. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  23. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  24. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  25. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  26. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  27. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  28. * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  29. * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  30. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  31. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  32. */
  33. CMD:togglehunger(playerid, params[])
  34. {
  35. if (PlayerInfo[playerid][pAdmin] > 1)
  36. return 1;
  37. if (_hungerTextVisible[playerid] == 1)
  38. {
  39. PlayerTextDrawHide(playerid, _hungerText[playerid]);
  40. _hungerTextVisible[playerid] = 0;
  41. PlayerInfo[playerid][pToggledChats][6] = 1;
  42. }
  43. else
  44. {
  45. PlayerTextDrawShow(playerid, _hungerText[playerid]);
  46. _hungerTextVisible[playerid] = 1;
  47. PlayerInfo[playerid][pToggledChats][6] = 0;
  48. }
  49. SendClientMessage(playerid, COLOR_WHITE, "You have toggled the hunger meter (it will reset upon next login).");
  50. return 1;
  51. }
  52. CMD:buyhotdog(playerid, params[])
  53. {
  54. if(!IsPlayerInRangeOfPoint(playerid, 10.0, -2450.6028, 161.1246, 35.1210) && !IsPlayerInRangeOfPoint(playerid, 4.0, 2958.0425, -1393.6724, 5.5500) &&
  55. !IsPlayerInRangeOfPoint(playerid, 4.0, 300.4977, 200.2298, 1104.3500) && !IsPlayerInRangeOfPoint(playerid, 4.0, 1973.0710, -1298.6427, 25.0172))
  56. return SendClientMessage(playerid, COLOR_GREY, "You are not at a hot dog stand.");
  57. if(GetPlayerCash(playerid) < 2000) return SendClientMessage(playerid, COLOR_GREY, "You need $2000 to buy a hot dog.");
  58. SendClientMessageEx(playerid, COLOR_GRAD4, "You have purchased a 'Hot Dog' for $2000.");
  59. GivePlayerCash(playerid, -2000);
  60. new Float:health;
  61. if (PlayerInfo[playerid][pFitness] >= 5) {
  62. PlayerInfo[playerid][pFitness] -= 5;
  63. }
  64. else {
  65. PlayerInfo[playerid][pFitness] = 0;
  66. }
  67. GetHealth(playerid, health);
  68. if(health < 100)
  69. {
  70. if(health > 90)
  71. {
  72. SetHealth(playerid, 100);
  73. }
  74. else
  75. {
  76. SetHealth(playerid, health + 10.0);
  77. }
  78. }
  79. return 1;
  80. }