samp.directory
← Scripts et bibliothèques

Lasho4/samp-hunger

Pas de description sur GitHub.

Bibliothèque★ 3mis à jour oct. 2024Pas de licencePawn
Ouvrir sur GitHub

Ce dépôt n’a pas de fichier de licence. Il est public en lecture, mais cela ne donne pas à lui seul le droit de le réutiliser.

L’essayer dans le compilateur Pawn →

Ajoute ses fichiers include, avec les bibliothèques dont il dépend, au compilateur Pawn de ton navigateur, prêts à être inclus dans un script.

README.md

samp-hunger

This is hunger/thirsty system for a San Andreas Multiplayer

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;
}

hungerpropertiessa-mpsampsamp-hungerthirsty

Cette page est construite à partir de ce que GitHub publie sur le dépôt. samp.directory n’héberge pas le code. Signaler un problème avec cette fiche

Lasho4/samp-hunger : Bibliothèque SA-MP | samp.directory