local var = {
markers = {},
}
local Usando = {}
local itemobj = {}
addEventHandler("onResourceStart", resourceRoot,
function (res)
if res == getThisResource() then
for i, v in pairs(Config.MarkerBebedouro) do
var.markers[i] = createMarker(v[1], v[2], v[3]- 0.9, "cylinder", 2.5, 0, 0, 0, 255)
addCommandHandler("teste",
function (thePlayer)
if isElementWithinMarker(thePlayer, var.markers[i]) then
setElementFrozen(thePlayer, true)
toggleAllControls (thePlayer, false)
setElementFrozen(thePlayer, true)
setPedAnimation(thePlayer, "bd_fire", "wash_up", 1, true, true, true, true)
MX_TakeItem(thePlayer, item, 1,slot)
Usando[thePlayer] = true
itemobj[thePlayer] = createObject(1950, x, y, z)
setElementDimension(itemobj[thePlayer], dim)
setElementInterior(itemobj[thePlayer], int)
exports.bone_attach:attachElementToBone(itemobj[thePlayer], thePlayer, 11, -0.10, 0.06, 0.14, -2, 90,-15)
setTimer(function()
destroyElement(itemobj[thePlayer])
itemobj[thePlayer] = nil
Usando[thePlayer] = nil
setPedAnimation(thePlayer, "bd_fire", "wash_up", 1, false, false, false, false)
setElementFrozen(thePlayer, false)
MX_GiveItem(thePlayer, "agua", 1, slot)
setElementFrozen(thePlayer, false)
toggleAllControls (thePlayer, true )
end, 5000*quantidade, 1)
end)
end
end
end
end)
Brother, quando for mandar algum código. Pode mandar completo, por favor?