• Adding items to F4 store if noone is on job
    6 replies, posted
Sooo, I want to make system if noone plays cook job it will at food to F4 store. How do I make it check job online? Like [CODE] if Team("TEAM_COOK") == 0 then AddShipment() [/CODE]
what you are checking there will never be true. Because what you are checking makes no sense. You ask lua to check if the team TEAM_COOK is the number 0...which it never is. because its not a number. you could check this addon out https://steamcommunity.com/sharedfiles/filedetails/?id=431903148&searchtext=no+hunger+when+no+cook
You could use customCheck on the F4 entity to stop people from being able to buy the item if cooks are online. Docs: https://wiki.darkrp.com/index.php/DarkRP:CustomEntityFields customCheck = function()     if team.NumPlayers(TEAM_COOK) > 0 then         return false     else         return true     end end
Do I need to add this under entity I want to sell?
You would add it to the entity config where ever you define the food items within darkrp.
So it should be like this? DarkRP.createEntity("Cheese pizza", {     ent = "food_cheesepizza",     model = "models/cheesepizza01/cheesepizza01.mdl",     price = 100,     max = 2,     cmd = "buycpizza" customCheck = function()  if team.NumPlayers(TEAM_COOK) > 0 then  return false  else  return true  end end })
seems like a good idea, I gotta steal that no cook no hunger thing.
Sorry, you need to Log In to post a reply to this thread.