Keeping Hunger While Changing Job
Is it possible to make the percentage of hunger not replenished when spawning, when changing jobs?
Once again blind shot, not sure if this works, it might cause some issues but give it a try:
DarkRP/gamemode/modules/hungermod/sv_hungermod.lua
comment the first 4 lines out (add --[[ in front of line 1 and a --]] at the end of line 4
Same thing as before, this will be overwritten as soon as you update DarkRP!
Could use the following:
hook.Add("InitPostEntity", "RemoveHMPlayerSpawn", function()
hook.Remove("PlayerSpawn", "HMPlayerSpawn")
end)
Might be worth learning Lua or getting yourself a developer instead of asking here. You won't learn much here.
Thanks, guys.The best.
Can you tell me how to make hunger turn off when no one is playing as a cook?
There should be some addons that could do that:
Just looked into the code it seems to check on every tick whether there's a cook online or not. If you have a huge server with a lot of players this might go into perfomance... Not sure tho, give it a try, but keep it in mind if you ever face lag issues in future.
Thanks, the server is quite big. Well, Ill try to use it. Its cool when there are people like you who help noobs like me :)
That's what the forums are made for, as long as you ask nicely there will usually always be people willing to help!
Best of luck!
I personally check on every job change rather than every tick, since people aren't changing jobs 66 times a second.
You can use this hook OnPlayerChangedTeam and then use the break keyword to stop looping through your players once it finds a cook or something