-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.pwn
43 lines (38 loc) · 1 KB
/
test.pwn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include <a_samp>
main(){}
#define PLAYER_PROPERTIES_DECREARE_TIME 1000
#define PLAYER_THIRSTY_LESS_THAN 45
#define THIRSTY_LEVEL_PER_DECREASE 2
#include <hunger.inc>
public OnPlayerConnect(playerid)
{
SetPlayerHungerLevel(playerid, 100);
SetPlayerThirstyLevel(playerid, 100);
return 1;
}
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;
}