Jump to content

I need help with Zone script and Objects!


WiBox

Recommended Posts

local Z1 = createColRectangle(1577, 1723, 60, 140 )
function spawnRoadblock(id, x, y, z, rx, ry, rz, dim, int)
        if (not id) then return end
        if ( id =="" and dim == 0) then
            return true
        end
        if (id == 978) then
            z = z-1
        end
        local accName = getAccountName(getPlayerAccount(client))
        local object = createObject(tonumber(id), x, y, z, rx, ry, rz)
        setElementDoubleSided(object, true)
        setElementFrozen(object, true)
        setElementData(object, "creator", accName, false)
        roadblocks[object] = {object, getAccountName(getPlayerAccount(client))}
        if (tonumber(dim) ~= 0) then
            setElementDimension(object, dim)
        end
        if (tonumber(int) ~= 0) then
            setElementInterior(object, int)
        end
        if (id ~= 1225) then
            triggerClientEvent(client, "nobreak", client, object)
        end
end
addEvent("events.RB.AddRoadblock", true)
addEventHandler("events.RB.AddRoadblock", root, spawnRoadblock) 

 


____________________________________________________________________________________________________________________________

i want to add on it, if Client placed a Object outside Z1 it will not get placed, and if it placed inside the Z1 it will be placed, Please can someone help, and i appreciate that! thank you.

Edited by NeXuS™
Added code tag.
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...