Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- script_name("moonmanager")
- script_description("lua scripts manager")
- script_version_number(1)
- script_authors("allah")
- function main()
- wait(0)
- sampfuncsRegisterConsoleCommand("ml.threads", command1)
- sampfuncsRegisterConsoleCommand("ml.unload", command2)
- sampfuncsRegisterConsoleCommand("ml.reload", command3)
- while true do
- wait(0)
- end
- end
- function command2(param)
- local s = script.find(param)
- if s ~= nil then
- s:unload()
- sampfuncsLog(string.format("* script \'%s\' succesfully unloaded", param))
- --else sampfuncsLog(string.format("* script \'%s\' not found", param))
- end
- param2 = param
- local l = script.list()
- for i, v in ipairs(l) do
- if tonumber(param) == i then
- v:unload()
- sampfuncsLog(string.format("* script \'%s\' succesfully unloaded", param2))
- end
- end
- end
- function command3(param)
- local s = script.find(param)
- if s ~= nil then
- s:reload()
- sampfuncsLog(string.format("* script \'%s\' succesfully reloaded", param))
- --else sampfuncsLog(string.format("* script \'%s\' not found", param))
- end
- param2 = param
- local l = script.list()
- for i, v in ipairs(l) do
- if tonumber(param) == i then
- v:reload()
- sampfuncsLog(string.format("* script \'%s\' succesfully reloaded", param2))
- end
- end
- end
- function command1()
- sampfuncsLog("id name filename description authors")
- local l = script.list()
- for i, v in pairs(l) do
- sampfuncsLog(string.format("%d %s %s %s %s", i, v.name, v.filename, v.description, table.concat(v.authors)))
- end
- --print(string.format("%s - %s", v.name, v.description))
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement