Jump to content

Need help with dimensions


Pagalo

Recommended Posts

Posted

 

I select one dimension, even if I go in another one, it keeps pushing me out of the inside, can someone help me? Sorry my bad English

 

local Exitdoorrob1 = createMarker(-27.39, -57.99, 1004.5, "arrow", 1.5, 255, 255, 0, 255)
setElementInterior(Exitdoorrob1, 6)
setElementDimension(Exitdoorrob1, 1)
local Doorentryrob1 = createMarker(1315.5, -897.8, 40.5, "arrow", 1.5, 255, 255, 0, 255)
createBlipAttachedTo(Doorentryrob1, 17, 2, 0, 255, 0, 0, 0, 7000)
local robmarker1 = createMarker(-23.32, -55.44, 1002.6, "cylinder", 1.2, 255, 10, 10, 255)
setElementInterior(robmarker1, 6)
setElementDimension(robmarker1, 1)
duty1 = function(l_2_0, l_2_1)
  if isElementWithinMarker(l_2_0, robmarker1) then
    setPlayerWantedLevel(l_2_0, 6)
    triggerClientEvent(root, "playTheSound", root, l_2_0)
    outputChatBox("*Você vai roubar o Mercadinho! aguarde alguns segundos por favor...", l_2_0, 0, 255, 0)
    outputChatBox("#DF0101[ALARME]: #FFFFFFO Jogador " .. getPlayerName(l_2_0) .. "#FFFFFF Esta roubando o Mercadinho!", root, 255, 255, 255, true)
    setElementPosition(robmarker1, 3099.97, -3281.69, -0.5)
    setMarkerSize(Exitdoorrob1, 0)
    local blip1 = createBlipAttachedTo(Doorentryrob1, 20, 2, 0, 255, 0, 0, 0, 7000)
    setTimer(triggerClientEvent, 21000, 1, root, "playTheSound", root, l_2_0)
    setTimer(triggerClientEvent, 42000, 1, root, "playTheSound", root, l_2_0)
    setTimer(triggerClientEvent, 63000, 1, root, "playTheSound", root, l_2_0)
    setTimer(setElementPosition, 200000, 1, robmarker1, -23.32, -55.44, 1002.6)
    setTimer(setMarkerSize, 40000, 1, Exitdoorrob1, 1.5)
    setTimer(givePlayerMoney, 40000, 1, l_2_0, 3000)
    setTimer(destroyElement, 200000, 1, blip1)
  else
    outputChatBox("", source, 255, 0, 0)
  end
end

addCommandHandler("roubar", duty1)
Exitdrob1 = function(l_3_0)
  if source == Exitdoorrob1 and getElementType(l_3_0) == "player" then
    fadeCamera(l_3_0, false, 1, 0, 0, 0)
    setTimer(fadeCamera, 1000, 1, l_3_0, true, 1)
    setTimer(setElementPosition, 1000, 1, l_3_0, 1315.42, -899.38, 39.5)
    setTimer(setElementInterior, 1000, 1, l_3_0, 0, 1315.42, -899.38, 39.5)
    setTimer(setElementDimension, 1000, 1, l_3_0, 0)
  end
end

addEventHandler("onMarkerHit", getRootElement(), Exitdrob1)
Doorerob1 = function(l_4_0)
  if source == Doorentryrob1 and getElementType(l_4_0) == "player" then
    fadeCamera(l_4_0, false, 1, 0, 0, 0)
    setTimer(fadeCamera, 1000, 1, l_4_0, true, 1)
    setTimer(setElementPosition, 1000, 1, l_4_0, -27.32, -56.87, 1003.7)
    setTimer(setElementInterior, 1000, 1, l_4_0, 6, -27.32, -56.87, 1003.7)
    setTimer(setElementDimension, 1000, 1, l_4_0, 1)
    setTimer(outputChatBox, 2000, 1, "*Digite /roubar Para roubar o Mercadinho.", l_4_0, 0, 255, 255)
  end
end

addEventHandler("onMarkerHit", getRootElement(), Doorerob1)

 

Posted

well make sure to use 

...
local marker_dim = getElementDimension(your_marker)
local player_dim = getElementDimension(the_player)
if marker_dim == player_dim then
--  do the function
  end
...

so the function works only if the marker and the player are on the same dimension, right?

Posted

._.

Create the marker on the dimension you choose and add the lines above so whenever anyone in any dimension hits the marker no function will be triggered unless you are in the same dimension of the marker.

Isn't that what you want?

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...