Guest User

Code

a guest
Jun 15th, 2014
1,199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1.  
  2. if !ConVarExists("gzg_onlyGroup") then
  3. CreateConVar("gzg_onlyGroup",0)
  4. end
  5.  
  6. if !ConVarExists("gzg_ocilation") then
  7. CreateConVar("gzg_ocilation",4)
  8. end
  9.  
  10. if !ConVarExists("gzg_doplayer") then
  11. CreateConVar("gzg_doplayer",1)
  12. end
  13.  
  14. if !ConVarExists("gzg_usergroup") then
  15. CreateConVar("gzg_usergroup","superadmin admin donators vip")
  16. end
  17.  
  18. if SERVER then return end
  19.  
  20. local function canFlash(ply)
  21.  
  22. if(GetConVarNumber("gzg_onlyGroup") == 0) then return true end
  23.  
  24. local str = GetConVarString("gzg_usergroup")
  25. local gr = string.Explode(" ",str)
  26.  
  27. return(table.HasValue(gr,ply:GetNWString("usergroup")))
  28. end
  29.  
  30. hook.Add("PostDrawViewModel","RainbowPhysgun",function(v,p,w)
  31.  
  32. if(canFlash(p)) then
  33. p:SetWeaponColor(Vector(math.abs(math.cos(RealTime()*GetConVarNumber("gzg_ocilation")/10)),math.abs(math.sin(RealTime()*GetConVarNumber("gzg_ocilation")/10)),math.sin(RealTime()*GetConVarNumber("gzg_ocilation")/10)))
  34. end
  35.  
  36. end)
  37.  
  38. hook.Add("PostPlayerDraw", "RainbowPhysgunOthers", function()
  39.  
  40. for k,v in pairs(player.GetAll()) do
  41.  
  42. if(IsValid(v:GetActiveWeapon()) && v:GetActiveWeapon():GetClass() == "weapon_physgun" && canFlash(v)) then
  43. v:SetWeaponColor(Vector(math.abs(math.cos(RealTime()*GetConVarNumber("gzg_ocilation")/10)),math.abs(math.sin(RealTime()*GetConVarNumber("gzg_ocilation")/10)),math.sin(RealTime()*GetConVarNumber("gzg_ocilation")/10)))
  44. end
  45.  
  46. if(GetConVarNumber("gzg_doplayer") == 1 && canFlash(v)) then
  47. v:SetPlayerColor(Vector(math.abs(math.cos(RealTime()*GetConVarNumber("gzg_ocilation")/10)),math.abs(math.sin(RealTime()*GetConVarNumber("gzg_ocilation")/10)),math.sin(RealTime()*GetConVarNumber("gzg_ocilation")/10)))
  48. end
  49.  
  50. end
  51.  
  52. end)
Advertisement
Add Comment
Please, Sign In to add comment