If you've ever setup a DarkRP server then you may recall how frustrating it can be setting up things such as shipments.
I wanted to share my way of avoiding a small yet annoying annoying part of making shipments
hook.Add("InitPostEntity","cl3_loadshipmentsafterents", function() -- Wait for entities to load (inc weapons) so we can get a list of weapons
local createshipment = DarkRP.createShipment -- Cache the original drp function
function DarkRP.createShipment(name, tbl) -- Overwrite with a very useful functionality for the model
tbl.model = weapons.GetStored(tbl.entity).WorldModel -- Get the model of the class provided
createshipment(name, tbl) -- run the original code from drp with our new model etc
end
-- Your shipments would be below here
DarkRP.createShipment("Colt 1911", {
entity = "m9k_colt1911",
amount = 10,
price = 5000,
separate = false,
pricesep = 0,
noship = false,
category = "Pistols",
allowed = {TEAM_EXAMPLE}
})
end)
The above would be your shipments.lua file and the model will auto assign.
Sorry, you need to Log In to post a reply to this thread.