Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Bass [S]imple [H]ats [S]ystem
- --[[
- THIS CODE WERE WRITTEN BY ONLY AND ONLY, YANK.
- NOTHING'S COPIED OR STOLEN FROM OTHER SOFTWARES/SCRIPTS SO, DON'T EVEN TRY.
- THUS, YOU CAN ONLY USE IT IF YOU FOLLOW THE TERMS OF USE:
- YOU CANNOT DISTRIBUTE IT FOR ANY COMMERCIAL PURPOSE
- YOU CANNOT ASSIGN ANYBODY APPART FROM ME AS ITS AUTHOR
- YOU CANNOT COPY ANYTHING FROM IT
- YOU CAN ONLY SHARE IT WITH MY PERMISSION
- INFORMATION
- IF YOU FIND ANY BUG, FEEL FREE TO REPORT IT TO ME
- CONTACT ME ALSO IF YOU WANT A FEATURE TO BE ADDED OR SOMETHING TO BE CHAGED
- MY CONTACT: http://unrealsoftware.de/profile.php?userid=94235 OR SKYPE: gougous3
- --]]
- if not cosm then cosm = {
- CONFIG = {
- rank = 1; -- Minimum rank needed to bring the visuals menu
- svact = true; -- Wether the visuals menu can be opened by serveraction (F2)
- };
- SETUP = {
- {"Batman", path = "gfx/yank/suckyhats/batman_suit.png"};
- {"Bear Beast", path = "gfx/yank/suckyhats/beast_armor.png"};
- {"Mecha", path = "gfx/yank/suckyhats/mecha_armor.png"};
- {"Healing God", path = "gfx/yank/suckyhats/medic_costume.png"};
- {"Ninja", path = "gfx/yank/suckyhats/ninja_costume.png"};
- {"Saiyan Suit", path = "gfx/yank/suckyhats/saiyan_suit.png"};
- {"Umbrella", path = {"gfx/yank/suckyhats/terrorist_umbrella.png", "gfx/yank/suckyhats/counterterrorist_umbrella.png"}};
- };
- ABOUT = {
- name = "Cosmetics";
- author = "_Yank";
- version = "1b";
- commands = {
- {"vis", level = 1, func = "cosm.renderMenu", desc = "Bring up visuals menu."};
- {"revis", level = 1, func = "cosm.reVis", desc = "Remove current visual."}
- };
- };
- } end
- cosm.pi = {}
- for i = 1, tonumber(game("sv_maxplayers")) do cosm.pi[i] = {0, 0} end
- addhook("menu","cosm.MENUCORE")
- function cosm.MENUCORE(id, title, button)
- if title:sub(1, 7) == "Visuals" then
- local page = tonumber(string.match(title, "(%d*)/"))
- if button == 8 then cosm.renderMenu(id, page + 1) end
- if button == 9 then cosm.renderMenu(id, page - 1) end
- if button <= 6 and button > 0 then
- local visual = ((page - 1) * 6) + button
- if cosm.pi[id][2] ~= 0 then cosm.reVis(id) end
- cosm.dress(id, visual)
- end
- end
- end
- addhook("startround","cosm.RELOAD")
- function cosm.RELOAD()
- for id = 1, tonumber(game("sv_maxplayers")) do
- if player(id,"exists") and user[id].rank >= cosm.CONFIG.rank and player(id, "team") ~= 0 and cosm.pi[id][2] ~= 0 then cosm.dress(id, cosm.pi[id][2]) end
- end
- end
- if cosm.CONFIG.svact then
- addhook("serveraction","cosm.TRIGGER")
- function cosm.TRIGGER(id, act)
- if user[id].rank >= cosm.CONFIG.rank then if act == 1 then cosm.renderMenu(id) elseif act == 2 then cosm.reVis(id) end end
- end
- end
- function cosm.dress(id, hat)
- if type(cosm.SETUP[hat].path) == "string" then cosm.pi[id][1] = image(cosm.SETUP[hat].path, 1, 1, 200 + id)
- else cosm.pi[id][1] = image(cosm.SETUP[hat].path[player(id,"team")], 1, 1, 200 + id) end
- cosm.pi[id][2] = hat
- end
- function cosm.renderMenu(id, page)
- local page = page or 1
- local pages = math.ceil(#cosm.SETUP / 6)
- if page < 1 then page = pages end
- if page > pages then page = 1 end
- local menuString = "Visuals ("..page.."/"..pages..")"
- for i = 6 * page - 5, 6 * page do if cosm.SETUP[i] then menuString = menuString ..", ".. cosm.SETUP[i][1] else menuString = menuString .."," end end
- if page == pages then menuString = menuString ..",,First page" else menuString = menuString ..",,Next page" end
- if page == 1 then menuString = menuString ..",Last page" else menuString = menuString ..",Previous page" end
- menu(id, menuString)
- end
- function cosm.reVis(id) freeimage(cosm.pi[id][1]) ; cosm.pi[id][2] = 0 end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement