Hunger system for NG:RP edit script - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Hunger system for NG:RP edit script (
/showthread.php?tid=468068)
Hunger system for NG:RP edit script -
DouglasRamirez - 06.10.2013
Hello Guys,
I would to have Hunger system that likes on NG:RP, I use NG:RP script too. So if someone can help me, please reply here
Re: Hunger system for NG:RP edit script -
DanishHaq - 06.10.2013
Ok, so when a player spawns you're going to want to set a timer and forward that player ID, make a function that then decreases the health by X value every X seconds / minutes. That way, it will eventually get to 0 and that player would die, or they would starve and eat food.
Example:
pawn Код:
forward Hunger(playerid);
public Hunger(playerid)
{
SetPlayerHealth(playerid, GetPlayerHealth(playerid) --);
}
public OnPlayerSpawn(playerid)
{
SetTimerEx("Hunger", 120000, true, "i", playerid); // sets the timer of hunger for every 2 minutes, the word true is the repeat value, and we forwaded the playerid
return 1;
}
PS: Untested, just did it from my laptop.
Re: Hunger system for NG:RP edit script -
DouglasRamirez - 06.10.2013
Can I talk you about this on skype? It's very important system and I need guide doing it
Re: Hunger system for NG:RP edit script -
nguyenquynh - 06.10.2013
Blah Blah.....
NG:RP script new version mysql .... contact
b0ykut3.l0ve_f0r3v3r@yahoo.com
Re: Hunger system for NG:RP edit script -
DouglasRamirez - 06.10.2013
k, Give me the script :3
Re: Hunger system for NG:RP edit script -
DouglasRamirez - 08.10.2013
Can someone help me setup this code?
pawn Код:
forward Hunger(playerid);
public Hunger(playerid)
{
SetPlayerHealth(playerid, GetPlayerHealth(playerid) --);
}
public OnPlayerSpawn(playerid)
{
SetTimerEx("Hunger", 120000, true, "i", playerid); // sets the timer of hunger for every 2 minutes, the word true is the repeat value, and we forwaded the playerid
return 1;
}
I mean, I need someone to fix the codes and send it back to me