Advertisement
Guest User

Untitled

a guest
Jun 28th, 2012
25
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. function getHungry(%cl)
  2. {
  3. if(%cl.hunger > 100)
  4. {
  5. %cl.hunger = 100;
  6. }
  7. if(%cl.hunger < 1)
  8. {
  9. schedule(0, 0, starvePlayer, %cl.player);
  10. }
  11. if(%cl.hunger > 0)
  12. {
  13. %cl.hunger -= 1;
  14. }
  15. schedule(60000, 0, getHungry, %cl);
  16. }
  17.  
  18. function doHUD(%cl)
  19. {
  20. %cl.bottomPrint("Hunger: " @ %cl.hunger);
  21. schedule(1000, 0, doHUD, %cl);
  22. }
  23.  
  24. function starvePlayer(%player)
  25. {
  26. %player.addHealth(-5);
  27. }
  28.  
  29. function serverCMDfood(%cl)
  30. {
  31. %cl.centerPrint("You have " @ %cl.food @ " food.",3);
  32. }
  33.  
  34. package Hungry
  35. {
  36. function GameConnection::spawnPlayer(%cl)
  37. {
  38. parent::spawnPlayer(%cl);
  39.  
  40. %cl.hunger = 100;
  41. %cl.food = 0;
  42. schedule(0, 0, getHungry, %cl);
  43. schedule(0, 0, doHUD, %cl);
  44. %cl.centerPrint("Welcome to Brickybob's Zombie Mod! You start off with full hunger and must find food!",3);
  45. }
  46. };
  47. activatePackage(Hungry);
  48.  
  49. function serverCMDeatfood(%cl)
  50. {
  51. if(%cl.food > 0)
  52. {
  53. %cl.food -= 1;
  54. %cl.hunger += 25;
  55. %cl.centerPrint("You eat the food.",3);
  56. }
  57. else
  58. {
  59. %cl.centerPrint("You don't have any food to eat!",3);
  60. }
  61. }
  62.  
  63. package deathBan
  64. {
  65. function GameConnection::onDeath(%cl)
  66. {
  67. if(%cl.isAdmin || %cl.isSuperAdmin)
  68. {
  69. //remove this after testing
  70. //banBLID(blid, time, reason);
  71. return parent::onDeath(%cl);
  72. }
  73. else { banBLID(%cl.bl_id, 5, "You have been lost to the zone."); }
  74. }
  75. };
  76. activatePackage(deathBan);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement