Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getHungry(%cl)
- {
- if(%cl.hunger > 100)
- {
- %cl.hunger = 100;
- }
- if(%cl.hunger < 1)
- {
- schedule(0, 0, starvePlayer, %cl.player);
- }
- if(%cl.hunger > 0)
- {
- %cl.hunger -= 1;
- }
- schedule(60000, 0, getHungry, %cl);
- }
- function doHUD(%cl)
- {
- %cl.bottomPrint("Hunger: " @ %cl.hunger);
- schedule(1000, 0, doHUD, %cl);
- }
- function starvePlayer(%player)
- {
- %player.addHealth(-5);
- }
- function serverCMDfood(%cl)
- {
- %cl.centerPrint("You have " @ %cl.food @ " food.",3);
- }
- package Hungry
- {
- function GameConnection::spawnPlayer(%cl)
- {
- parent::spawnPlayer(%cl);
- %cl.hunger = 100;
- %cl.food = 0;
- schedule(0, 0, getHungry, %cl);
- schedule(0, 0, doHUD, %cl);
- %cl.centerPrint("Welcome to Brickybob's Zombie Mod! You start off with full hunger and must find food!",3);
- }
- };
- activatePackage(Hungry);
- function serverCMDeatfood(%cl)
- {
- if(%cl.food > 0)
- {
- %cl.food -= 1;
- %cl.hunger += 25;
- %cl.centerPrint("You eat the food.",3);
- }
- else
- {
- %cl.centerPrint("You don't have any food to eat!",3);
- }
- }
- package deathBan
- {
- function GameConnection::onDeath(%cl)
- {
- if(%cl.isAdmin || %cl.isSuperAdmin)
- {
- //remove this after testing
- //banBLID(blid, time, reason);
- return parent::onDeath(%cl);
- }
- else { banBLID(%cl.bl_id, 5, "You have been lost to the zone."); }
- }
- };
- activatePackage(deathBan);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement