Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/01/21 in all areas

  1. Voce basicamente so teria que adicionar () ao lado da funcao caso n tenha nenhum orientador! function Entregar_Sucata() Ficando desta forma.
    1 point
  2. 1 point
  3. Omg kkkkkk, thanks you. Worked
    1 point
  4. Is this client ? You sure it’s localplayer and not localPlayer ?
    1 point
  5. It would be nice to mention that's possible due of work of @Einheit-101 and @Saml1er
    1 point
  6. Vou marcar as linhas e colocar -- na frente dos erros function ObjetosDaLoja(_,state) if RelatividadeAgencia == true then if state == "down" then if isCursorOnElement(x*470, y*357, x*160, y*25) then setElementData(localPlayer, "Emprego", false) -- -- NÃO SE USA SOURCE NO CLIENT, SE USA LOCALPLAYER / SE VOCÊ SETAR O EMPREGO COMO FALSE DEPOIS DE DAR O EMPREGO, ELE RETIRA O EMPREGO triggerServerEvent("CandidatarEmpregoGerente", localPlayer) -- NÃO SE USA SOURCE NO CLIENT, SE USA LOCALPLAYER / SE VOCÊ COLOCA COMO ARGUMENTO (SOURCE) NO SERVER VOCê TEM QUE ARGUMENTAR 2X O LOCALPLAYER EXEMPLO triggerServerEvent("CandidatarEmpregoGerente", localPlayer,localPlayer), Por isso não é necessário argumentar se você for usar trigger FecharAgenciaEmpregos() end end end end addEventHandler("onClientClick", getRootElement(), ObjetosDaLoja) function CandidatarEmpregoGerente() -- VOCÊ ARGUMENTO LEVEL SENDO QUE NÃO USA ELE PARA NADA NO TRIGGER, / E A MESMA COISA DO SOURCE, QUANDO VOCÊ USA TRIGGER VOCÊ NÃO PRECISA ARGUMENTAR O SOURCE local Level = getElementData(source, "Level") or 0 if Level >= 50 then triggerClientEvent(source, "PerguntasGerente",source) -- NÃO USE GETROOTELEMENT, ISSO SERIA PARA ESPECIFICAR TODOS setElementData(source, "QuestaoAGENCIA", 1) setElementData(source, "Resposta", nil) end end addEvent("CandidatarEmpregoGerente", true) addEventHandler("CandidatarEmpregoGerente", getRootElement(), CandidatarEmpregoGerente)
    1 point
  7. It's usually because: - Shader doesn't define the material name of custom upgrade part, or the part of that vehicle model which is the upgrade.. which it applies the reflection to. For example, check below spoiler for the list of material names used by resource "carshine_reflection_shader" (click link for community download of said resource), which aims for wide compatibility with mods due to the assortment of material names (as many mods would use for example "chassis", "remap_body", "remap", etcetera.. for the largest surface of the vehicle): Then still, there can easily be mods that use unique material names invented by the model creator. So, the first step would be identifying the material name and add it into the shader script.. for identifying, well obviously the material name is always in the TXD (name of the texture - what it matches to, e.g you're looking for the chassis or body, you can see which texture is for that part and copy its name) or get it from your modelling program, e.g in 3DS Max you hit the "M" button and click the appropiate part of the model in viewport to navigate to its materials and properties. 2) Material itself doesn't support reflection.. modellers can do many things in material properties within their modelling/3D software, or port over, materials that aren't compatible with some or all of the reflection techniques. If you add the material name to the shader script like the above, and it doesn't render reflection, you know enough and should probably revise or re-do the material.
    1 point
  8. function CandidatarEmpregoGerente() -- VOCÊ NÃO PRECISA ARGUMENTAR LEVEL SE VOCÊ COLOCOU EM BAIXO NO IF LEVEL >= 50 local Level = getElementData(source, "Level") or 0 if Level >= 50 then triggerClientEvent(source, "PerguntasGerente", getRootElement()) setElementData(source, "QuestaoAGENCIA", 1) setElementData(source, "Resposta", nil) end end addEvent("CandidatarEmpregoGerente", true) addEventHandler("CandidatarEmpregoGerente", getRootElement(), CandidatarEmpregoGerente) triggerEvent("CandidatarEmpregoGerente",source) ou triggerServerEvent("CandidatarEmpregoGerente",localPlayer)
    1 point
  9. You could apply the effect only when the elements are streamed in, that would be an enormous improved in terms of performance. -- already streamed in elements for i,peds in ipairs (getElementsByType ("ped", root, true)) do for i,players in ipairs (getElementsByType ("player", root, true)) do setElementCollidableWith (peds,players,false) end for i,vehicles in ipairs (getElementsByType ("vehicle", root, true)) do setElementCollidableWith (peds,vehicles,false) end for i,objects in ipairs (getElementsByType ("object", root, true)) do setElementCollidableWith (peds,objects,false) end end -- -- new streamed in elements local acceptedElementTypes = {player = true, vehicle = true, object = true} addEventHandler( "onClientElementStreamIn", root, function ( ) local elementType = getElementType( source ) if acceptedElementTypes[elementType] then local peds = getElementsByType ("ped", root, true) for i=1, #peds do local ped = peds[i] setElementCollidableWith (ped,source,false) end elseif elementType == "ped" then -- what if it is a new ped? You can program this step yourself. end end )
    1 point
  10. Um cliente não consegue se comunicar com outro sem o servidor. Logo, todas as variáveis client-side são visíveis somente por ele e não pelos outros.
    1 point
  11. Cool. Hope u guys can resurrect roleplaying in MTA. RP in gta 5 is boring. Good luck boiz.
    1 point
  12. You have to use one of onDamage events to detect hits/falls/etc, onPlayerDamage for example. And you can disable jumping/shooting with toggleControl.
    1 point
  13. To draw the radar on screen you should use: dxDrawRectangle - for outline, style, etc dxDrawImageSection - putting the actual radar on screen with zooming support addEventHandler using the onClientRender event dxCreateRenderTarget and dxSetRenderTarget for drawing map information inside of a rectangle only (scissor rectangle) To prevent the original radar from rendering you should use: setPlayerHUDComponentVisible To query radar center and other relevant information map information you should use: getCamera getElementRotation getElementsByType using "radararea", "blip", "player", etc getElementPosition the radararea functions But I have to inform you that those functions alone will not make you a radar. You need to have a good understanding of how your radar should work, including the math behind it as well as the conventions to integrate it seamlessly into the Rockstar vision (north is into x=0,y=1 direction, etc). For advanced effects you should use: dxDrawImage using shaders Here are neat references for already implemented radars or map scripts: https://forum.multitheftauto.com/topic/122958-getworldfrommapposition/?do=findComment&comment=974403 https://forum.multitheftauto.com/topic/122507-help-dxradar-blip-problem/?tab=comments#comment-972908 https://forum.multitheftauto.com/topic/122303-help-why-this-doesnt-draw/?tab=comments#comment-972209 Since there are many threads on MTA forums about radar-logic that went unanswered feel free to post questions here. Maybe we can get this radar done together
    1 point
  14. Deve ter aparecido um símbolo invisível quando vc copiou do fórum. Delete e reescreva a linha 70. Se o problema persistir na linha 71, faça o mesmo na linha 71.
    1 point
  15. Vai precisar da função útil dxDrawProgressBar e um interpolateBetween. function onClientClick(button, state) if isEventHandlerAdded("onClientRender", root, onClientRender) and isEventHandlerAdded("onClientClick", root, onClientClick) then if button == "left" and state == "up" then if isMouseInPosition(x*730, y*570, x*151, y*33) then triggerServerEvent("comprarCocaina", resourceRoot) elseif isMouseInPosition(x*489, y*570, x*151, y*33) then start = getTickCount() -- Salva o momento atual para usar no cálculo do progresso da interpolação. addEventHandler("onClientRender", root, interpolationRender) -- Inicia a interpolação. elseif isMouseInPosition(x*843, y*168, x*918, y*234) then showCursor(false) removeEventHandler("onClientRender", root, onClientRender) removeEventHandler("onClientClick", root, onClientClick) end end end end -- Está faltando evento ativador da função acima. E você não deve usar nomes de eventos como nome das funções. function interpolationRender() local now = getTickCount() -- A cada frame, pega o momento atual. local endTime = start + 3000 -- Duração dessa interpolação: 3 segundos. (momento do final = início + 3 segundos) local elapsedTime = now - start -- Tempo que já passou neste frame: momento de agora - momento que começou local duration = endTime - start -- Duração total da interpolação: momento do final - momento que começou local progress = elapsedTime / duration -- Progresso atual da interpolação: tempo que já passou dividido pela duração (pois o progresso é de 0 até 1) if (progress > 1) then -- Quando concluir a barra, para de renderizar ela e ativa o trigger. removeEventHandler ("onClientRender", root, interpolationRender) start = nil return triggerServerEvent ("comprarMaconha", resourceRoot) end local barra = interpolateBetween (0, 0, 0, 100, 0, 0, progress, "Linear") -- barra vai de 0 até 100 dependendo do progresso atual. dxDrawProgressBar (10, 10, 200, 200, barra, tocolor (250, 50, 50, 255), tocolor (255, 255, 255, 255)) -- Barra aleatória, arrume a posição e tamanho dela para o seu script. end local unlerp = function(from,to,lerp) return (lerp-from)/(to-from) end function dxDrawProgressBar( startX, startY, width, height, progress, color, backColor ) -- Função útil. local progress = math.max( 0, (math.min( 100, progress) ) ) local wBar = width*.18 for i = 0, 4 do --back local startPos = (wBar*i + (width*.025)*i) + startX dxDrawRectangle( startPos, startY, wBar, height, backColor ) --progress local eInterval = (i*20) local localProgress = math.min( 1, unlerp( eInterval, eInterval + 20, progress ) ) if localProgress > 0 then dxDrawRectangle( startPos, startY, wBar*localProgress, height, color ) end end end
    1 point
×
×
  • Create New...