SHARE
TWEET

Untitled

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