Jump to content

Any Help Error local '<eof>' expected near 'end'


BRIMO

Recommended Posts

Quote
local safeDoors = {}
local bankTimer = nil
local playerMarker = createMarker(210.76625061035, 24.783679962158, 1.77080078125, "checkpoint", 5, 5, 200, 10, 200, root)
setMarkerSize ( playerMarker, 1 )

addEventHandler("onResourceStart", resourceRoot, function()
    safeDoors[1] = createObject(929, 209.5563873291, 24.513725280762, -2000.57080078125, 0, 0, 180)
    safeDoors[2] = createObject(929, 209.5563873291, 24.513725280762, 2.57080078125, 0, 0, 1)
end)

function handlePlayerMarker(hitElement)
    local elementType = getElementType(hitElement)

    outputChatBox("Element ("..elementType..") has entered marker.")
end
addEventHandler("onMarkerHit", playerMarker, handlePlayerMarker)
        local pX, pY, pZ = getElementPosition(player)
        local oX, oY, oZ = getElementPosition(safeDoors[2])
        if getDistanceBetweenPoints3D(pX, pY, pZ, oX, oY, oZ) <= 2 then
            if exports.fv_inventory:hasItem(player, 152, 1) then
                if getFactionMembers(53) == 0 then
                    setPedAnimation(player, "BOMBER", "BOM_Plant_Loop", -1, true, false, false)
                    exports.fv_inventory:takePlayerItem(player, 152, 1)
                    exports.fv_inventory:givePlayerItem(player,207, 2, 0, 100, 0)
                    triggerClientEvent(getElementsByType("player"), "triggerBankSound", player, "alarm2", {1143.9476318359, -1099.3721923828, 19.426834106445})

                else
                    outputChatBox(exports.fv_engine:getServerSyntax("Bank","red") .. "Error. Contact Brimo Devloper To Fix This" ,player,255,255,255,true); 
                end
            else
                outputChatBox(exports.fv_engine:getServerSyntax("Bank","red") .. "Ma3andkch lou7 !" ,player,255,255,255,true); 
            end
        end
    end
end)

spacer.png

Quote

 

 

Link to comment
  • Moderators

Moving this to the Scripting section.

At a first glance, after setting the "onMarketHit" event, you forgot to declare a function for the code down below.

So this:

addEventHandler("onMarkerHit", playerMarker, handlePlayerMarker)
        local pX, pY, pZ = getElementPosition(player)
        local oX, oY, oZ = getElementPosition(safeDoors[2])
        if getDistanceBetweenPoints3D(pX, pY, pZ, oX, oY, oZ) <= 2 then
            if exports.fv_inventory:hasItem(player, 152, 1) then
                if getFactionMembers(53) == 0 then
                    setPedAnimation(player, "BOMBER", "BOM_Plant_Loop", -1, true, false, false)
                    exports.fv_inventory:takePlayerItem(player, 152, 1)
                    exports.fv_inventory:givePlayerItem(player,207, 2, 0, 100, 0)
                    triggerClientEvent(getElementsByType("player"), "triggerBankSound", player, "alarm2", {1143.9476318359, -1099.3721923828, 19.426834106445})

                else
                    outputChatBox(exports.fv_engine:getServerSyntax("Bank","red") .. "Error. Contact Brimo Devloper To Fix This" ,player,255,255,255,true); 
                end
            else
                outputChatBox(exports.fv_engine:getServerSyntax("Bank","red") .. "Ma3andkch lou7 !" ,player,255,255,255,true); 
            end
        end
    end
end)

Should be:

addEventHandler("onMarkerHit", playerMarker, handlePlayerMarker)
function someFunction()
  	local pX, pY, pZ = getElementPosition(player)
  	local oX, oY, oZ = getElementPosition(safeDoors[2])
  	if getDistanceBetweenPoints3D(pX, pY, pZ, oX, oY, oZ) <= 2 then
    	if exports.fv_inventory:hasItem(player, 152, 1) then
      		if getFactionMembers(53) == 0 then
                setPedAnimation(player, "BOMBER", "BOM_Plant_Loop", -1, true, false, false)
                exports.fv_inventory:takePlayerItem(player, 152, 1)
                exports.fv_inventory:givePlayerItem(player,207, 2, 0, 100, 0)
                triggerClientEvent(getElementsByType("player"), "triggerBankSound", player, "alarm2", {1143.9476318359, -1099.3721923828, 19.426834106445})
      		else
        		outputChatBox(exports.fv_engine:getServerSyntax("Bank","red") .. "Error. Contact Brimo Devloper To Fix This" ,player,255,255,255,true); 
      		end
   		else
      		outputChatBox(exports.fv_engine:getServerSyntax("Bank","red") .. "Ma3andkch lou7 !" ,player,255,255,255,true); 
		end
	end
end

 

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