Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- All of this is from my admin mod
- Hats = {}
- -- RegisterPlugin
- -- Not really necessary, but helps to make it simpler to add shit
- function Hats.RegisterHat(name, tab)
- name=name or tab.Name or nil
- if !name then return end
- Hats.hatdatabase[name]=tab
- print("poo")
- end
- --Example plugin
- -- Loading files from a folder
- function Hats.LoadHats()
- for f, v in pairs(file.Find( "autisme/gamemode/hats/*.lua", LUA_PATH )) do
- AddCSLuaFile("autisme/gamemode/hats/"..v)
- include("autisme/gamemode/hats/"..v)
- end
- end
- hook.Add("Initialize", "loadhatPlugins", function()
- MsgN("======================")
- Hats.LoadHats()
- MsgN("======================")
- Hats.InitPluginsLoaded=true
- end)
- -- this is in a separate file in autisme/gamemode/hats
- local hat={}
- hat.Name="brotato"
- hat.Price=9001
- hat.Model="potato.mdl"
- Hats.RegisterHat("brotato", hat)
Advertisement
Add Comment
Please, Sign In to add comment