-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshipment.lua
31 lines (21 loc) · 874 Bytes
/
shipment.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
local serverWeps = weapons.GetList()
local shipmentDir = "GeneratedShipments/shipments.txt"
function addShipment(printName, wmodel, className)
local shipment = "DarkRP.createShipment(\"".. printName .."\", {model = \"".. wmodel .."\", entity = \"".. className .."\", price = 100, amount = 10, separate = true, pricesep = 100})\n"
if not file.Exists(shipmentDir, "DATA") then
file.CreateDir("GeneratedShipments")
file.Write(shipmentDir, shipment)
else
file.Append(shipmentDir, shipment)
end
end
concommand.Add("printguns", function()
for k , v in pairs(serverWeps) do
local cname = v.ClassName
local pname = v.PrintName
local wmodel = v.WorldModel
if string.sub(cname, 1, 7) == "m9k" then
addShipment(pname, wmodel, cname)
end
end
end)