Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if !ConVarExists("gzg_onlyGroup") then
- CreateConVar("gzg_onlyGroup",0)
- end
- if !ConVarExists("gzg_ocilation") then
- CreateConVar("gzg_ocilation",4)
- end
- if !ConVarExists("gzg_doplayer") then
- CreateConVar("gzg_doplayer",1)
- end
- if !ConVarExists("gzg_usergroup") then
- CreateConVar("gzg_usergroup","superadmin admin donators vip")
- end
- if SERVER then return end
- local function canFlash(ply)
- if(GetConVarNumber("gzg_onlyGroup") == 0) then return true end
- local str = GetConVarString("gzg_usergroup")
- local gr = string.Explode(" ",str)
- return(table.HasValue(gr,ply:GetNWString("usergroup")))
- end
- hook.Add("PostDrawViewModel","RainbowPhysgun",function(v,p,w)
- if(canFlash(p)) then
- 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)))
- end
- end)
- hook.Add("PostPlayerDraw", "RainbowPhysgunOthers", function()
- for k,v in pairs(player.GetAll()) do
- if(IsValid(v:GetActiveWeapon()) && v:GetActiveWeapon():GetClass() == "weapon_physgun" && canFlash(v)) then
- 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)))
- end
- if(GetConVarNumber("gzg_doplayer") == 1 && canFlash(v)) then
- 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)))
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment