Skip to content

Lasho4/samp-hunger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

samp-hunger

This is hunger/thirsty system for a San Andreas Multiplayer

hunger

Usage

#include <hunger.inc>

Callbacks

public OnPlayerHungerLevelUpdate(playerid, oldhungerlevel, newhungerlevel);
public OnPlayerThirstyLevelUpdate(playerid, oldthirstylevel, newthirstylevel);

Examples

public OnPlayerHungerLevelUpdate(playerid, oldhungerlevel, newhungerlevel)
{
	if(IsPlayerHungry(playerid))
	{
	    	// force the player to eat
		new Float:health;
		GetPlayerHealth(playerid, health);
		SetPlayerHealth(playerid, health-3);

		// message
		SendClientMessage(playerid, -1, "You are hungry! Eat some food");
	}
	return 1;
}
public OnPlayerThirstyLevelUpdate(playerid, oldthirstylevel, newthirstylevel)
{
	if(IsPlayerThirsty(playerid))
	{
		// force the player to drink
		new Float:health;
		GetPlayerHealth(playerid, health);
		SetPlayerHealth(playerid, health-3);

		// message
		SendClientMessage(playerid, -1, "You are thirsty! Drink some soda");
	}
	return 1;
}

Releases

No releases published

Packages

No packages published

Languages