• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

CreatureEvent Hunger System - TFS Mod or Manual

Nandonalt

New Member
Joined
Aug 4, 2008
Messages
29
Reaction score
0
Hello, i made this hunger system for my RPG OTServer. It's very simple :p
You can configure the way you want in the lua. The scripts may be a little long because i'm old school and i do not know alot of the actual scripting :mellow:
I also posted this on other forum.

I made it and tested in The Forgotten Server 0.3.6 (8.54).
TFS Mod
As Frankfarmer said, a mod would be better. Then i made the mod :)
Just extract the attached file in yours mods folder. The config is in scripts/hungersystem/config.lua.
The command for checking the hunger % is "/hunger" :)

How to config the interval of adding 1% hunger to all players:
After you extracted, go to yours mods folder and open hungersystem.xml and find this:
Code:
<globalevent name="GiveHunger" interval="2" event="script" value="hungersystem/globalevents.lua"/>
Where is "interval=2" change the "2" to the interval you want(in seconds, Ex: 1 minute -> interval="60"

But you need to do this:
Go to the actions/scripts folder and find a file called food.lua. As i said before, i made this using TFS, so the food system may be different.
After:
Code:
doRemoveItem(item.uid, 1)
Add:
Code:
	------ Put the same storage that you wrote on your config file :)
hunger___storage = 5544
----------- 	setPlayerStorageValue(cid,hunger___storage,getPlayerStorageValue(cid,hunger___storage)-food[1])


-------------
Manual Way

Make a file called "checkhunger.lua" in the folder creaturescripts/scripts, and add this:
Code:
function onThink(cid, interval)
------------------- Hunger System by Nandonalt
----------- Hunger System Config
-- Hunger Storage Value 
hunger_storage = 5544

-- Hunger % that the player will start to say he's hungry (1 - 99).
hunger_scream = 95 

-- Put 0 to player die if hunger is 100%, or 1 to change his hp to 1.
hunger_die = 0

-- Put inside the " " what the player will say if he is hungry.
hunger_say1 = "I'm Hungry!!"

-- Put inside the " " what the player will say when reaches 100% hunger.
hunger_say2 = "<Dying of Starvation>" 

----- Script Below
storage = getPlayerStorageValue(cid,hunger_storage)
if storage < 0 then
setPlayerStorageValue(cid,hunger_storage,0)   
elseif storage > 100 then
setPlayerStorageValue(cid,hunger_storage,100)
elseif storage >= hunger_scream and storage <= 99 then
doCreatureSay(cid,hunger_say1,TALKTYPE_ORANGE_1)
elseif storage >= 100 then
setPlayerStorageValue(cid,hunger_storage,0)
doCreatureSay(cid,hunger_say2,TALKTYPE_ORANGE_1)
health = getCreatureHealth(cid)-hunger_die
doCreatureAddHealth(cid,-health)

end
return 1
end

Now go to your onLogin script and add this inside the function:
Code:
------ Put the same storage as checkhunger.lua
hunger__storage = 5544
----------- 
registerCreatureEvent(cid, "Hunger")
if getPlayerStorageValue(cid,hunger__storage) == -1 then
setPlayerStorageValue(cid,hunger__storage, 0)
else
end

Open the creaturescripts.xml file and add:
Code:
<event type="think" name="Hunger" event="script" value="checkhunger.lua"/>


Now go to the actions/scripts folder and find a file called food.lua. As i said before, i made this using TFS, so the food system may be different.
After:
Code:
doRemoveItem(item.uid, 1)
Add:
Code:
	------ Put the same storage as checkhunger.lua
hunger___storage = 5544
----------- 	setPlayerStorageValue(cid,hunger___storage,getPlayerStorageValue(cid,hunger___storage)-food[1])

We are coming to the end! Go to globalevents/scripts and make a file called givehunger.lua, and add this:
Code:
function onThink(cid, item, fromPosition, toPosition)
------- Hunger System by Nandonalt
--- Put the same storage as checkhunger.lua
hungerstorage = 5544 
-------------

	for _, name in ipairs(getOnlinePlayers()) do
	
		local player = getPlayerByName(name)  	                                            		
        	setPlayerStorageValue(player,hungerstorage,getPlayerStorageValue(player,hungerstorage)+1) 	
	
	end
	return 1
end

And add this to globalevents.xml. INTERVAL is the interval between adding 1% hunger to all players online (in seconds):
Code:
<globalevent name="givehunger" interval="30" event="script" value="givehunger.lua"/>

OPTIONAL: An talkaction that says how much hungry the player is.
Make a file called hunger.lua in talkactions/scripts, add this:
Code:
function onSay(cid, words, param)
------- Hunger System by Nandonalt
---- Change 5544 to the same storage that you wrote on checkhunger.lua
storage = getPlayerStorageValue(cid,5544)

doPlayerSendCancel(cid,"Hunger percent: "..storage.."%.")
return 1
end

And talkactions.xml:
Code:
<talkaction words="/hunger" event="script" value="hunger.lua"/>


You are ready! I have changed this script to put it here(i made it configurable), so if there is any errors please report. And english is not my native language so... yeah.
 

Attachments

  • Hunger System - By Nandonalt.rar
    1.7 KB · Views: 53 · VirusTotal
Last edited:
This is very nice. But is it possible to make it as a MOD instad?

Mods rocks
 
As i said i edited the post to change Crying Damson 6 to 0.3.6, i know it's the same thing.

Added talkaction for checking the Hunger %.

Frank, i will try to make a mod =D

EDITED: Made the mod :D
 
Last edited:
Can you create these systems?

-Diseases
-Dehydratation

?
 
OK:

Diseases:

A disease can be transmitted by any creature, then, when you attack it, you transmit it, it begins to take away life, but druids can cure you of disease. If you touch or talk to a player, this is contagious.

Dehydratation:

The player will have to drink water every 30 minutes. In addition, if exposed to fire or is in battle, may become dehydrated faster.
 
I would love the addition of the dehydration system. After an hour of not drinking anyway water, your character would say "I'm really starting to get thristy"

He would say this in intervals of 30 mintues of thrist, and after 6 hours of being thristy, the character would die of thrist.
 
I have tested this on my server, and there a few problems.

The first problem, and most important, is that even if you eat food, and it says "you are full" when you try to continue to eat food, your hunger still raises. This means, you can still die from being hungry, but, unable to eat food because you are full.

Secondly, when a player dies from hunger, and you relog, it causes a debug. I'll post the debug I get. -edit- I have no idea why, I haven't changed anything, but I am not getting the debug after trying to relog anymore after death due to hunger. -shrugs-

Third, when a player starts to say he is hungry, he spams the "I am hungry!" text rather fast, the intervals for how often the characters says this should be lowered. This isn't really a problem, but rather a preferance.

I tested this on a 8.54 server using TFS 0.3.6, with the hunger ticks (+1% of hunger) set at 2 seconds.

Lengthing the time you get added % of hunger will help resolve the first problem, but it is only a vanity fix, and not an actual fix. You shouldn't get hunger added when you are full from eating food.

All in all, I am really happy with you releasing it, and I like it very much. If people don't eat food, I agree they should die of stravation. I posted the errors I got with it, so to help perfect this script.
 
Last edited:
The "You are full" problem: if i understood correctly, you are saying that when they are full they can't eat food to down the hunger, right? I will update the system soon(So the hunger don't increases if they are full, right?)

And the debug -> my test character died many times, and no debug.

Oh sorry, forgot to add the how to change the interval. Check "
How to config the interval of adding 1% hunger to all players:" on the topic :)
 
Big thanks for idea :) Tommorow i will write my own Hunger System based on TFS food system (getPlayerFood(cid) etc).

#EDIT#
My own hunger system works! :)
 
Last edited:
This script need optymalization, but work's great :), based on standard TFS food system.

PHP:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Hunger System by Kronos" version="1.0" author="Hellboy aka Kronos (idea Nandonalt)" contact="otfans.pl or otland.net" enabled="yes">
	<description>
		This mod adds hunger system to your's server.
	</description>
	<config name="hunger_config"><![CDATA[
		hungryStorageInfo = 3636
		dmgStorageInfo = 3637
		
		hungryTable = {{minFeed = 15, msg = "You will die if you don't eat something.", strCount = 1},
			{minFeed = 90, msg = "You are very hungry.", strCount = 2},
			{minFeed = 200, msg = "You are hungry.", strCount = 3},
			{minFeed = 395, msg = "You can eat something.", strCount = 4},
			{minFeed = 400, msg = "You are full.", strCount = 5}
		}
		
		dmgTime = 5*1000
		dmgAmount = 1
	]]></config>
	
<event type="login" name="HungerLogin" event="script"><![CDATA[
		domodlib('hunger_config')

	function onLogin(cid)
		if getPlayerStorageValue(cid, dmgStorageInfo) > 1 then
			doPlayerFeed(cid, (getPlayerStorageValue(cid, dmgStorageInfo) - getPlayerStorageValue(cid, dmgStorageInfo)%3)/3)
		end
		setPlayerStorageValue(cid, dmgStorageInfo, 0)
		registerCreatureEvent(cid, "HungerDeath")
		registerCreatureEvent(cid, "Hunger")
		feed = getPlayerFood(cid)
		
		for i = 1, table.maxn(hungryTable) do
			TABLE = hungryTable[i]
			if i == 1 then
				if feed <= TABLE.minFeed then
					doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, TABLE.msg)
					setPlayerStorageValue(cid, hungryStorageInfo, TABLE.strCount)
					break
				end
			end

			if i == table.maxn(hungryTable) then
				TABLE2 = hungryTable[i -1]
				if feed > TABLE2.minFeed then
					doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, TABLE.msg)
					setPlayerStorageValue(cid, hungryStorageInfo, TABLE.strCount)
					break
				end
			end
			
			if i ~= 1 then
				TABLE2 = hungryTable[i -1]
				if feed <= TABLE.minFeed and feed > TABLE2.minFeed then
					doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, TABLE.msg)
					setPlayerStorageValue(cid, hungryStorageInfo, TABLE.strCount)
					break
				end
			end
		end
		return true
	end
	]]></event>
	
	
<event type="think" name="Hunger" event="script"><![CDATA[
		domodlib('hunger_config')

	function onThink(cid, interval)
		
		local online = {}
		if table.maxn(getPlayersOnline()) == 0 then
			stopEvent(hungerDmg)
			return true
		end

		for _, name in ipairs(getPlayersOnline()) do
			table.insert(online, name)
		end

		if isInArray(online, cid) == false then
			setPlayerStorageValue(cid, dmgStorageInfo, 0)
			stopEvent(hungerDmg)
			return true
		end

		if getPlayerAccess(cid) > 2 or getCreatureName(cid) == "Account Manager" then
			return true
		end
		if getPlayerFood(cid) > 0 then
			setPlayerStorageValue(cid, dmgStorageInfo, 0)
		end
	
		if getPlayerFood(cid) <= 0 and getPlayerStorageValue(cid, dmgStorageInfo) == 0 then
			addEvent(hungerDmg, dmgTime, cid)
			setPlayerStorageValue(cid, dmgStorageInfo, 1)
			doSendAnimatedText(getCreaturePosition(cid), dmgAmount, TEXTCOLOR_RED)
			doTargetCombatHealth(0, cid, COMBAT_UNDEFINEDDAMAGE, -dmgAmount, -dmgAmount, CONST_ME_NONE)
		end
		return true
	end
	
	function hungerDmg (cid)
		local online = {}
		if table.maxn(getPlayersOnline()) == 0 then
			stopEvent(hungerDmg)
			return true
		end

		for _, name in ipairs(getPlayersOnline()) do
			table.insert(online, name)
		end

		if isInArray(online, cid) == false then
			stopEvent(hungerDmg)
			return true
		end
		if getPlayerAccess(cid) > 2 then
			return true
		end
		
		if getPlayerFood(cid) > 0 or isInArray(online, cid) == false then
			setPlayerStorageValue(cid, dmgStorageInfo, 0)
			return true
		end
		
		doSendAnimatedText(getCreaturePosition(cid), dmgAmount, TEXTCOLOR_RED)
		doTargetCombatHealth(0, cid, COMBAT_UNDEFINEDDAMAGE, -dmgAmount, -dmgAmount, CONST_ME_NONE)
		addEvent(hungerDmg, dmgTime, cid)
		return true
	end
	]]></event>
<event type="death" name="HungerDeath" event="script"><![CDATA[
		domodlib('hunger_config')
		
	function onDeath (cid, corpse, killer)
		feed = getPlayerFood(cid)
		if feed <= (hungryTable[3]).minFeed then
			setPlayerStorageValue(cid, dmgStorageInfo, (hungryTable[3]).minFeed)
		else
			setPlayerStorageValue(cid, dmgStorageInfo, feed)
		end
		return true
	end
	]]></event>


<globalevent name="GiveHunger" interval="2" event="script"><![CDATA[
		domodlib('hunger_config')

	function onThink(interval, lastExecution, thinkInterval)
		local online = {}

		if table.maxn(getPlayersOnline()) == 0 then
			return true
		end

		for _, name in ipairs(getPlayersOnline()) do
			table.insert(online, name)
		end

		if table.maxn(online) == 0 then
			return true
		end

		for a = 1, table.maxn(online) do
			cid = online[a]
			feed = getPlayerFood(cid)
			getStr = getPlayerStorageValue(cid, hungryStorageInfo)

			for i = 1, table.maxn(hungryTable) do
				TABLE = hungryTable[i]
				if i == 1 then
					if feed <= TABLE.minFeed and TABLE.strCount ~= getStr then
						doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, TABLE.msg)
						setPlayerStorageValue(cid, hungryStorageInfo, TABLE.strCount)
						break
					end
				end
			
				if i == table.maxn(hungryTable) then
					TABLE2 = hungryTable[i -1]
					if feed > TABLE2.minFeed and TABLE.strCount ~= getStr then
						doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, TABLE.msg)
						setPlayerStorageValue(cid, hungryStorageInfo, TABLE.strCount)
						break
					end
				end
			
				if i ~= 1 then
					TABLE2 = hungryTable[i -1]
					if feed <= TABLE.minFeed and feed > TABLE2.minFeed and TABLE.strCount ~= getStr then
						doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, TABLE.msg)
						setPlayerStorageValue(cid, hungryStorageInfo, TABLE.strCount)
						break
					end
				end
			end
		end
		return true
	end
	]]></globalevent>

<talkaction words="/hunger" hide="yes" event="script"><![CDATA[
		domodlib('hunger_config')
		
		function onSay(cid, words, param, channel)
			feed = getPlayerFood(cid)
		
			for i = 1, table.maxn(hungryTable) do
				TABLE = hungryTable[i]
				if i == 1 then
					if feed <= TABLE.minFeed then
						doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, TABLE.msg)
						setPlayerStorageValue(cid, hungryStorageInfo, TABLE.strCount)
						break
					end
				end
			
				if i == table.maxn(hungryTable) then
					TABLE2 = hungryTable[i -1]
					if feed > TABLE2.minFeed then
						doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, TABLE.msg)
						setPlayerStorageValue(cid, hungryStorageInfo, TABLE.strCount)
						break
					end
				end
			
				if i ~= 1 then
					TABLE2 = hungryTable[i -1]
					if feed <= TABLE.minFeed and feed > TABLE2.minFeed then
						doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, TABLE.msg)
						setPlayerStorageValue(cid, hungryStorageInfo, TABLE.strCount)
						break
					end
				end
			end
			return true
		end
	]]></talkaction>
	
</mod>

#EDIT#
Up noo problem xS

#EDIT2#
Tested on TFS 0.3.5pl1
 
Last edited:
@up
can you rewrite script and set no aggressive to "doTargetCombatHealth" becoause ppl cannot logout.:p
 
I will try, but i never used this function.

PS: I will post one more fix for my mod (in TFS when you die, your's "feed lvl" is set to 0).
 
#TomCrusher#
I don't know how to solve this problem xS


##
- Fixed problem with dmg to new player's in first login
- Fixed problem with store "feed lvl" after die
- Litle optimalization xS

PHP:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Hunger System by Kronos" version="1.1" author="Hellboy aka Kronos (idea Nandonalt)" contact="otfans.pl or otland.net" enabled="yes">
	<description>
		This mod adds hunger system to your's server.
	</description>
	<config name="hunger_config"><![CDATA[
		hungryStorageInfo = 3636
		dmgStorageInfo = 3637
		
		hungryTable = {{minFeed = 15, msg = "You will die if you don't eat something.", strCount = 1},
			{minFeed = 90, msg = "You are very hungry.", strCount = 2},
			{minFeed = 200, msg = "You are hungry.", strCount = 3},
			{minFeed = 395, msg = "You can eat something.", strCount = 4},
			{minFeed = 400, msg = "You are full.", strCount = 5}
		}
		
		dmgTime = 5*1000
		dmgAmount = 1
	]]></config>
	
<event type="login" name="HungerLogin" event="script"><![CDATA[
		domodlib('hunger_config')

	function onLogin(cid)
		if getPlayerStorageValue(cid, dmgStorageInfo) > 1 then
			doPlayerFeed(cid, (getPlayerStorageValue(cid, dmgStorageInfo) - getPlayerStorageValue(cid, dmgStorageInfo)%3)/3) --- ((hungryTable[3]).minFeed - (hungryTable[3]).minFeed%3)/3
		end
		if getPlayerStorageValue(cid, dmgStorageInfo) == -1 then
			doPlayerFeed(cid, ((hungryTable[3]).minFeed - ((hungryTable[3]).minFeed)%3)/3) --- ((hungryTable[3]).minFeed - (hungryTable[3]).minFeed%3)/3
		end
		
		setPlayerStorageValue(cid, dmgStorageInfo, 0)
		registerCreatureEvent(cid, "HungerDeath")
		registerCreatureEvent(cid, "Hunger")
		feed = getPlayerFood(cid)
		
		for i = 1, table.maxn(hungryTable) do
			TABLE = hungryTable[i]
			if i == 1 then
				if feed <= TABLE.minFeed then
					doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, TABLE.msg)
					setPlayerStorageValue(cid, hungryStorageInfo, TABLE.strCount)
					break
				end
			end

			if i == table.maxn(hungryTable) then
				TABLE2 = hungryTable[i -1]
				if feed > TABLE2.minFeed then
					doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, TABLE.msg)
					setPlayerStorageValue(cid, hungryStorageInfo, TABLE.strCount)
					break
				end
			end
			
			if i ~= 1 then
				TABLE2 = hungryTable[i -1]
				if feed <= TABLE.minFeed and feed > TABLE2.minFeed then
					doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, TABLE.msg)
					setPlayerStorageValue(cid, hungryStorageInfo, TABLE.strCount)
					break
				end
			end
		end
		return true
	end
	]]></event>
	
	
<event type="think" name="Hunger" event="script"><![CDATA[
		domodlib('hunger_config')

	function onThink(cid, interval)
		
		local online = {}
		if table.maxn(getPlayersOnline()) == 0 then
			stopEvent(hungerDmg)
			return true
		end

		for _, name in ipairs(getPlayersOnline()) do
			table.insert(online, name)
		end

		if isInArray(online, cid) == false then
			setPlayerStorageValue(cid, dmgStorageInfo, 0)
			stopEvent(hungerDmg)
			return true
		end

		if getPlayerFood(cid) > 0 then
			setPlayerStorageValue(cid, dmgStorageInfo, 0)
		end

		if getPlayerFood(cid) <= 0 and getPlayerStorageValue(cid, dmgStorageInfo) == 0 then
			hungerDmg(cid)
			setPlayerStorageValue(cid, dmgStorageInfo, 1)
		end
		return true
	end
	
	function hungerDmg (cid)
		local online = {}
		if table.maxn(getPlayersOnline()) == 0 then
			stopEvent(hungerDmg)
			return true
		end

		for _, name in ipairs(getPlayersOnline()) do
			table.insert(online, name)
		end
		
		if getPlayerFood(cid) > 0 or isInArray(online, cid) == false then
			setPlayerStorageValue(cid, dmgStorageInfo, 0)
			stopEvent(hungerDmg)
			return true
		end
		
		if not getPlayerFlagValue(cid, PLAYERFLAG_CANNOTBEATTACKED) then
			doTargetCombatHealth(0, cid, COMBAT_UNDEFINEDDAMAGE, -dmgAmount, -dmgAmount, CONST_ME_NONE)
			doSendAnimatedText(getCreaturePosition(cid), dmgAmount, TEXTCOLOR_RED)
			setPlayerStorageValue(cid, dmgStorageInfo, 1)
			addEvent(hungerDmg, dmgTime, cid)
		end
		return true
	end
	]]></event>
<event type="death" name="HungerDeath" event="script"><![CDATA[
		domodlib('hunger_config')
		
	function onDeath (cid, corpse, killer)	
		feed = getPlayerFood(cid)
		if feed <= (hungryTable[3]).minFeed then
			setPlayerStorageValue(cid, dmgStorageInfo, (hungryTable[3]).minFeed)
		else
			setPlayerStorageValue(cid, dmgStorageInfo, feed)
		end
		return true
	end
	]]></event>


<globalevent name="GiveHunger" interval="2" event="script"><![CDATA[
		domodlib('hunger_config')

	function onThink(interval, lastExecution, thinkInterval)
		local online = {}

		if table.maxn(getPlayersOnline()) == 0 then
			return true
		end

		for _, name in ipairs(getPlayersOnline()) do
			table.insert(online, name)
		end

		if table.maxn(online) == 0 then
			return true
		end

		for a = 1, table.maxn(online) do --- / ipairs
			cid = online[a]
			feed = getPlayerFood(cid)
			getStr = getPlayerStorageValue(cid, hungryStorageInfo)

			for i = 1, table.maxn(hungryTable) do
				TABLE = hungryTable[i]
				if i == 1 then
					if feed <= TABLE.minFeed and TABLE.strCount ~= getStr then
						doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, TABLE.msg)
						setPlayerStorageValue(cid, hungryStorageInfo, TABLE.strCount)
						break
					end
				end
			
				if i == table.maxn(hungryTable) then
					TABLE2 = hungryTable[i -1]
					if feed > TABLE2.minFeed and TABLE.strCount ~= getStr then
						doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, TABLE.msg)
						setPlayerStorageValue(cid, hungryStorageInfo, TABLE.strCount)
						break
					end
				end
			
				if i ~= 1 then
					TABLE2 = hungryTable[i -1]
					if feed <= TABLE.minFeed and feed > TABLE2.minFeed and TABLE.strCount ~= getStr then
						doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, TABLE.msg)
						setPlayerStorageValue(cid, hungryStorageInfo, TABLE.strCount)
						break
					end
				end
			end
		end
		return true
	end
	]]></globalevent>

<talkaction words="/hunger" hide="yes" event="script"><![CDATA[
		domodlib('hunger_config')
		
		function onSay(cid, words, param, channel)
			feed = getPlayerFood(cid)
		
			for i = 1, table.maxn(hungryTable) do
				TABLE = hungryTable[i]
				if i == 1 then
					if feed <= TABLE.minFeed then
						doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, TABLE.msg)
						setPlayerStorageValue(cid, hungryStorageInfo, TABLE.strCount)
						break
					end
				end
			
				if i == table.maxn(hungryTable) then
					TABLE2 = hungryTable[i -1]
					if feed > TABLE2.minFeed then
						doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, TABLE.msg)
						setPlayerStorageValue(cid, hungryStorageInfo, TABLE.strCount)
						break
					end
				end
			
				if i ~= 1 then
					TABLE2 = hungryTable[i -1]
					if feed <= TABLE.minFeed and feed > TABLE2.minFeed then
						doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, TABLE.msg)
						setPlayerStorageValue(cid, hungryStorageInfo, TABLE.strCount)
						break
					end
				end
			end
			return true
		end
	]]></talkaction>
</mod>
 
Last edited:
Back
Top