когда спавнишся внизу где-то как на меджике, будет написано на спавне, что тут зеленая зона урон не наносится, дайте адоничк такой
SafezonesConfig = {
["ProtectionDelay"] = 1, -- how long will they remain spawn protected after leaving a safezone box
["RemoveProps"] = true, -- do we want to delete props that enter the zones
["RemovePysobjects"] = false, -- do we want to mass delete anything that has a physics object? warning: may cause bugs
["RemoveVehicles"] = true, -- do we want to delete vehicles that enter the zones, be careful with this if you run an rp server with cars
["RemoveNPCs"] = true, -- do we want to delete npcs that enter the spawn area
["RecurringProtection"] = true, -- if you leave the spawn zone and re-enter it, should you be protected again?
}
-- the actual boxes, needs to be 2 vectors seperated by a comma as you can see below
-- you can type "getlocation" into console to grab the vector location of what your crosshair is pointing at, then copy paste it into this file
Safezones = {
["obkak"] = {
["1"] = {Vector( 2495, 575, -333 ), Vector( 1824, -960, -523 )},
["2"] = {Vector( 2495, -960, -333 ), Vector( 1904, -1600, -572 )}
},
}
-- ========== DO NOT TOUCH ANYTHING BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING ==========
if CLIENT then
-- this is a duplicate of the serverside load function that runs on each client so they can see the boxes
local MapSZs = {}
local loadedmap = false
local function LoadMapSetup()
local thismap = game.GetMap()
for k, v in pairs(Safezones) do
if k == thismap then
MapSZs = v
loadedmap = true
end
end
--[[
if not loadedmap then
MsgC(Color(255,255,255, 100), "[Safezones] No cfg")
end
]]
end
timer.Simple(1, function() LoadMapSetup() end)
local function DrawSpawnBoxes()
render.SetMaterial( Material("Models/effects/vol_light001") )
for k, v in pairs(MapSZs) do
render.DrawBox( v[2], Angle(0,0,0), Vector(0,0,0), v[1] - v[2], Color(255,0,0, 100), true )
end
end
hook.Add("PostDrawOpaqueRenderables", "ICanSeeYourDoodle", DrawSpawnBoxes)
local function SZHudIndicator()
if LocalPlayer():GetNWBool("SpawnProtected") then
local w = ScrW()
local h = ScrH()
draw.SimpleTextOutlined("Безопасная зона", "TargetID",w/2,60,Color(225,225,225),1,1,1,color_black)
end
end
hook.Add("HUDPaint", "szhudindicator", SZHudIndicator)
end
это для рп банклав?sh_safezones.lua
Ruby:SafezonesConfig = { ["ProtectionDelay"] = 1, -- how long will they remain spawn protected after leaving a safezone box ["RemoveProps"] = true, -- do we want to delete props that enter the zones ["RemovePysobjects"] = false, -- do we want to mass delete anything that has a physics object? warning: may cause bugs ["RemoveVehicles"] = true, -- do we want to delete vehicles that enter the zones, be careful with this if you run an rp server with cars ["RemoveNPCs"] = true, -- do we want to delete npcs that enter the spawn area ["RecurringProtection"] = true, -- if you leave the spawn zone and re-enter it, should you be protected again? } -- the actual boxes, needs to be 2 vectors seperated by a comma as you can see below -- you can type "getlocation" into console to grab the vector location of what your crosshair is pointing at, then copy paste it into this file Safezones = { ["obkak"] = { ["1"] = {Vector( 2495, 575, -333 ), Vector( 1824, -960, -523 )}, ["2"] = {Vector( 2495, -960, -333 ), Vector( 1904, -1600, -572 )} }, } -- ========== DO NOT TOUCH ANYTHING BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING ========== if CLIENT then -- this is a duplicate of the serverside load function that runs on each client so they can see the boxes local MapSZs = {} local loadedmap = false local function LoadMapSetup() local thismap = game.GetMap() for k, v in pairs(Safezones) do if k == thismap then MapSZs = v loadedmap = true end end --[[ if not loadedmap then MsgC(Color(255,255,255, 100), "[Safezones] No cfg") end ]] end timer.Simple(1, function() LoadMapSetup() end) local function DrawSpawnBoxes() render.SetMaterial( Material("Models/effects/vol_light001") ) for k, v in pairs(MapSZs) do render.DrawBox( v[2], Angle(0,0,0), Vector(0,0,0), v[1] - v[2], Color(255,0,0, 100), true ) end end hook.Add("PostDrawOpaqueRenderables", "ICanSeeYourDoodle", DrawSpawnBoxes) local function SZHudIndicator() if LocalPlayer():GetNWBool("SpawnProtected") then local w = ScrW() local h = ScrH() draw.SimpleTextOutlined("Безопасная зона", "TargetID",w/2,60,Color(225,225,225),1,1,1,color_black) end end hook.Add("HUDPaint", "szhudindicator", SZHudIndicator) end
в коде можно редактировать координаты сейф зоны под любую картуэто для рп банклав?
Нет, тебе нужно самому координаты достать, выше написали как.это для рп банклав?