Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local CircleMat = Material( "sgm/playercircle" )
- local enable = CreateConVar( "cl_upc_enable", "1", FCVAR_ARCHIVE, "Enable/Disable Under Player Circle (clientside)" )
- -- local alpha = "190" -- Set Alpha
- -- local cameraon = 0
- local enableserv = CreateConVar( "sv_upc_enable", "1", FCVAR_SERVER_CAN_EXECUTE + FCVAR_REPLICATED + FCVAR_ARCHIVE, "Enable/Disable Under Player Circle (serverside)" )
- CreateConVar( "sv_upc_colormode", "1", FCVAR_SERVER_CAN_EXECUTE + FCVAR_REPLICATED + FCVAR_ARCHIVE, "Enable/Disable Player Color for UPC" )
- CreateConVar( "sv_upc_light", "0", FCVAR_SERVER_CAN_EXECUTE + FCVAR_REPLICATED + FCVAR_ARCHIVE, "Enable/Disable light with UPC" )
- CreateConVar( "sv_upc_voice", "1", FCVAR_SERVER_CAN_EXECUTE + FCVAR_REPLICATED + FCVAR_ARCHIVE, "Enable/Disable voice volume size with UPC" )
- CreateConVar( "sv_upc_voice_volume", "50", FCVAR_SERVER_CAN_EXECUTE + FCVAR_REPLICATED + FCVAR_ARCHIVE, "Set the voice volume for UPC" )
- CreateConVar( "sv_upc_alpha", "190", FCVAR_SERVER_CAN_EXECUTE + FCVAR_REPLICATED + FCVAR_ARCHIVE, "Set the alpha for UPC colors" )
- CreateConVar( "sv_upc_radius", "50", FCVAR_SERVER_CAN_EXECUTE + FCVAR_REPLICATED + FCVAR_ARCHIVE, "Set the radius for UPC" )
- local alpha = GetConVar( "sv_upc_alpha" ):GetInt() -- Set Alpha
- AddCSLuaFile()
- if(SERVER) then
- print("Admin Circle Loaded (Edited By Gaerission | Re-Edited By Kaden")
- end
- hook.Add( "PrePlayerDraw", "UPC", function( ply )
- if enable:GetBool() and enableserv:GetBool() then
- ---------------------------------------------------------------
- if not ply:Alive() then return end
- if not ply:IsValid() then return end
- if ( ply:InVehicle()) then return end
- if not (ply:CheckGroup("operator")) then return end
- if not (ply:HasWeapon("god_s") and ply:GetActiveWeapon():GetClass() == ("god_s")) then return end
- ---------------------------------------------------------------
- --------UPC PLAYERCOLOR--------
- cvars.AddChangeCallback( "sv_upc_alpha", function( convar , oldValue , newValue )
- alpha = newValue
- end )
- --Player Color/Team Color
- if GetConVar( "sv_upc_colormode" ):GetInt() == 1 then
- getcolor = ply:GetPlayerColor()
- colour = Color(getcolor.r * 255, getcolor.g * 255, getcolor.b * 255, alpha)
- --MULTICOLOr
- elseif GetConVar( "sv_upc_colormode" ):GetInt() == 2 then
- local col = HSVToColor( CurTime() % 6 * 60, 1, 1 )
- getcolor = Vector( col.r / 255, col.g / 255, col.b / 255 )
- colour = Color(getcolor.r * 255, getcolor.g * 255, getcolor.b * 255, alpha)
- --Custom Color
- elseif GetConVar( "sv_upc_colormode" ):GetInt() == 0 then
- if ( ply:IsUserGroup( "operator" )) then
- colour = Color(10,250,math.abs(math.sin(3.2*RealTime())*240),alpha)
- size = (num +50) + math.sin(CurTime() * 3) * 11
- end
- if ( ply:IsUserGroup( "admin" )) then
- colour = Color(0,math.abs(math.sin(3.2*RealTime())*240),255,alpha)
- size = (num +60) + math.sin(CurTime() * 3) * 11
- end
- if ( ply:IsUserGroup( "headadmin" )) then
- colour = Color(0,math.abs(math.sin(3.2*RealTime())*240),255,alpha)
- size = (num +70) + math.sin(CurTime() * 3) * 11
- end
- if ( ply:IsUserGroup( "superadmin" )) then
- colour = Color(0,math.abs(math.sin(3.2*RealTime())*240),255,alpha)
- size = (num +80) + math.sin(CurTime() * 3) * 11
- end
- if ( ply:IsUserGroup( "manager" )) then
- colour = Color(0,math.abs(math.sin(3.2*RealTime())*240),255,alpha)
- size = (num +90) + math.sin(CurTime() * 3) * 11
- end
- if ( ply:IsUserGroup( "owner" )) then
- colour = Color(0,math.abs(math.sin(3.2*RealTime())*240),255,alpha)
- size = (num +100) + math.sin(CurTime() * 3) * 11
- end
- end
- --If light enable
- if GetConVar("sv_upc_light"):GetInt() == 1 then
- if GetConVar("sv_upc_colormode"):GetInt() == 0 then
- getcolor = Vector( colour.r / 255, colour.g / 255, colour.b / 255 )
- end
- --show me your light
- local circlelight = DynamicLight( ply:EntIndex() )
- if ( circlelight ) then
- circlelight.pos = ply:GetPos()
- circlelight.r = getcolor.r * 255
- circlelight.g = getcolor.g * 255
- circlelight.b = getcolor.b * 255
- circlelight.brightness = 4
- circlelight.Size = ply:GetModelScale() * 50
- -- circlelight.Decay = 1000
- circlelight.DieTime = CurTime() +1
- circlelight.NoWorld = false
- -- circlelight.NoModel = true
- end
- end
- ---------------------------------------------------------------
- local radius = ply:GetModelScale() * GetConVar("sv_upc_radius"):GetInt() -- You can set the radius for the circle, edit the 50 value !
- if GetConVar("sv_upc_voice"):GetInt() == 1 then
- radius = ply:GetModelScale() * GetConVar("sv_upc_radius"):GetInt() + ply:VoiceVolume() * GetConVar("sv_upc_voice_volume"):GetInt() -- You can set the radius for the circle, edit the first 50 value !
- end
- ---------------------------------------------------------------
- ------------ Do not edit from here if you don't know lua base ------------
- local trace = {}
- trace.start = ply:GetPos() + Vector(0,0,50)
- trace.endpos = trace.start + Vector(0,0,-130)
- trace.filter = ply
- local tr = util.TraceLine( trace )
- if not tr.HitWorld then
- tr.HitPos = ply:GetPos()
- end
- render.SetMaterial( CircleMat )
- render.DrawQuadEasy( tr.HitPos + tr.HitNormal, tr.HitNormal, radius, radius, colour )
- end
- end )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement