- Initiateur de la discussion
Lorenzo86
Geek suprême
- Messages
- 322
- Score réaction
- 8
- Points
- 115
Je ne vois pas la nourriture dans le F4 Menu
--[[---------------------------------------------------------------------------
DarkRP custom food
---------------------------------------------------------------------------
This file contains your custom food.
This file should also contain food from DarkRP that you edited.
THIS WILL ONLY LOAD IF HUNGERMOD IS ENABLED IN darkrp_config/disabled_defaults.lua.
IT IS DISABLED BY DEFAULT.
Note: If you want to edit a default DarkRP food, first disable it in darkrp_config/disabled_defaults.lua
Once you've done that, copy and paste the food item to this file and edit it.
The default food can be found here:
https://github.com/FPtje/DarkRP/blob/master/gamemode/modules/hungermod/sh_init.lua#L33
Add food under the following line:
---------------------------------------------------------------------------]]
local checkModel = function(model) return model ~= nil and (CLIENT or util.IsValidModel(model)) end
local validFood = {"name", model = checkModel, "energy", "price"}
FoodItems = {}
function DarkRP.createFood(name, mdl, energy, price)
local foodItem = istable(mdl) and mdl or {model = mdl, energy = energy, price = price}
foodItem.name = name
if DarkRP.DARKRP_LOADING and DarkRP.disabledDefaults["food"][name] then return end
for k,v in pairs(validFood) do
local isFunction = isfunction(v)
if (isFunction and not v(foodItem[k])) or (not isFunction and foodItem[v] == nil) then
ErrorNoHalt("Corrupt food \"" .. (name or "") .. "\": element " .. (isFunction and k or v) .. " is corrupt.\n")
end
end
table.insert(FoodItems, foodItem)
end
AddFoodItem = DarkRP.createFood
local plyMeta = FindMetaTable("Player")
plyMeta.isCook = fn.Compose{fn.Curry(fn.GetValue, 2)("cook"), plyMeta.getJobTable}
--[[
Valid members:
model = string, -- the model of the food item
energy = int, -- how much energy it restores
price = int, -- the price of the food
requiresCook = boolean, -- whether only cooks can buy this food
customCheck = function(ply) return boolean end, -- customCheck on purchase function
customCheckMessage = string -- message to people who cannot buy it because of the customCheck
]]
DarkRP.DARKRP_LOADING = true
DarkRP.registerDarkRPVar("Energy", net.WriteFloat, net.ReadFloat)
DarkRP.createFood("Pizza au fromage", {
model = "models/cheesepizza01/cheesepizza01.mdl",
energy = 100,
price = 60
})
DarkRP.createFood("Pizza au kebab", {
model = "models/peppizza02/peppizza02.mdl",
energy = 100,
price = 60
})
DarkRP.createFood("Hamburger", {
model = "models/FoodNHouseholdItems/mcdburgerbox.mdl",
energy = 35,
price = 30
})
DarkRP.createFood("Cheeseburger", {
model = "models/FoodNHouseholdItems/mcdburgerbox.mdl",
energy = 35,
price = 30
})
DarkRP.createFood("Hot-dog", {
model = "models/FoodNHouseholdItems/hotdog.mdl",
energy = 35,
price = 30
})
DarkRP.createFood("Menu une personne", {
model = "models/FoodNHouseholdItems/McdMeal2.mdl",
energy = 75,
price = 50
})
DarkRP.createFood("Menu deux personne", {
model = "models/FoodNHouseholdItems/McdMeal.mdl",
energy = 100,
price = 70
})
DarkRP.createFood("Sushi", {
model = "models/sushipack/sushi01.mdl",
energy = 50,
price = 40
})
DarkRP.createFood("Homard", {
model = "models/FoodNHouseholdItems/lobster.mdl",
energy = 100,
price = 200
})
DarkRP.createFood("Part de Gateau au chocolat", {
model = "models/FoodNHouseholdItems/cakepiece.mdl",
energy = 30,
price = 30
})
DarkRP.createFood("Sachet de cookies", {
model = "models/FoodNHouseholdItems/cookies.mdl",
energy = 30,
price = 30
})
DarkRP.createFood("Donut", {
model = "models/FoodNHouseholdItems/donut.mdl",
energy = 30,
price = 30
})
DarkRP.createFood("Coca-cola", {
model = "models/FoodNHouseholdItems/cola.mdl",
energy = 10,
price = 10
})
DarkRP.createFood("Jus d'orange", {
model = "models/FoodNHouseholdItems/juice.mdl",
energy = 10,
price = 10
})
DarkRP.createFood("Bouteille de champagne", {
model = "models/FoodNHouseholdItems/champagneonplate.mdl",
energy = 10,
price = 150
})
DarkRP.createFood( "Pizza 4 fromage", {
model = "models/cheesepizza01/cheesepizza01.mdl",
energy = 25,
price = 70,
})
DarkRP.createFood( "Pizza Chorizzo", {
model = "models/peppizza02/peppizza02.mdl",
energy = 25,
price = 70,
})
DarkRP.createFood( "Hamburger - Frites", {
model = "models/burgerplate01/burgerplate01.mdl",
energy = 12,
price = 24,
})
DarkRP.createFood( "Bacon", {
model = "models/bacon01/bacon01.mdl",
energy = 2,
price = 4,
})
DarkRP.createFood( "Milkshake", {
model = "models/chocolateshake01/chocolateshake01.mdl",
energy = 2,
price = 4,
})
DarkRP.createFood( "Macaroni au fromage", {
model = "models/macncheese01/macncheese01.mdl",
energy = 15,
price = 30,
})
DarkRP.createFood( "Spaghetti", {
model = "models/bowlofspaghetti01/bowlofspaghetti01.mdl",
energy = 13,
price = 26,
})
DarkRP.createFood( "Rouleau de saumon", {
model = "models/sushipack/sushi01.mdl",
energy = 5,
price = 10,
})
DarkRP.createFood( "Twinkie", {
model = "models/twinkie01/twinkie01.mdl",
energy = 4,
price = 8,
})
DarkRP.createFood( "Sushi au oeuf", {
model = "models/sushipack/eggsushi01.mdl",
energy = 10,
price = 20,
})
--[[---------------------------------------------------------------------------
DarkRP custom food
---------------------------------------------------------------------------
This file contains your custom food.
This file should also contain food from DarkRP that you edited.
THIS WILL ONLY LOAD IF HUNGERMOD IS ENABLED IN darkrp_config/disabled_defaults.lua.
IT IS DISABLED BY DEFAULT.
Note: If you want to edit a default DarkRP food, first disable it in darkrp_config/disabled_defaults.lua
Once you've done that, copy and paste the food item to this file and edit it.
The default food can be found here:
https://github.com/FPtje/DarkRP/blob/master/gamemode/modules/hungermod/sh_init.lua#L33
Add food under the following line:
---------------------------------------------------------------------------]]
local checkModel = function(model) return model ~= nil and (CLIENT or util.IsValidModel(model)) end
local validFood = {"name", model = checkModel, "energy", "price"}
FoodItems = {}
function DarkRP.createFood(name, mdl, energy, price)
local foodItem = istable(mdl) and mdl or {model = mdl, energy = energy, price = price}
foodItem.name = name
if DarkRP.DARKRP_LOADING and DarkRP.disabledDefaults["food"][name] then return end
for k,v in pairs(validFood) do
local isFunction = isfunction(v)
if (isFunction and not v(foodItem[k])) or (not isFunction and foodItem[v] == nil) then
ErrorNoHalt("Corrupt food \"" .. (name or "") .. "\": element " .. (isFunction and k or v) .. " is corrupt.\n")
end
end
table.insert(FoodItems, foodItem)
end
AddFoodItem = DarkRP.createFood
local plyMeta = FindMetaTable("Player")
plyMeta.isCook = fn.Compose{fn.Curry(fn.GetValue, 2)("cook"), plyMeta.getJobTable}
--[[
Valid members:
model = string, -- the model of the food item
energy = int, -- how much energy it restores
price = int, -- the price of the food
requiresCook = boolean, -- whether only cooks can buy this food
customCheck = function(ply) return boolean end, -- customCheck on purchase function
customCheckMessage = string -- message to people who cannot buy it because of the customCheck
]]
DarkRP.DARKRP_LOADING = true
DarkRP.registerDarkRPVar("Energy", net.WriteFloat, net.ReadFloat)
DarkRP.createFood("Pizza au fromage", {
model = "models/cheesepizza01/cheesepizza01.mdl",
energy = 100,
price = 60
})
DarkRP.createFood("Pizza au kebab", {
model = "models/peppizza02/peppizza02.mdl",
energy = 100,
price = 60
})
DarkRP.createFood("Hamburger", {
model = "models/FoodNHouseholdItems/mcdburgerbox.mdl",
energy = 35,
price = 30
})
DarkRP.createFood("Cheeseburger", {
model = "models/FoodNHouseholdItems/mcdburgerbox.mdl",
energy = 35,
price = 30
})
DarkRP.createFood("Hot-dog", {
model = "models/FoodNHouseholdItems/hotdog.mdl",
energy = 35,
price = 30
})
DarkRP.createFood("Menu une personne", {
model = "models/FoodNHouseholdItems/McdMeal2.mdl",
energy = 75,
price = 50
})
DarkRP.createFood("Menu deux personne", {
model = "models/FoodNHouseholdItems/McdMeal.mdl",
energy = 100,
price = 70
})
DarkRP.createFood("Sushi", {
model = "models/sushipack/sushi01.mdl",
energy = 50,
price = 40
})
DarkRP.createFood("Homard", {
model = "models/FoodNHouseholdItems/lobster.mdl",
energy = 100,
price = 200
})
DarkRP.createFood("Part de Gateau au chocolat", {
model = "models/FoodNHouseholdItems/cakepiece.mdl",
energy = 30,
price = 30
})
DarkRP.createFood("Sachet de cookies", {
model = "models/FoodNHouseholdItems/cookies.mdl",
energy = 30,
price = 30
})
DarkRP.createFood("Donut", {
model = "models/FoodNHouseholdItems/donut.mdl",
energy = 30,
price = 30
})
DarkRP.createFood("Coca-cola", {
model = "models/FoodNHouseholdItems/cola.mdl",
energy = 10,
price = 10
})
DarkRP.createFood("Jus d'orange", {
model = "models/FoodNHouseholdItems/juice.mdl",
energy = 10,
price = 10
})
DarkRP.createFood("Bouteille de champagne", {
model = "models/FoodNHouseholdItems/champagneonplate.mdl",
energy = 10,
price = 150
})
DarkRP.createFood( "Pizza 4 fromage", {
model = "models/cheesepizza01/cheesepizza01.mdl",
energy = 25,
price = 70,
})
DarkRP.createFood( "Pizza Chorizzo", {
model = "models/peppizza02/peppizza02.mdl",
energy = 25,
price = 70,
})
DarkRP.createFood( "Hamburger - Frites", {
model = "models/burgerplate01/burgerplate01.mdl",
energy = 12,
price = 24,
})
DarkRP.createFood( "Bacon", {
model = "models/bacon01/bacon01.mdl",
energy = 2,
price = 4,
})
DarkRP.createFood( "Milkshake", {
model = "models/chocolateshake01/chocolateshake01.mdl",
energy = 2,
price = 4,
})
DarkRP.createFood( "Macaroni au fromage", {
model = "models/macncheese01/macncheese01.mdl",
energy = 15,
price = 30,
})
DarkRP.createFood( "Spaghetti", {
model = "models/bowlofspaghetti01/bowlofspaghetti01.mdl",
energy = 13,
price = 26,
})
DarkRP.createFood( "Rouleau de saumon", {
model = "models/sushipack/sushi01.mdl",
energy = 5,
price = 10,
})
DarkRP.createFood( "Twinkie", {
model = "models/twinkie01/twinkie01.mdl",
energy = 4,
price = 8,
})
DarkRP.createFood( "Sushi au oeuf", {
model = "models/sushipack/eggsushi01.mdl",
energy = 10,
price = 20,
})