-
Posts
15 -
Joined
-
Last visited
About Nome Nome
- Birthday 30/09/2003
Details
-
Location
Brasil
-
Interests
Programação-Lua
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
Nome Nome's Achievements
Square (6/54)
1
Reputation
-
[AJUDA]Estou com problemas num script de MTA no ServerSide
Nome Nome replied to ThigasDEV's topic in Programação em Lua
Só pra relevar um pouco, não se usa source como parâmetro de função. -
Eu até fiz o teste aqui e foi, só que agora que você falou isso eu lembrei que não vi se ele ficava salvo no pc. Vou fazer o teste. Edit: Tem razão não funciona, não me atentei na parte da tag, mas o que vale é a intenção de ajudar.
-
Sim. Exemplo: <file src="Exemplo.png" cache="false"/>
-
https://wiki.multitheftauto.com/wiki/Meta.xml User o cache como "false". Assim fara com que o arquivo não fique salvo no pc do player. Mas tem um porem, toda vez que o player entrar terá que baixar o arquivo novamente. Exemplo: <script src="riemann_z_demonstration.lua" type="client" cache="false"/>
-
Problemas que eu não to conseguindo arrumar no script
Nome Nome replied to Nome Nome's topic in Programação em Lua
Movimentando -
Problemas que eu não to conseguindo arrumar no script
Nome Nome posted a topic in Programação em Lua
local screenW,screenH = guiGetScreenSize() local resW, resH = 1366,768 local x, y = (screenW/resW), (screenH/resH) PainelLoja = false function Painel () Imagens = getElementData(getLocalPlayer(), "Imagens") dxDrawImage(screenW * 0.5879, screenH * 0.2591, screenW * 0.4023, screenH * 0.5547, "Imagens/Fundo.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage(screenW * 0.5879, screenH * 0.3060, screenW * 0.1953, screenH * 0.4609, "Portfolio/"..Imagens..".png", 0, 0, 0, tocolor(255, 255, 255, 255), false) if cursorPosition(screenW * 0.7939, screenH * 0.3060, screenW * 0.1953, screenH * 0.0391) then dxDrawImage(screenW * 0.7939, screenH * 0.3060, screenW * 0.1953, screenH * 0.0391, "Imagens/Mascara-1.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end if cursorPosition(screenW * 0.7939, screenH * 0.3529, screenW * 0.1953, screenH * 0.0391) then dxDrawImage(screenW * 0.7939, screenH * 0.3529, screenW * 0.1953, screenH * 0.0391, "Imagens/Mascara-2.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end if cursorPosition(screenW * 0.7939, screenH * 0.3997, screenW * 0.1953, screenH * 0.0391) then dxDrawImage(screenW * 0.7939, screenH * 0.3997, screenW * 0.1953, screenH * 0.0391, "Imagens/Mascara-3.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end if cursorPosition(screenW * 0.7939, screenH * 0.4466, screenW * 0.1953, screenH * 0.0391) then dxDrawImage(screenW * 0.7939, screenH * 0.4466, screenW * 0.1953, screenH * 0.0391, "Imagens/Mascara-4.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end if cursorPosition(screenW * 0.7939, screenH * 0.4935, screenW * 0.1953, screenH * 0.0391) then dxDrawImage(screenW * 0.7939, screenH * 0.4935, screenW * 0.1953, screenH * 0.0391, "Imagens/Mascara-5.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end if cursorPosition(screenW * 0.7939, screenH * 0.5404, screenW * 0.1953, screenH * 0.0391) then dxDrawImage(screenW * 0.7939, screenH * 0.5404, screenW * 0.1953, screenH * 0.0391, "Imagens/Mascara-6.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end if cursorPosition(screenW * 0.7939, screenH * 0.5872, screenW * 0.1953, screenH * 0.0391) then dxDrawImage(screenW * 0.7939, screenH * 0.5872, screenW * 0.1953, screenH * 0.0391, "Imagens/Mascara-7.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end if cursorPosition(screenW * 0.7939, screenH * 0.6341, screenW * 0.1953, screenH * 0.0391) then dxDrawImage(screenW * 0.7939, screenH * 0.6341, screenW * 0.1953, screenH * 0.0391, "Imagens/Mascara-8.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end if cursorPosition(screenW * 0.7949, screenH * 0.6810, screenW * 0.1953, screenH * 0.0391) then dxDrawImage(screenW * 0.7949, screenH * 0.6810, screenW * 0.1953, screenH * 0.0391, "Imagens/Mascara-9.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end if cursorPosition(screenW * 0.7939, screenH * 0.7279, screenW * 0.1953, screenH * 0.0391) then dxDrawImage(screenW * 0.7939, screenH * 0.7279, screenW * 0.1953, screenH * 0.0391, "Imagens/Mascara-10.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end if cursorPosition(screenW * 0.7939, screenH * 0.7747, screenW * 0.1953, screenH * 0.0391) then dxDrawImage(screenW * 0.7939, screenH * 0.7747, screenW * 0.1953, screenH * 0.0391, "Imagens/Fechar.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end if cursorPosition(screenW * 0.6074, screenH * 0.7773, screenW * 0.0244, screenH * 0.0326) then dxDrawImage(screenW * 0.6074, screenH * 0.7773, screenW * 0.0244, screenH * 0.0326, "Imagens/Seta.png", -180, 0, 0, tocolor(255, 255, 255, 255), false) end if cursorPosition(screenW * 0.7393, screenH * 0.7773, screenW * 0.0244, screenH * 0.0326) then dxDrawImage(screenW * 0.7393, screenH * 0.7773, screenW * 0.0244, screenH * 0.0326, "Imagens/Seta.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) end end function SelecionarImagens(_,state) if isEventHandlerAdded("onClientRender", getRootElement(), Painel) then if state == "down" then if isCursorOnElement(screenW * 0.6074, screenH * 0.7773, screenW * 0.0244, screenH * 0.0326) then if Imagens > 1 then setElementData(getLocalPlayer(), "Imagens", Imagens - 1) end end if isCursorOnElement(screenW * 0.7393, screenH * 0.7773, screenW * 0.0244, screenH * 0.0326) then if Imagens < 10 then setElementData(getLocalPlayer(), "Imagens", Imagens + 1) end end end end end addEventHandler("onClientClick", root, SelecionarImagens) function AbrirPainel() if PainelLoja == false then addEventHandler ("onClientRender", root, Painel) showCursor (true) PainelLoja = true end end addEvent("PainelAbrir", true) addEventHandler("PainelAbrir", getRootElement(), AbrirPainel) function FecharPainelLoja () if PainelLoja == true then removeEventHandler ( "onClientRender", root, Painel ) showCursor ( false ) PainelLoja = false end end addEvent ( "Fechar:PainelLoja", true) addEventHandler ( "Fechar:PainelLoja", root, FecharPainelLoja ) function FecharXLoja (_,state) if PainelLoja == true then if state == "down" then if isCursorOnElement ( screenW * 0.7939, screenH * 0.7747, screenW * 0.1953, screenH * 0.0391 ) then removeEventHandler ( "onClientRender", root, Painel ) showCursor ( false ) PainelLoja = false end end end end addEventHandler ( "onClientClick", root, FecharXLoja ) function CompMask1 (_,state) if PainelLoja == true then if state == "down" then if isCursorOnElement(screenW * 0.7939, screenH * 0.3060, screenW * 0.1953, screenH * 0.0391) then triggerServerEvent ("CompMask11", getLocalPlayer(), localPlayer) end end end end addEventHandler ("onClientClick", root, CompMask1) function CompMask2 (_,state) if PainelLoja == true then if state == "down" then if isCursorOnElement(screenW * 0.7939, screenH * 0.3529, screenW * 0.1953, screenH * 0.0391) then triggerServerEvent ("CompMask21", getLocalPlayer(), localPlayer) end end end end addEventHandler ("onClientClick", root, CompMask2) function CompMask3 (_,state) if PainelLoja == true then if state == "down" then if isCursorOnElement(screenW * 0.7939, screenH * 0.3997, screenW * 0.1953, screenH * 0.0391) then triggerServerEvent ("CompMask31", getLocalPlayer(), localPlayer) end end end end addEventHandler ("onClientClick", root, CompMask3) function CompMask4 (_,state) if PainelLoja == true then if state == "down" then if isCursorOnElement(screenW * 0.7939, screenH * 0.4466, screenW * 0.1953, screenH * 0.0391) then triggerServerEvent ("CompMask41", getLocalPlayer(), localPlayer) end end end end addEventHandler ("onClientClick", root, CompMask4) function CompMask5 (_,state) if PainelLoja == true then if state == "down" then if isCursorOnElement(screenW * 0.7939, screenH * 0.4935, screenW * 0.1953, screenH * 0.0391) then triggerServerEvent ("CompMask51", getLocalPlayer(), localPlayer) end end end end addEventHandler ("onClientClick", root, CompMask5) function CompMask6 (_,state) if PainelLoja == true then if state == "down" then if isCursorOnElement(screenW * 0.7939, screenH * 0.5404, screenW * 0.1953, screenH * 0.0391) then triggerServerEvent ("CompMask61", getLocalPlayer(), localPlayer) end end end end addEventHandler ("onClientClick", root, CompMask6) function CompMask7 (_,state) if PainelLoja == true then if state == "down" then if isCursorOnElement(screenW * 0.7939, screenH * 0.5872, screenW * 0.1953, screenH * 0.0391) then triggerServerEvent ("CompMask71", getLocalPlayer(), localPlayer) end end end end addEventHandler ("onClientClick", root, CompMask7) function CompMask8 (_,state) if PainelLoja == true then if state == "down" then if isCursorOnElement(screenW * 0.7939, screenH * 0.6341, screenW * 0.1953, screenH * 0.0391) then triggerServerEvent ("CompMask81", getLocalPlayer(), localPlayer) end end end end addEventHandler ("onClientClick", root, CompMask8) function CompMask9 (_,state) if PainelLoja == true then if state == "down" then if isCursorOnElement(screenW * 0.7949, screenH * 0.6810, screenW * 0.1953, screenH * 0.0391) then triggerServerEvent ("CompMask91", getLocalPlayer(), localPlayer) end end end end addEventHandler ("onClientClick", root, CompMask9) function CompMask10 (_,state) if PainelLoja == true then if state == "down" then if isCursorOnElement(screenW * 0.7939, screenH * 0.7279, screenW * 0.1953, screenH * 0.0391) then triggerServerEvent ("CompMask101", getLocalPlayer(), localPlayer) end end end end addEventHandler ("onClientClick", root, CompMask10) function isCursorOnElement(x,y,w,h) local mx,my = getCursorPosition () local fullx,fully = guiGetScreenSize() cursorx,cursory = mx*fullx,my*fully if cursorx > x and cursorx < x + w and cursory > y and cursory < y + h then return true else return false end end function cursorPosition(x, y, width, height) if (not isCursorShowing()) then return false end local sx, sy = guiGetScreenSize() local cx, cy = getCursorPosition() local cx, cy = (cx*sx), (cy*sy) if (cx >= x and cx <= x + width) and (cy >= y and cy <= y + height) then return true else return false end end function isEventHandlerAdded( sEventName, pElementAttachedTo, func ) if type( sEventName ) == 'string' and isElement( pElementAttachedTo ) and type( func ) == 'function' then local aAttachedFunctions = getEventHandlers( sEventName, pElementAttachedTo ) if type( aAttachedFunctions ) == 'table' and #aAttachedFunctions > 0 then for i, v in ipairs( aAttachedFunctions ) do if v == func then return true end end end end return false end Se algum puder me ajudar pois eu não consegui arrumar. Imagem dos erros. https://imgur.com/9F1KMh9 -
ME AJUDEJM
Nome Nome replied to Ryanzinhoff's topic in Ajudas relacionadas ao MTA:SA (Cliente/Servidor)
Só reinstalar que fica show. -
Postei uma Hud com erros na community, acabei de arrumar ela se puder apagar ela agradeço. Vou postar a nova Link: https://community.multitheftauto.com/index.php?p=resources&s=details&id=18109
-
Nome Nome changed their profile photo
-
Estou pensando em fazer uma hud só que em html. É possivel ? Se for o que eu preciso para começar a fazer.
-
Ajudou muito. Obrigado.
-
Movimentando o topico. Alguem pra da uma força ?
-
Como posso fazer uma animação de carregamento nesse estilo? Eu estou aprendendo Lua então, você pode ajudar no agradeço. .
-
local screenW,screenH = guiGetScreenSize() local resW, resH = 1280, 720 local x, y = (screenW/resW), (screenH/resH) local Fonte1 = dxCreateFont("Fonte/1.otf", 11.3) local Loading_Matheus = false local function Loading_Painel() rando1 = math.abs(math.sin(getTickCount()/5000)) rando2 = math.abs(math.sin(getTickCount()/3000)) rando3 = math.abs(math.sin(getTickCount()/2500)) sound1 = playSound("Musica/Musica.mp3",true) local Girar = interpolateBetween(screenH * 1, 0, 0,screenH * 378, 0, 0, (getTickCount()-tick)/10000, "Linear") dxDrawImage(screenW * 0.0000, screenH * 0.0000, screenW * 1.0000, screenH * 1.0000, "Imagens/Fundo.jpg", 0, 0, 0, tocolor(255, 255, 255, 255), true) dxDrawImage(screenW * 0.7461, screenH * 0.7995, screenW * 0.0605, screenH * 0.0807, "Imagens/Progresso.png", getTickCount()/10, 0, 0, tocolor(208, 236, 237, 255), true) dxDrawText("Carregando...", screenW * 0.8125, screenH * 0.8464, screenW * 0.9629, screenH * 0.8802, tocolor(rando3*200, rando2*200, rando1*200), 1.10, Fonte1, "left", "center", false, false, true, false, false) end function Loading_Stop() tick = getTickCount() Loading_Matheus = true end setTimer(function() if isTransferBoxActive() then if not Loading_Matheus then addEventHandler("onClientRender", root, Loading_Stop) addEventHandler("onClientRender", root, Loading_Painel, true, "high") showChat(false) end else if Loading_Matheus then removeEventHandler("onClientRender", root, Loading_Stop) removeEventHandler("onClientRender", root, Loading_Painel) showChat(true) stopSound(sound) Loading_Matheus = false end Loading_Matheus = false end end, 100, 0) Quando eu incio o carregamento ele começa a tocar a musica mas quando termina de baixar ele não desliga a musica. O código não esta bem feito pois eu ainda estou aprendendo a fazer. Se puderem ajudar a achar o erro fico grato.