[FREE] ba_zones or safezones




Create zones in a unique way. Now it’s easier than ever.

We got tired of them being leaked so we decided to make them public.

ba_zones allows you to create zones, assign a blip or a radius to them. you can also set them to do a specific function either when entering, leaving or inside the zone.

Features

  • Configurable - Every detail is configurable
  • Standalone - No Framework? No problem
  • Easy to use - Intuitively useable and easy to install
  • Peace Zone - Too many killings in the zone? Disable PVP
  • Routing - You can divide the zones by buckets (MORE FPS)

Inside config.lua are examples of how to create a zone.

Dependencies:

Download:

:warning: :warning: :warning: Please read the installation carefully before reporting any bugs. :warning: :warning: :warning:

10 Likes

Nice Script, Works Good!

1 Like

Thanks! :orange_heart:

Very good script, i’ll use it on my sv. Thanks for publishing it!

De locos diria mi amigo brianeitor

Excellent! that they can share part of their “body” people like me who do not have a body of programmers are very grateful! ARG! reinadorp!

2 Likes

Thanks for u comment. We really appreciate it <3

3 Likes

Working good on our server so far!

1 Like

Thanks! :argentina:

1 Like

The only catch is if you drive into the zone the vehicle disappears and you get teleported back?

I was having this issue initially with cars being deleted when entering a zone, I am currently on vacation but i’ll try see if I can find the snippet of code I changed to fix it.

Sorry for hearing that,

Can you send me your client.lua via PM?

3 ojmedoiwsdjnfojnsaiojmeaiodrjopsadk

nice i have question

have we figured out the situation? i’m also dealing with this.

I’m also curious within the config file there is SwitchDimension(16000) -- Switch to custom dimension how can this be changed to player’s id.

You can use: SwitchDimension(GetPlayerServerId(PlayerId()))

1 Like

Thank you very much! Any idea why when I phase, it removes player from vehicle then it is necessary to re-phase to see the vehicle in the newer instance? Sorry to be a bother, and thanks again the command provided works like a charm for my garage instancing I’m trying to piece together.
Also I made sure to follow direction for pma-voice since I do use it with following console error

SCRIPT ERROR: @zones/server/main.lua:20: No such export updateRoutingBucket in resource pma-voice[        script:zones]
function SwitchDimension(dimensionId)
    local passengers = {}

    if IsPedInAnyVehicle(PlayerPedId(), false) then
        local veh = GetVehiclePedIsUsing(PlayerPedId())
        local maxpeds = GetVehicleMaxNumberOfPassengers(veh)
        for i = -1, maxpeds do
            if not IsVehicleSeatFree(veh, i) then
                local ped = GetPlayerServerId(NetworkGetPlayerIndexFromPed(GetPedInVehicleSeat(veh, i)))
                table.insert(passengers , {
                    serverId = ped,
                })
            end
        end
    end
    local switch_bucket = lib.callback.await('ba_zones-sv:switchBucket', false, dimensionId, IsPedInAnyVehicle(PlayerPedId(), false), passengers)
    if switch_bucket then print("[DEBUG]: Switching bucket to "..dimensionId) end
end

lib.callback.register('ba_zones-sv:switchBucket', function(source, id, isPedInAnyVeh, passengers)
	local veh = GetVehiclePedIsIn(GetPlayerPed(source), false)
	local driverServerId = GetPedInVehicleSeat(veh, -1)

	if isPedInAnyVeh then
		SetPlayerRoutingBucket(driverServerId, id)
		for i,v in ipairs(passengers) do
			if tonumber(v.serverId) ~= 0 then
				if tonumber(v.serverId) ~= source then
					if GetPlayerName(tonumber(v.serverId)) then
						SetPlayerRoutingBucket(v.serverId, id)
					end
				end
			end
		end
		SetEntityRoutingBucket(veh, id)
		--exports['pma-voice']:updateRoutingBucket(source, id)
	else
		SetPlayerRoutingBucket(source, id)
		--exports['pma-voice']:updateRoutingBucket(source, id)
	end

	return true
end)

This is exactly what I need to make my garage work :slight_smile: but there is some sort of hiccup with it & I’m going to try over an over by banging my head off the wall :laughing:

Small clip

Only remove the export functions in @zones/server/main.lua:20.
These instructions are for an old version of pma-voice, if you have the latest version you don’t need to.

1 Like

Thank you for the input

i want to know , this work with extended and pvp true or false ?

because im looking for make pvp zone like darkzone.