Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.73 KB | None | 0 0
  1. local CircleMat = Material( "sgm/playercircle" )
  2. local enable = CreateConVar( "cl_upc_enable", "1", FCVAR_ARCHIVE, "Enable/Disable Under Player Circle (clientside)" )
  3. -- local alpha = "190" -- Set Alpha
  4.  
  5. -- local cameraon = 0
  6.  
  7. local enableserv = CreateConVar( "sv_upc_enable", "1", FCVAR_SERVER_CAN_EXECUTE + FCVAR_REPLICATED + FCVAR_ARCHIVE, "Enable/Disable Under Player Circle (serverside)" )
  8.  
  9.  
  10. CreateConVar( "sv_upc_colormode", "1", FCVAR_SERVER_CAN_EXECUTE + FCVAR_REPLICATED + FCVAR_ARCHIVE, "Enable/Disable Player Color for UPC" )
  11. CreateConVar( "sv_upc_light", "0", FCVAR_SERVER_CAN_EXECUTE + FCVAR_REPLICATED + FCVAR_ARCHIVE, "Enable/Disable light with UPC" )
  12. CreateConVar( "sv_upc_voice", "1", FCVAR_SERVER_CAN_EXECUTE + FCVAR_REPLICATED + FCVAR_ARCHIVE, "Enable/Disable voice volume size with UPC" )
  13. CreateConVar( "sv_upc_voice_volume", "50", FCVAR_SERVER_CAN_EXECUTE + FCVAR_REPLICATED + FCVAR_ARCHIVE, "Set the voice volume for UPC" )
  14. CreateConVar( "sv_upc_alpha", "190", FCVAR_SERVER_CAN_EXECUTE + FCVAR_REPLICATED + FCVAR_ARCHIVE, "Set the alpha for UPC colors" )
  15. CreateConVar( "sv_upc_radius", "50", FCVAR_SERVER_CAN_EXECUTE + FCVAR_REPLICATED + FCVAR_ARCHIVE, "Set the radius for UPC" )
  16.  
  17. local alpha = GetConVar( "sv_upc_alpha" ):GetInt() -- Set Alpha
  18.  
  19. AddCSLuaFile()
  20. if(SERVER) then
  21. print("Admin Circle Loaded (Edited By Gaerission | Re-Edited By Kaden")
  22.  end
  23.  
  24. hook.Add( "PrePlayerDraw", "UPC", function( ply )
  25.  
  26. if enable:GetBool() and enableserv:GetBool() then
  27.  
  28.     ---------------------------------------------------------------
  29.    
  30.     if ( !ply:Alive()) then return end
  31.     if ( !ply:IsValid()) then return end
  32.     if ( ply:InVehicle()) then return end
  33.     if not (ply:CheckGroup("operator")) then return end
  34.     if not (ply:HasWeapon("god_s") and ply:GetActiveWeapon():GetClass() == ("god_s")) then return end
  35.    
  36.    
  37.  
  38.     ---------------------------------------------------------------
  39.  
  40. --------UPC PLAYERCOLOR--------
  41. cvars.AddChangeCallback( "sv_upc_alpha", function( convar , oldValue , newValue  )
  42.     alpha = newValue
  43. end )
  44.  
  45.  
  46.  
  47. --Player Color/Team Color
  48. if GetConVar( "sv_upc_colormode" ):GetInt() == 1 then
  49. getcolor = ply:GetPlayerColor()
  50. colour = Color(getcolor.r * 255, getcolor.g * 255, getcolor.b * 255, alpha)
  51.  
  52. --MULTICOLOr
  53.     elseif GetConVar( "sv_upc_colormode" ):GetInt() == 2 then
  54.         local col = HSVToColor( CurTime() % 6 * 60, 1, 1 )
  55.         getcolor = Vector( col.r / 255, col.g / 255, col.b / 255 )
  56.     colour = Color(getcolor.r * 255, getcolor.g * 255, getcolor.b * 255, alpha)
  57.  
  58. --Custom Color
  59.     elseif GetConVar( "sv_upc_colormode" ):GetInt() == 0 then
  60.  
  61.  
  62. end
  63.  
  64. --If light enable
  65. if GetConVar("sv_upc_light"):GetInt() == 1 then
  66. if GetConVar("sv_upc_colormode"):GetInt() == 0 then
  67. getcolor = Vector( colour.r / 255, colour.g / 255, colour.b / 255 )
  68. end
  69.  
  70.         --show me your light
  71.             local circlelight = DynamicLight( ply:EntIndex() )
  72.             if ( circlelight ) then
  73.                 circlelight.pos = ply:GetPos()
  74.                 circlelight.r = getcolor.r * 255
  75.                 circlelight.g = getcolor.g * 255
  76.                 circlelight.b = getcolor.b * 255
  77.                 circlelight.brightness = 4
  78.                 circlelight.Size = ply:GetModelScale() * 50
  79.                 -- circlelight.Decay = 1000
  80.                 circlelight.DieTime = CurTime() +1
  81.                 circlelight.NoWorld = false
  82.                 -- circlelight.NoModel = true
  83.             end
  84.  
  85. end
  86.  
  87.     ---------------------------------------------------------------  
  88.  
  89. if ( ply:IsUserGroup( "operator" )) then
  90.         colour = Color(10,250,math.abs(math.sin(3.2*RealTime())*240),alpha)
  91.         size = (num +50) + math.sin(CurTime() * 3) * 11  
  92.         local radius = ply:GetModelScale() * 50
  93. end
  94.  
  95. if ( ply:IsUserGroup( "admin" )) then
  96.         colour = Color(0,math.abs(math.sin(3.2*RealTime())*240),255,alpha)
  97.         size = (num +60) + math.sin(CurTime() * 3) * 11  
  98.         local radius = ply:GetModelScale() * 60
  99. end
  100.  
  101. if ( ply:IsUserGroup( "headadmin" )) then
  102.         colour = Color(0,math.abs(math.sin(3.2*RealTime())*240),255,alpha)
  103.         size = (num +70) + math.sin(CurTime() * 3) * 11  
  104.         local radius = ply:GetModelScale() * 70    
  105.  
  106. end
  107.  
  108. if ( ply:IsUserGroup( "superadmin" )) then
  109.         colour = Color(0,math.abs(math.sin(3.2*RealTime())*240),255,alpha)
  110.         size = (num +80) + math.sin(CurTime() * 3) * 11    
  111.         local radius = ply:GetModelScale() * 80
  112.  
  113. end
  114.  
  115. if ( ply:IsUserGroup( "manager" )) then
  116.         colour = Color(0,math.abs(math.sin(3.2*RealTime())*240),255,alpha)
  117.         size = (num +90) + math.sin(CurTime() * 3) * 11    
  118.         local radius = ply:GetModelScale() * 90
  119.  
  120. end
  121.  
  122. if ( ply:IsUserGroup( "owner" )) then
  123.         colour = Color(0,math.abs(math.sin(3.2*RealTime())*240),255,alpha)
  124.         size = (num +100) + math.sin(CurTime() * 3) * 11    
  125.         local radius = ply:GetModelScale() * 100   
  126. end
  127.  
  128.  
  129.     --  You can set the radius for the circle, edit the 50 value !
  130.    
  131.     if GetConVar("sv_upc_voice"):GetInt() == 1 then
  132.         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 !
  133.     end
  134.     ---------------------------------------------------------------
  135.    
  136. ------------ Do not edit from here if you don't know lua base ------------
  137.  
  138.     local trace = {}
  139.     trace.start = ply:GetPos() + Vector(0,0,50)
  140.     trace.endpos = trace.start + Vector(0,0,-130)
  141.     trace.filter = ply
  142.     local tr = util.TraceLine( trace )
  143.     if !tr.HitWorld then
  144.         tr.HitPos = ply:GetPos()
  145.     end
  146.     render.SetMaterial( CircleMat )
  147.     render.DrawQuadEasy( tr.HitPos + tr.HitNormal, tr.HitNormal, radius, radius, colour )
  148.    
  149. end
  150. end )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement