• Weapon Selection Wheel
    3 replies, posted
Is it possible to create a weapon selection wheel? If so, how could I create this?
Of course it's possible, you'd have to know trigonometry in order to make it though.
Yes, Some.
[QUOTE=DJSparky98;43111730]Yes, Some.[/QUOTE] This script I made a while back should get you on the right track: [lua] if SERVER then AddCSLuaFile() else gui.EnableScreenClicker(true) hook.Add("HUDPaint", "t.HUDPaint", function() if !IsValid(LocalPlayer()) then return end local mx, my = gui.MousePos() local cX, cY = ScrW()/2, ScrH()/2 local mouseAngR = -math.atan2(my-cY,mx-cX)%(math.pi*2) local mouseAngD = math.deg(mouseAngR) local tHeight = draw.GetFontHeight("Default") draw.DrawText("Mouse X:"..mx, "Default", 10, 100+tHeight, color_white) draw.DrawText("Mouse Y:"..my, "Default", 10, 100+tHeight*2, color_white) draw.DrawText("Mouse AngR:"..mouseAngR, "Default", 10, 100+tHeight*3, color_white) draw.DrawText("Mouse Deg:"..mouseAngD, "Default", 10, 100+tHeight*4, color_white) surface.SetDrawColor(color_white) surface.SetMaterial(Material("icon16/arrow_up.png")) surface.DrawTexturedRectRotated(cX, cY, 50, 50, mouseAngD-90) end) end [/lua]
Sorry, you need to Log In to post a reply to this thread.