AddFoodExhaustion - Printable Version +- Cuberite Forum (https://forum.cuberite.org) +-- Forum: Plugins (https://forum.cuberite.org/forum-1.html) +--- Forum: Plugin Discussion (https://forum.cuberite.org/forum-8.html) +--- Thread: AddFoodExhaustion (/thread-1171.html) |
AddFoodExhaustion - tonibm19 - 07-02-2013 I want to make player's food bar be decreased on moving. I tried with this, but don't work. Code: function OnPlayerMoving(Player) I saw that in Player.cpp is used like this: Code: Player:AddFoodExhaustion(0.3f) RE: AddFoodExhaustion - xoft - 07-03-2013 Haven't yet looked at the actual code behind this, my guess is that the hunger is not sent to the client in the AddFoodExhaustion() function. As for the malformed number, "0.3f" is a c/c++'s way of saying "this number is a single-precision floating-point number, rather than double-precision floating-point number"; in Lua, you need to drop the f: "0.3". |