Jump to content

[HELP] SCRIPT DON'T WORKING!


Recommended Posts

Hello, i'm brazilian. Because this my english isn't too good.

I make this Script:

function verificar ( thePlayer )
    if ( getElementInterior( thePlayer ) == 4 ) then
        givePlayerMoney( thePlayer, 10000 )
    else
        outputChatBox("Você saiu da loja e o dinheiro foi devolvido!", l_5_0, 255, 0, 0)
    end
end

But return the next message:

Bad argument @ 'getElementInterior' [Expected element at argument 1, got nil]

How i can fix this? Thanks for everybody!

Link to comment

Still don't working. Here the full code:

-------------------- Loja AmmuNation de São Paulo --------------------

local Exitdoorrob1 = createMarker(285.84375, -86.7724609375, 1002.2, "arrow", 1.5, 255, 255, 0, 255)
setElementInterior(Exitdoorrob1, 4)
setElementDimension(Exitdoorrob1, 1)
local Doorentryrob1 = createMarker(1368.890625, -1279.787109375, 14.546875, "arrow", 1.5, 255, 255, 0, 255)
createBlipAttachedTo(Doorentryrob1, 17, 2, 0, 255, 0, 0, 0, 7000)
local robmarker1 = createMarker(295.5595703125, -80.40859375, 1000.515625, "cylinder", 1.2, 255, 10, 10, 255)
setElementInterior(robmarker1, 4)
setElementDimension(robmarker1, 1)

function verificar ( thePlayer )
    if ( getElementInterior( thePlayer ) == 4 ) then
        givePlayerMoney( thePlayer, 10000 )
    else
		outputChatBox("Você saiu da loja e o dinheiro foi devolvido!", l_5_0, 255, 0, 0)
    end
end

duty1 = function(l_5_0, l_5_1)
  if isElementWithinMarker(l_5_0, robmarker1) then
    setPlayerWantedLevel(l_5_0, 6)
    triggerClientEvent(root, "playTheSound1", root, l_5_0)
    outputChatBox("O caixa está colocando o dinheiro na sacola! Aguarde até ele terminar!", l_5_0, 0, 255, 0)
    outputChatBox("#DF0101[Alarme]: #FF8C00O Meliante " .. getPlayerName(l_5_0) .. " #FF8C00está assaltando a #DF0101Ammu Nation!", root, 255, 255, 255, true)
    setElementPosition(robmarker1, 3099.97, -3281.69, -0.5)
    setMarkerSize(Exitdoorrob1, 0)
    local blip2 = createBlipAttachedTo(Doorentryrob1, 20, 2, 0, 255, 0, 0, 0, 7000)
    setTimer(triggerClientEvent, 21000, 1, root, "playTheSound1", root, l_5_0)
    setTimer(triggerClientEvent, 42000, 1, root, "playTheSound1", root, l_5_0)
    setTimer(triggerClientEvent, 63000, 1, root, "playTheSound1", root, l_5_0)
    setTimer(setElementPosition, 300000, 1, robmarker1, 295.5595703125, -80.40859375, 1000.515625)
    setTimer(setMarkerSize, 90000, 1, Exitdoorrob1, 1.5)
	setTimer(verificar, 1000, 1, thePlayer)
    setTimer(destroyElement, 300000, 1, blip2)
  else
    outputChatBox("", source, 255, 0, 0)
  end
end

addCommandHandler("roubar", duty1)
Exitdrob1 = function(l_6_0)
  if source == Exitdoorrob1 and getElementType(l_6_0) == "player" then
    fadeCamera(l_6_0, false, 1, 0, 0, 0)
    setTimer(fadeCamera, 1000, 1, l_6_0, true, 1)
    setTimer(setElementRotation, 1000, 1, l_6_0, 0, 0, 90)
    setTimer(setElementInterior, 1000, 1, l_6_0, 0, 1366.744140625, -1279.75, 13.546875)
    setTimer(setElementDimension, 1000, 1, l_6_0, 0)
  end
end

addEventHandler("onMarkerHit", getRootElement(), Exitdrob1)
Doorerob1 = function(l_7_0)
  if source == Doorentryrob1 and getElementType(l_7_0) == "player" then
    fadeCamera(l_7_0, false, 1, 0, 0, 0)
    setTimer(setElementRotation, 1000, 1, l_7_0, 0, 0, 90)
    setTimer(fadeCamera, 1000, 1, l_7_0, true, 1)
    setTimer(setElementInterior, 1000, 1, l_7_0, 4, 285.689453125, -84.826171875, 1001.515625)
    setTimer(setElementDimension, 1000, 1, l_7_0, 1)
    setTimer(outputChatBox, 2000, 1, "Digite /roubar para furtar a loja.", l_7_0, 0, 255, 255)
  end
end

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

 

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