MesaDowN

Members
  • Content Count

    97
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MesaDowN

  1. addEventHandler('onVehicleExplode', root, setTimer(function () destroyElement(source) end, 2000, 1) )
  2. Bom dia, vim aqui esclarecer uma coisa. Estou fazendo o emprego de carregador, e o mesmo precisa de 5 caixas entregues para puder pegar o camião e sair. 1º- Quero que ao chegar no marker "Marker_Entregar[source]" , ele adicione +1 elementData. 2º Quero que quando o veículo saia dali, ele faça uma vericação se não tem nada naquele local e spawne outro veículo na mesma posição. veh_pc = {} local markercarregar = createMarker(2795.09546, -2425.29395, 13.63188-1.1, "cylinder", 2, 30,144,255) ocupado = { -- x, y, z, ocupado [1] = {2787.782, -2424.239, 13.634, 0, 0, 180, false, 2787.803, -2420.378, 13.634}, -- Esta coordenada está no seu script. [2] = {2788.123, -2410.558, 13.634, 0, 0, 0, false, 2788.146, -2414.291, 13.634}, -- Esta coordenada eu inventei. [3] = {2750, -2431.782, 13.643, 0, 0, 270, false, 2746.177, -2431.841, 13.643}, [4] = {2750, -2441.882, 13.643, 0, 0, 270, false, 2746.153, -2441.895, 13.643}, [5] = {2750, -2448.111, 13.643, 0, 0, 270, false, 2746.181, -2448.31, 13.648}, } function showMarker() local Emprego = getElementData(source, "Emprego") if Emprego == "Carregador" then for i, vaga in ipairs (ocupado) do local x, y, z, r, g, b, status, a, c, d = unpack(vaga) marcacao = createMarker( a, c, 12, "cylinder", 1.5, 30,144,255, 180 ) attachElements ( marcacao, veh_pc[source], 0, -4, -1 ) outputDebugString("02") end end end addEvent( "ShowMarkers", true) addEventHandler( "ShowMarkers", getRootElement(), showMarker) function createVeh(thePlayer) local Emprego = getElementData(source, "Emprego") for i, vaga in ipairs (ocupado) do local x, y, z, r, g, b, status, a, c, d = unpack(vaga) veh_pc[source] = createVehicle ( 414, x, y, z, r, g, b) setVehicleLocked( veh_pc[source], true) outputDebugString("01") end end addEventHandler( "onResourceStart", getRootElement(), createVeh ) function tempo(thePlayer) if getElementData(thePlayer, "veiculoalreadyspawnado") == true then setTimer(function() setElementData(source, "veiculoalreadyspawnado", false) end, 3000, 1) end end function setartempo(source) setElementData(source, "veiculoalreadyspawnado", false) end addCommandHandler("fodasse", setartempo) -------------------------------------------- --JOB-- Object_Caixa = {} Marker_Entregar = {} Blip_Entregar = {} local Blip_Emprego = createBlipAttachedTo( markercarregar, 16 ) setBlipVisibleDistance(markercarregar, 150) function Mesa_Caixa (source) local Emprego = getElementData ( source, "Emprego" ) local Px, Py, Pz = getElementPosition( markercarregar ) local Caixa = getElementData( source, "Caixa" ) if isElementWithinMarker(source, markercarregar) then if Caixa == false then if Emprego == "Carregador" then setPedAnimation( source, "CARRY", "liftup", 1.0, false ) setTimer(function() if isElement( Object_Caixa[source] ) then destroyElement( Object_Caixa[source] ) end if isElement( Marker_Entregar[source] ) then destroyElement( Marker_Entregar[source] ) end if isElement( Blip_Entregar[source] ) then destroyElement( Blip_Entregar[source] ) end setElementData(source, "Recompensa", 0) setPedAnimation( source, nil ) setElementData( source, "Caixa", true ) toggleControl( source, "jump", false ) toggleControl( source, "fire", false ) toggleControl(source, "aim_weapon", false) setPedAnimation( source, "CARRY", "crry_prtial", 4.1, true, true, true ) Object_Caixa[source] = createObject( 1271, Px, Py, Pz ) Marker_Entregar[source] = createMarker (2787.84521, -2420.40527, 13.63365-1.1, "cylinder", 2.5, 16, 111, 231, 50) Blip_Entregar[source] = createBlipAttachedTo( Marker_Entregar[source], 0 ) setElementVisibleTo ( Marker_Entregar[source], root, false ) setElementVisibleTo ( Blip_Entregar[source], root, false ) setElementVisibleTo ( Marker_Entregar[source], source, true ) setElementVisibleTo ( Blip_Entregar[source], source, true ) exports.bone_attach:attachElementToBone(Object_Caixa[source], source, 4, 0, 0.4, - 0.6, -90, 0, 0 ) end, 1000, 1) end end end end addCommandHandler("caixa", Mesa_Caixa) function Fim_Emprego (source) local Caixa = getElementData( source, "Caixa" ) local pay = math.random(100,200) local Recompensa = math.random(1, 35) if not isPedInVehicle ( source ) then if isElementWithinMarker(source, Marker_Entregar[source]) then if Caixa == true then setPedAnimation( source, "CARRY", "putdwn", 1.0, false, false, false, true ) setTimer(function() if isElement( Object_Caixa[source] ) then destroyElement( Object_Caixa[source] ) end if isElement( Marker_Entregar[source] ) then destroyElement( Marker_Entregar[source] ) end if isElement( Blip_Entregar[source] ) then destroyElement( Blip_Entregar[source] ) end setElementData( source, "Caixa", false ) toggleControl( source, "jump", true ) toggleControl( source, "fire", true ) toggleControl(source, "aim_weapon", true) setPedAnimation( source, "CARRY", "liftup", 0.0, false, false, false, false) setElementData(source,"char:money", getElementData(source,"char:money") + pay) setElementData(source,"Entregues", tonumber(getElementData(source,"Entregues") + 1)) exports.Scripts_Dxmessages:outputDx ( source, "Você entregou a caixa e ganhou: "..getElementData(source, "Recompensa").."$", "success" ) end, 1200, 1) end end end end addCommandHandler( "entregar", Fim_Emprego) fds = createMarker (2796.03687, -2420.05981, 13.63165-1.1, "cylinder", 2.5, 16, 111, 231, 50) function setardata(source) if getElementData( source, "Caixa" ) == true then setElementData( source, "Caixa", false ) end end addCommandHandler("a", setardata) function aaaa(source) cona = tonumber(getElementData(source, "Entregues")) if cona >= 1 then outputDebugString(""..cona.."") end end addEventHandler( "onMarkerHit", fds, aaaa ) addEventHandler( "onPlayerQuit", root, function() if isElement( Object_Caixa[source] ) then destroyElement( Object_Caixa[source] ) end if isElement( Marker_Entregar[source] ) then destroyElement( Marker_Entregar[source] ) end if isElement( Blip_Entregar[source] ) then destroyElement( Blip_Entregar[source] ) end end) addEventHandler( "onPlayerWasted", root, function() if isElement( Object_Caixa[source] ) then destroyElement( Object_Caixa[source] ) end if isElement( Marker_Entregar[source] ) then destroyElement( Marker_Entregar[source] ) end if isElement( Blip_Entregar[source] ) then destroyElement( Blip_Entregar[source] ) end setElementData( source, "Caixa", false ) toggleControl( source, "jump", true ) toggleControl( source, "fire", true ) toggleControl(source, "aim_weapon", true) end)
  3. Na parte servidor, na linha 23, o server está recebendo um booleano. (Danilin_S.luac), que é compilado.
  4. <meta> <info author="Amanda" type="animation" name="choro" description="Script de chorar" /> <script src="script.Lua" type="server"/> </meta> function toggleSit(thePlayer) if not getElementData(thePlayer, "sitting") then setPedAnimation(thePlayer, "ped", "seat_down", -1, false, false, false, false) setElementData(thePlayer, "sitting", true) else -- If you use again this command then your character stand up setPedAnimation(thePlayer) removeElementData(thePlayer, "sitting") end end addCommandHandler("sit", toggleSit) Tenta ai agora...
  5. Use a Função de code na proxima que for postar seu código "<>", e poste ele por completo. function pegarm4(player) if isElementWithinMarker(player, markerWeapon) then guiEdit() if getPlayerMoney(player) >= 12000 then takePlayerMoney(player, 12000) --Remover Dinheiro giveWeapon(player, 31, 300, true) --Pegar Arma outputChatBox("#ffffffVocê comprou uma M4 com 300 munições.", player, 255,255,255,true) else outputChatBox("#ff0000Você não tem dinheiro suficiente para comprar.", player, 255,255,255,true) end end end addCommandHandler("m4", pegarm4) function guiEdit() GUIEditor.window[1] = guiCreateWindow(0.32, 0.26, 0.41, 0.46, "LOJA DE ARMAS", true) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.button[1] = guiCreateButton(0.37, 0.12, 0.22, 0.11, "M4 = 12000R$", true, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FF25FC02") GUIEditor.button[2] = guiCreateButton(0.38, 0.26, 0.21, 0.11, "Deagle = 7000R$", true, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FF25FC02") GUIEditor.button[3] = guiCreateButton(0.38, 0.40, 0.20, 0.10, "Ak-47 = 15000R$", true, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[3], "NormalTextColour", "FF25FC02") GUIEditor.button[4] = guiCreateButton(0.38, 0.53, 0.20, 0.10, "MP5 = 30000", true, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[4], "NormalTextColour", "FF25FC02") end É isso?
  6. Ué, ajusta a posição do texto no 2º e 3º parametro..
  7. Porquê voce faz uma variavel de source? Sendo que source é uma variavel predefinida do MTA?
  8. Sim, coloque os codigos para que o possamos ajudar..
  9. local sx, sy = guiGetScreenSize() local queue = {} local modQueue = {} local progress = 0 local downloadSize = 0 local modsSize = 0 local scriptVersion = 1.1 local canShowThe:OingGUI = false local window, language, guiColorR, guiColorG, guiColorB local gridClicked = 0 local gridCache = 1 local gridRows = 10 addEvent(resname .. ":startDownload", true) addEventHandler(resname .. ":startDownload", localPlayer, function(table, size, lang, colorR, colorG, colorB) queue = table language = lang guiColorR, guiColorG, guiColorB = colorR, colorG, colorB for index = 1, #queue do local data = queue[index] if fileExists(data[1]) then local cf = fileOpen(data[1]) local cfSize = fileGetSize(cf) if cfSize ~= data[3] then fileDelete(cf) else size = size - cfSize fileClose(cf) end end end modsSize = size if modsSize > 0 then window = "request" showCursor(true) downloadButton = guiCreateButton((535/1366)*sx, (348/768)*sy, (107/1366)*sx, (34/768)*sy, "", false) guiSetAlpha(downloadButton, 0) cancelButton = guiCreateButton((708/1366)*sx, (348/768)*sy, (107/1366)*sx, (34/768)*sy, "", false) guiSetAlpha(cancelButton, 0) addEventHandler("onClientGUIClick", root, function() if source == downloadButton then showCursor(false) destroyElement(downloadButton) destroyElement(cancelButton) window = nil download() elseif source == cancelButton then for index = 1, #queue do local data = queue[index] if not fileExists(data[1]) then queue[index] = nil end end showCursor(false) destroyElement(downloadButton) destroyElement(cancelButton) window = nil download() end end ) else download() end end ) function download() if #queue >= 1 then downloadFile(queue[#queue][1]) else queue = {} modsSize = 0 downloadSize = 0 progress = 0 canShowThe:OingGUI = true end end function calculateW(w, progress) if w and progress then local w = w-2 local width = ((w*progress)/100) return width end return false end local lastUpdate = 0 local lastName = "" function updateDownloadSize(size) if lastName == queue[#queue] then downloadSize = (downloadSize-lastUpdate) + size else downloadSize = downloadSize + size end lastName = queue[#queue] lastUpdate = size end function dx() if #queue ~= 0 then if window == "request" then dxDrawRectangle((520/1366)*sx, (267/768)*sy, (307/1366)*sx, (125/768)*sy, tocolor(0, 0, 0, 150), true) dxDrawRectangle((520/1366)*sx, (267/768)*sy, (307/1366)*sx, (23/768)*sy, tocolor(0, 0, 0, 150), true) dxDrawText("AFK Mod Downloader v" .. scriptVersion, (520/1366)*sx, (267/768)*sy, (827/1366)*sx, (290/768)*sy, tocolor(255, 255, 255, 255), (1/1366)*sx, "default-bold", "center", "center", false, false, true, false, false) dxDrawText(translations[language].request_firstText .. "\n" .. translations[language].request_secondText .. ": " .. sizeFormat(modsSize), (520/1366)*sx, (295/768)*sy, (827/1366)*sx, (338/768)*sy, tocolor(255, 255, 255, 255), (1/1366)*sx, "default-bold", "center", "center", false, true, true, false, false) if getKeyState("mouse1") and isCursorHover((535/1366)*sx, (348/768)*sy, (107/1366)*sx, (34/768)*sy) then dxDrawRectangle((535/1366)*sx, (348/768)*sy, (107/1366)*sx, (34/768)*sy, tocolor(guiColorR, guiColorG, guiColorB, 50), true) dxDrawText(translations[language].request_downloadButton, (534/1366)*sx, (347/768)*sy, (643/1366)*sx, (380/768)*sy, tocolor(255, 255, 255, 150), (1/1366)*sx, "default-bold", "center", "center", false, false, true, false, false) elseif isCursorHover((535/1366)*sx, (348/768)*sy, (107/1366)*sx, (34/768)*sy) then dxDrawRectangle((535/1366)*sx, (348/768)*sy, (107/1366)*sx, (34/768)*sy, tocolor(guiColorR, guiColorG, guiColorB, 100), true) dxDrawText(translations[language].request_downloadButton, (534/1366)*sx, (347/768)*sy, (643/1366)*sx, (380/768)*sy, tocolor(255, 255, 255, 200), (1/1366)*sx, "default-bold", "center", "center", false, false, true, false, false) else dxDrawRectangle((535/1366)*sx, (348/768)*sy, (107/1366)*sx, (34/768)*sy, tocolor(guiColorR, guiColorG, guiColorB, 150), true) dxDrawText(translations[language].request_downloadButton, (534/1366)*sx, (347/768)*sy, (643/1366)*sx, (380/768)*sy, tocolor(255, 255, 255, 255), (1/1366)*sx, "default-bold", "center", "center", false, false, true, false, false) end if getKeyState("mouse1") and isCursorHover((708/1366)*sx, (348/768)*sy, (107/1366)*sx, (34/768)*sy) then dxDrawRectangle((708/1366)*sx, (348/768)*sy, (107/1366)*sx, (34/768)*sy, tocolor(guiColorR, guiColorG, guiColorB, 50), true) dxDrawText(translations[language].request_cancelButton, (707/1366)*sx, (347/768)*sy, (816/1366)*sx, (380/768)*sy, tocolor(255, 255, 255, 150), (1/1366)*sx, "default-bold", "center", "center", false, false, true, false, false) elseif isCursorHover((708/1366)*sx, (348/768)*sy, (107/1366)*sx, (34/768)*sy) then dxDrawRectangle((708/1366)*sx, (348/768)*sy, (107/1366)*sx, (34/768)*sy, tocolor(guiColorR, guiColorG, guiColorB, 100), true) dxDrawText(translations[language].request_cancelButton, (707/1366)*sx, (347/768)*sy, (816/1366)*sx, (380/768)*sy, tocolor(255, 255, 255, 200), (1/1366)*sx, "default-bold", "center", "center", false, false, true, false, false) else dxDrawRectangle((708/1366)*sx, (348/768)*sy, (107/1366)*sx, (34/768)*sy, tocolor(guiColorR, guiColorG, guiColorB, 150), true) dxDrawText(translations[language].request_cancelButton, (707/1366)*sx, (347/768)*sy, (816/1366)*sx, (380/768)*sy, tocolor(255, 255, 255, 255), (1/1366)*sx, "default-bold", "center", "center", false, false, true, false, false) end else if fileExists(queue[#queue][1]) then openedFile = fileOpen(queue[#queue][1]) if openedFile then local fileSize = fileGetSize(openedFile) fileClose(openedFile) updateDownloadSize(fileSize) end end dxDrawRectangle((413/1366)*sx, (599/768)*sy, (548/1366)*sx, (118/768)*sy, tocolor(0, 0, 0, 150), true) dxDrawRectangle((413/1366)*sx, (599/768)*sy, (548/1366)*sx, (23/768)*sy, tocolor(0, 0, 0, 150), true) dxDrawText("AFK Mod Downloader v" .. scriptVersion, (412/1366)*sx, (599/768)*sy, (961/1366)*sx, (622/768)*sy, tocolor(255, 255, 255, 254), (1/1366)*sx, "default-bold", "center", "center", false, false, true, false, false) dxDrawText(translations[language].firstText .. "\n" .. translations[language].secondText .. ": " .. queue[#queue][1]:gsub("files/", ""), (412/1366)*sx, (622/768)*sy, (961/1366)*sx, (666/768)*sy, tocolor(255, 255, 255, 255), (1/1366)*sx, "default-bold", "center", "center", false, false, true, false, false) local x, y, w, h = (421/1366)*sx, (673/768)*sy, (532/1366)*sx, (34/768)*sy progress = ((downloadSize*100)/modsSize) local width = calculateW(w, progress) dxDrawRectangle(x, y, w, h, tocolor(0, 0, 0, 200), true) dxDrawRectangle(x+1, y+1, w-2, h-2, tocolor(guiColorR, guiColorG, guiColorB, 50), true) dxDrawRectangle(x+1, y+1, width, h-2, tocolor(guiColorR, guiColorG, guiColorB, 150), true) dxDrawText(sizeFormat(downloadSize) .. "/" .. sizeFormat(modsSize) .. " (" .. math.floor(progress) .. "%)", x, y, w+x, h+y, tocolor(255, 255, 255, 255), (1/1366)*sx, "default-bold", "center", "center", false, false, true, false, false) end end if window == "select" then dxDrawRectangle((431/1366)*sx, (164/768)*sy, (502/1366)*sx, (366/768)*sy, tocolor(0, 0, 0, 150), true) dxDrawRectangle((431/1366)*sx, (164/768)*sy, (502/1366)*sx, (23/768)*sy, tocolor(0, 0, 0, 150), true) dxDrawRectangle((573/1366)*sx, (196/768)*sy, (351/1366)*sx, (276.5/768)*sy, tocolor(0, 0, 0, 176), true) dxDrawText("AFK Mod Downloader v1.1", (430/1366)*sx, (162/768)*sy, (933/1366)*sx, (187/768)*sy, tocolor(255, 255, 255, 255), (1/1366)*sx, "default-bold", "center", "center", false, false, true, false, false) if isCursorHover((440/1366)*sx, (197/768)*sy, (112/1366)*sx, (36/768)*sy) then dxDrawRectangle((440/1366)*sx, (197/768)*sy, (112/1366)*sx, (36/768)*sy, tocolor(guiColorR, guiColorG, guiColorB, 180), true) dxDrawText(translations[language].gui_activateSelected, (439/1366)*sx, (197/768)*sy, (552/1366)*sx, (233/768)*sy, tocolor(255, 255, 255, 150), (1/1366)*sx, "default-bold", "center", "center", false, false, true, false, false) else dxDrawRectangle((440/1366)*sx, (197/768)*sy, (112/1366)*sx, (36/768)*sy, tocolor(guiColorR, guiColorG, guiColorB, 200), true) dxDrawText(translations[language].gui_activateSelected, (439/1366)*sx, (197/768)*sy, (552/1366)*sx, (233/768)*sy, tocolor(255, 255, 255, 255), (1/1366)*sx, "default-bold", "center", "center", false, false, true, false, false) end if isCursorHover((440/1366)*sx, (243/768)*sy, (112/1366)*sx, (36/768)*sy) then dxDrawRectangle((440/1366)*sx, (243/768)*sy, (112/1366)*sx, (36/768)*sy, tocolor(guiColorR, guiColorG, guiColorB, 180), true) dxDrawText(translations[language].gui_desactiveSelected, (439/1366)*sx, (243/768)*sy, (552/1366)*sx, (279/768)*sy, tocolor(255, 255, 255, 150), (1/1366)*sx, "default-bold", "center", "center", false, false, true, false, false) else dxDrawRectangle((440/1366)*sx, (243/768)*sy, (112/1366)*sx, (36/768)*sy, tocolor(guiColorR, guiColorG, guiColorB, 200), true) dxDrawText(translations[language].gui_desactiveSelected, (439/1366)*sx, (243/768)*sy, (552/1366)*sx, (279/768)*sy, tocolor(255, 255, 255, 255), (1/1366)*sx, "default-bold", "center", "center", false, false, true, false, false) end if isCursorHover((440/1366)*sx, (291/768)*sy, (112/1366)*sx, (36/768)*sy) then dxDrawRectangle((440/1366)*sx, (291/768)*sy, (112/1366)*sx, (36/768)*sy, tocolor(guiColorR, guiColorG, guiColorB, 180), true) dxDrawText(translations[language].gui_activeAll, (439/1366)*sx, (291/768)*sy, (552/1366)*sx, (327/768)*sy, tocolor(255, 255, 255, 150), (1/1366)*sx, "default-bold", "center", "center", false, false, true, false, false) else dxDrawRectangle((440/1366)*sx, (291/768)*sy, (112/1366)*sx, (36/768)*sy, tocolor(guiColorR, guiColorG, guiColorB, 200), true) dxDrawText(translations[language].gui_activeAll, (439/1366)*sx, (291/768)*sy, (552/1366)*sx, (327/768)*sy, tocolor(255, 255, 255, 255), (1/1366)*sx, "default-bold", "center", "center", false, false, true, false, false) end if isCursorHover((440/1366)*sx, (337/768)*sy, (112/1366)*sx, (36/768)*sy) then dxDrawRectangle((440/1366)*sx, (337/768)*sy, (112/1366)*sx, (36/768)*sy, tocolor(guiColorR, guiColorG, guiColorB, 180), true) dxDrawText(translations[language].gui_disAll, (439/1366)*sx, (337/768)*sy, (552/1366)*sx, (373/768)*sy, tocolor(255, 255, 255, 150), (1/1366)*sx, "default-bold", "center", "center", false, false, true, false, false) else dxDrawRectangle((440/1366)*sx, (337/768)*sy, (112/1366)*sx, (36/768)*sy, tocolor(guiColorR, guiColorG, guiColorB, 200), true) dxDrawText(translations[language].gui_disAll, (439/1366)*sx, (337/768)*sy, (552/1366)*sx, (373/768)*sy, tocolor(255, 255, 255, 255), (1/1366)*sx, "default-bold", "center", "center", false, false, true, false, false) end if isCursorHover((594/1366)*sx, (483/768)*sy, (175/1366)*sx, (36/768)*sy) then dxDrawRectangle((594/1366)*sx, (483/768)*sy, (175/1366)*sx, (36/768)*sy, tocolor(guiColorR, guiColorG, guiColorB, 180), true) dxDrawText(translations[language].gui_close, (594/1366)*sx, (483/768)*sy, (769/1366)*sx, (519/768)*sy, tocolor(255, 255, 255, 150), (1/1366)*sx, "default-bold", "center", "center", false, false, true, false, false) else dxDrawRectangle((594/1366)*sx, (483/768)*sy, (175/1366)*sx, (36/768)*sy, tocolor(guiColorR, guiColorG, guiColorB, 200), true) dxDrawText(translations[language].gui_close, (594/1366)*sx, (483/768)*sy, (769/1366)*sx, (519/768)*sy, tocolor(255, 255, 255, 255), (1/1366)*sx, "default-bold", "center", "center", false, false, true, false, false) end y = (197/768)*sy for index = gridCache, (gridCache+gridRows) do local mods = modQueue[index] if index <= #modQueue then x, y, w, h = (574/1366)*sx, y, (349/1366)*sx, (24/768)*sy if gridClicked == index then dxDrawRectangle(x, y, w, h, tocolor(guiColorR, guiColorG, guiColorB, 255), true) if isVehicle(tonumber(mods[2])) then dxDrawText(mods[3] .. " (" .. getVehicleNameFromModel(tonumber(mods[2])) .. ")" .. " - " .. (mods[4] and tostring(translations[language].gui_enableState) or tostring(translations[language].gui_disableState)), x+(5/1366)*sx, y, w+x, h+y, tocolor(255, 255, 255, 255), (1/1366)*sx, "default-bold", "left", "center", false, false, true, false, false) elseif isSkin(tonumber(mods[2])) then dxDrawText(mods[3] .. " (Skin " .. mods[2] .. ")" .. " - " .. (mods[4] and tostring(translations[language].gui_enableState) or tostring(translations[language].gui_disableState)), x+(5/1366)*sx, y, w+x, h+y, tocolor(255, 255, 255, 255), (1/1366)*sx, "default-bold", "left", "center", false, false, true, false, false) else dxDrawText(mods[3] .. " (Object " .. mods[2] .. ")" .. " - " .. (mods[4] and tostring(translations[language].gui_enableState) or tostring(translations[language].gui_disableState)), x+(5/1366)*sx, y, w+x, h+y, tocolor(255, 255, 255, 255), (1/1366)*sx, "default-bold", "left", "center", false, false, true, false, false) end elseif isCursorHover(x, y, w, h) and gridClicked ~= index then dxDrawRectangle(x, y, w, h, tocolor(guiColorR, guiColorG, guiColorB, 100), true) if isVehicle(tonumber(mods[2])) then dxDrawText(mods[3] .. " (" .. getVehicleNameFromModel(tonumber(mods[2])) .. ")" .. " - " .. (mods[4] and tostring(translations[language].gui_enableState) or tostring(translations[language].gui_disableState)), x+(5/1366)*sx, y, w+x, h+y, tocolor(255, 255, 255, 155), (1/1366)*sx, "default-bold", "left", "center", false, false, true, false, false) elseif isSkin(tonumber(mods[2])) then dxDrawText(mods[3] .. " (Skin " .. mods[2] .. ")" .. " - " .. (mods[4] and tostring(translations[language].gui_enableState) or tostring(translations[language].gui_disableState)), x+(5/1366)*sx, y, w+x, h+y, tocolor(255, 255, 255, 155), (1/1366)*sx, "default-bold", "left", "center", false, false, true, false, false) else dxDrawText(mods[3] .. " (Object " .. mods[2] .. ")" .. " - " .. (mods[4] and tostring(translations[language].gui_enableState) or tostring(translations[language].gui_disableState)), x+(5/1366)*sx, y, w+x, h+y, tocolor(255, 255, 255, 155), (1/1366)*sx, "default-bold", "left", "center", false, false, true, false, false) end if getKeyState("mouse1") then gridClicked = index end else dxDrawRectangle(x, y, w, h, tocolor(guiColorR, guiColorG, guiColorB, 50), true) if isVehicle(tonumber(mods[2])) then dxDrawText(mods[3] .. " (" .. getVehicleNameFromModel(tonumber(mods[2])) .. ")" .. " - " .. (mods[4] and tostring(translations[language].gui_enableState) or tostring(translations[language].gui_disableState)), x+(5/1366)*sx, y, w+x, h+y, tocolor(255, 255, 255, 255), (1/1366)*sx, "default-bold", "left", "center", false, false, true, false, false) elseif isSkin(tonumber(mods[2])) then dxDrawText(mods[3] .. " (Skin " .. mods[2] .. ")" .. " - " .. (mods[4] and tostring(translations[language].gui_enableState) or tostring(translations[language].gui_disableState)), x+(5/1366)*sx, y, w+x, h+y, tocolor(255, 255, 255, 255), (1/1366)*sx, "default-bold", "left", "center", false, false, true, false, false) else dxDrawText(mods[3] .. " (Object " .. mods[2] .. ")" .. " - " .. (mods[4] and tostring(translations[language].gui_enableState) or tostring(translations[language].gui_disableState)), x+(5/1366)*sx, y, w+x, h+y, tocolor(255, 255, 255, 255), (1/1366)*sx, "default-bold", "left", "center", false, false, true, false, false) end end y = y + (25/768)*sy end end end end addEventHandler("onClientFileDownloadComplete", root, function(file) if duplicates(queue[#queue][2], modQueue) then table.insert(modQueue, {queue[#queue][1], queue[#queue][2], queue[#queue][4], false}) end table.remove(queue, #queue) download() end ) addCommandHandler("mods", function() window = "select" gui_closeButton = guiCreateButton((594/1366)*sx, (483/768)*sy, (175/1366)*sx, (36/768)*sy, "Fechar", false) guiSetAlpha(gui_closeButton, 255) gui_activeSelected = guiCreateButton((440/1366)*sx, (197/768)*sy, (112/1366)*sx, (36/768)*sy, "Ativar o Selecionado", false) guiSetAlpha(gui_activeSelected, 255) gui_desactiveSelected = guiCreateButton((440/1366)*sx, (243/768)*sy, (112/1366)*sx, (36/768)*sy, "Desativar o Selecionado", false) guiSetAlpha(gui_desactiveSelected, 255) gui_activeAll = guiCreateButton((440/1366)*sx, (291/768)*sy, (112/1366)*sx, (36/768)*sy, "Ativar tudo", false) guiSetAlpha(gui_activeAll, 255) gui_desactiveAll = guiCreateButton((440/1366)*sx, (337/768)*sy, (112/1366)*sx, (36/768)*sy, "Desativar Tudo", false) guiSetAlpha(gui_desactiveAll, 255) showCursor(true) addEventHandler("onClientRender", root, dx) addEventHandler("onClientGUIClick", root, function() if source == gui_activeSelected then if gridClicked > 0 then if modQueue[gridClicked][4] == false then local filePath = modQueue[gridClicked][1]:gsub(".txd", ""):gsub(".dff", "") local model = modQueue[gridClicked][2] if fileExists(filePath .. ".txd") then modQueue[gridClicked][4] = true local txd = engineLoadTXD(filePath .. ".txd") engineImportTXD(txd, model) end if fileExists(filePath .. ".dff") then modQueue[gridClicked][4] = true local dff = engineLoadDFF(filePath .. ".dff") engineReplaceModel(dff, model) end end end elseif source == gui_desactiveSelected then if gridClicked > 0 then if modQueue[gridClicked][4] == true then local model = modQueue[gridClicked][2] modQueue[gridClicked][4] = false engineRestoreModel(model) end end elseif source == gui_activeAll then for _, data in ipairs(modQueue) do if data[4] == false then local filePath = data[1]:gsub(".txd", ""):gsub(".dff", "") local model = data[2] if fileExists(filePath .. ".txd") then data[4] = true local txd = engineLoadTXD(filePath .. ".txd") engineImportTXD(txd, model) end if fileExists(filePath .. ".dff") then data[4] = true local dff = engineLoadDFF(filePath .. ".dff") engineReplaceModel(dff, model) end end end elseif source == gui_desactiveAll then for _, data in ipairs(modQueue) do if data[4] == true then data[4] = false engineRestoreModel(data[2]) end end elseif source == gui_closeButton then destroyElement(gui_closeButton) destroyElement(gui_activeSelected) destroyElement(gui_desactiveSelected) destroyElement(gui_activeAll) destroyElement(gui_desactiveAll) window = nil gridClicked = 0 gridCache = 1 showCursor(false) end end ) end ) bindKey( "mouse_wheel_up", "down", function () if #modQueue >= gridRows + 1 then gridCache = math.max(gridCache - 1, 1) end end ) bindKey( "mouse_wheel_down", "down", function () if #modQueue >= gridRows + 1 then gridCache = math.min(gridCache + 1, #modQueue-gridRows) end end )
  10. Você deve fazer o seguinte.. local cx, cy, cz = getElementPosition ( loot ) --Aqui você deve colocar a posição do loot.. local px, py, pz = getElementPosition ( source ) --Aqui você acha a localização do player. local distancia = getDistanceBetweenPoints3D ( cx, cy, cz, px, py, pz ) if distancia >= 2 then --Caso a distância seja maior ou igual que "x", então..
  11. Eu testei aqui e funcionou..Tenta pelo console..
  12. Cara, posta o código do chat, não tem como te ajudar sem o codigo completo..
  13. Já foi respondido no discord pelo iDannz [Breno]#2456 Vou postar o que ele enviou: function removeHex(s) return string.gsub(s,"#%x%x%x%x%x%x", "") end
  14. Você pode usar onVehicleEnter e dar attachElements..
  15. Pois, ele deveria ter mostrado o código..
  16. Criar uma table para cada localização? Não sei muito sobre tables..
  17. Usar uma table para setar os blips, e no momento em que for destruir, destruir o elemento da tabela funcionaria?
  18. Tente assim! addEventHandler ( "onPlayerLogin", root, function ( _, acc ) setTimer ( Carregar_TS, 50, 1, acc ) end ) function Carregar_TS ( conta ) if not isGuestAccount ( conta ) then if conta then local source = getAccountPlayer ( conta ) local Porte = getAccountData ( conta, "Porte1" ) or 0 setElementData ( source, "Porte1", Porte ) end end end function Iniciar_Resource ( res ) if res == getThisResource ( ) then for i, player in ipairs(getElementsByType("player")) do local acc = getPlayerAccount ( player ) if not isGuestAccount ( acc ) then Carregar_TS ( acc ) end end end end addEventHandler ( "onResourceStart", getRootElement ( ), Iniciar_Resource ) function Salvar_TS ( conta ) if conta then local source = getAccountPlayer ( conta ) local Porte = getElementData ( source, "Porte1" ) or 0 setAccountData ( conta, "Porte1", Porte ) end end function Desligar_TS ( res ) if res == getThisResource ( ) then for i, player in ipairs(getElementsByType("player")) do local acc = getPlayerAccount ( player ) if not isGuestAccount ( acc ) then Salvar_TS ( acc ) end end end end addEventHandler ( "onResourceStop", getRootElement(), Desligar_TS ) function Sair_TS_Servidor ( quitType ) local acc = getPlayerAccount(source) if not isGuestAccount ( acc ) then if acc then Salvar_TS ( acc ) end end end addEventHandler ( "onPlayerQuit", getRootElement(), Sair_TS_Servidor ) Tenta ai, não testei..
  19. Eu não entendi nada até agora do que você está querendo fazer. Use pontos, vírgulas, para tornar mais facil o entendimento da situação e explique o que você deseja e o que está dando errado, caso contrário estaremos gastando nosso tempo, sendo que nem é isso que você quer