Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local MaxCorner = Vector(-15348,-15351,-10^9)
- local MinCorner = Vector(-3848,-9886,2000)
- if SERVER then
- AddCSLuaFile("pureacf_init")
- print("Sending PureACF Lua's to Clients")
- concommand.Add("pureacf_removehooks",function()
- hook.Remove("PlayerNoClip","pureacf_noclip")
- hook.Remove("Think","pureacf_unclip")
- print("Removing Hooks.....")
- end)
- end
- function InRange(vec, minCorner, maxCorner)
- if vec.x > minCorner.x then return false end
- if vec.y > minCorner.y then return false end
- if vec.z > minCorner.z then return false end
- if vec.x < maxCorner.x then return false end
- if vec.y < maxCorner.y then return false end
- if vec.z < maxCorner.z then return false end
- return true
- end
- hook.Add( "PlayerNoClip", "pureacf_noclip", function( ply )
- if not InRange( ply:GetPos(), MinCorner, MaxCorner ) then
- ply:ChatPrint("You Can Only NoClip In The Safe Zone!")
- return false
- end
- end )
- if SERVER then
- hook.Add( "Think", "pureacf_unclip", function()
- local plys = player.GetAll()
- for _,ply in pairs(plys) do
- if not ply:IsSuperAdmin() or not ply:IsAdmin() then
- if ply:GetMoveType() == MOVETYPE_NOCLIP then
- if not InRange( ply:GetPos(), MinCorner, MaxCorner ) then
- ply:SetMoveType( MOVETYPE_WALK )
- ply:ChatPrint("You Can Only NoClip In The Safe Zone!")
- end
- end
- end
- end
- end)
- end
Add Comment
Please, Sign In to add comment