Leaderboard
Popular Content
Showing content with the highest reputation on 29/05/19 in all areas
-
Teste lá, duplique os resources (não é o melhor jeito) e mude as posições, acho que agora os eventos/triggers de um não influenciarão no outro. Audio = {} local abrirpainel = createMarker(299.12530517578, -1816.7014160156, 4.3,"cylinder", 2, 0, 255, 0, 100) --- PRAIA function mostrarpainel(thePlayer) triggerClientEvent(thePlayer, "Dj", resourceRoot ) end addEventHandler("onMarkerHit", abrirpainel, mostrarpainel) addEvent ( "CrioDJ", true ) addEventHandler ( "CrioDJ", root, function ( Link ) if ( Link ) then if ( isElement ( Audio [ client ] ) ) then local x, y, z = getElementPosition ( Audio [ client ] ) destroyElement ( Audio [ client ] ) end local x, y, z = getElementPosition ( client ) Audio [ client ] = createMarker(x-0.5, y+0.5, z - 1,"cylinder", 1, 0, 255, 255, 0) triggerClientEvent ( root, "CrioDJ", resourceRoot, client, Link ) triggerClientEvent(root, "Djay", resourceRoot, getPlayerName( client ) ) end end) addEvent ( "VolumealteradoDJ", true ) addEventHandler ( "VolumealteradoDJ", root, function ( to ) triggerClientEvent ( root, "VolumeDJ", resourceRoot, client, to ) end ) addEvent ( "DestruiDJ", true ) addEventHandler ( "DestruiDJ", root, function ( ) if ( isElement ( Audio [ client ] ) ) then destroyElement ( Audio [ client ] ) triggerClientEvent ( root, "DestruiDJ", resourceRoot, client ) end end ) local screenW,screenH = guiGetScreenSize() local resW, resH = 1280, 1024 local x, y = (screenW/resW), (screenH/resH) local root = getRootElement() local volume_menos = 0.1 local volume_mais = 0.1 stream = {} dj = false animON = false info = false addEventHandler("onClientResourceStart", resourceRoot, function() Link = guiCreateEdit(x*411, y*374, x*408, y*46, "Cole o link aqui...", false) guiSetVisible ( Link, false ) end ) function dx () local alpha,alpha2,alpha3= interpolateBetween(0, 0, 0, 255, 136, 200, ((getTickCount() - djt) / 2000), "Linear") local meta = getSoundMetaTags(stream) dxDrawRectangle(x*346, y*198, x*537, y*550, tocolor(0, 0, 0, alpha2), false) dxDrawRectangle(x*346, y*198, x*537, y*74, tocolor(5, 239, 5, alpha2), false) dxDrawText("PAINEL DJ", x*500, y*220, x*732, y*252, tocolor(255, 255, 255, alpha), x*2.00, "default-bold", "center", "top", false, false, false, false, false) dxDrawText("X", x*831, y*220, x*864, y*252, tocolor(255, 255, 255, alpha), 2.00, "default-bold", "center", "center", false, false, false, false, false) if ismouseinposition (x*411, y*435, x*88, y*35) then dxDrawRectangle(x*411, y*435, x*88, y*35, tocolor(5, 239, 5, alpha3), false) else dxDrawRectangle(x*411, y*435, x*88, y*35, tocolor(5, 239, 5, alpha2), false) end if ismouseinposition (x*518, y*435, x*88, y*35) then dxDrawRectangle(x*518, y*435, x*88, y*35, tocolor(5, 239, 5, alpha3), false) else dxDrawRectangle(x*518, y*435, x*88, y*35, tocolor(5, 239, 5, alpha2), false) end if ismouseinposition (x*624, y*435, x*88, y*35) then dxDrawRectangle(x*624, y*435, x*88, y*35, tocolor(5, 239, 5, alpha3), false) else dxDrawRectangle(x*624, y*435, x*88, y*35, tocolor(5, 239, 5, alpha2), false) end if ismouseinposition (x*731, y*435, x*88, y*35) then dxDrawRectangle(x*731, y*435, x*88, y*35, tocolor(5, 239, 5, alpha3), false) else dxDrawRectangle(x*731, y*435, x*88, y*35, tocolor(5, 239, 5, alpha2), false) end dxDrawText("Volume -", x*411, y*435, x*499, y*470, tocolor(255, 255, 255, alpha), x*1.00, "default-bold", "center", "center", false, false, false, false, false) dxDrawText("Volume +", x*518, y*435, x*606, y*470, tocolor(255, 255, 255, alpha), x*1.00, "default-bold", "center", "center", false, false, false, false, false) dxDrawText("Tocar", x*624, y*435, x*712, y*470, tocolor(255, 255, 255, alpha), x*1.00, "default-bold", "center", "center", false, false, false, false, false) dxDrawText("Parar", x*731, y*435, x*819, y*470, tocolor(255, 255, 255, alpha), x*1.00, "default-bold", "center", "center", false, false, false, false, false) dxDrawRectangle(x*411, y*496, x*408, y*230, tocolor(0, 0, 0, alpha2), false) if not meta then dxDrawText("Duração: N/A", x*411, y*336, x*615, y*364, tocolor(255, 255, 255, alpha), x*1.00, "default-bold", "left", "center", false, false, false, false, false) dxDrawText("Tocando agora: N/A", x*411, y*283, x*819, y*308, tocolor(255, 255, 255, alpha), x*1.00, "default-bold", "left", "center", false, false, false, false, false) dxDrawText("Adicionado por: N/A", x*411, y*308, x*615, y*336, tocolor(255, 255, 255, alpha), x*1.00, "default-bold", "left", "center", false, false, false, false, false) dxDrawText("Volume: 00%", x*615, y*336, x*819, y*364, tocolor(255, 255, 255, alpha), x*1.00, "default-bold", "left", "center", false, false, false, false, false) end end function dx_2 () local meta = getSoundMetaTags(stream) if not meta then return end local duracao_musica = getSoundLength(stream) local anim = getSoundFFTData(stream, 8192, 30) local titulo = meta.title or meta.stream_title or "N/A" local msecs = duracao_musica*1000 local secs = msecs/1000 local duracao = string.format("%.2d:%.2d:%.2d",secs/(60*60),secs/60%60,secs%60) local volume = math.round ( getSoundVolume ( stream ), 2 ) if animON == true then dxDrawText("Tocando agora: "..titulo, x*411, y*283, x*819, y*308, tocolor(255, 255, 255, 255), x*1.00, "default-bold", "left", "center", true, false, false, false, false) dxDrawText("Duração: "..duracao, x*411, y*336, x*615, y*364, tocolor(255, 255, 255, 255), x*1.00, "default-bold", "left", "center", false, false, false, false, false) dxDrawText("Adicionado por: "..nome, x*411, y*308, x*615, y*336, tocolor(255, 255, 255, 255), x*1.00, "default-bold", "left", "center", false, false, false, true, false) dxDrawText("Volume: "..math.floor ( volume * 100 ).."%", x*615, y*336, x*819, y*364, tocolor(255, 255, 255, 255), x*1.00, "default-bold", "left", "center", false, false, false, false, false) for i,v in pairs(anim) do tamanho = math.round((v*320),0)>100 and 100 or math.round((v*320),0) largura = 13 dxDrawRectangle(x*418+(i*x*largura), y*720, x*largura-1, y*2*tamanho*-1, tocolor(5, 239, 5, 136), false) end end end -------------------------------- PLAYSOUND 3D addEvent ( "DestruiDJ", true ) addEventHandler ( "DestruiDJ", resourceRoot, function ( who ) if ( isElement ( stream ) ) then destroyElement ( stream ) end end ) addEvent ( "VolumeDJ", true ) addEventHandler ( "VolumeDJ", resourceRoot, function ( who, vol ) if ( isElement ( stream ) ) then setSoundVolume ( stream, tonumber ( vol ) ) end end ) addEvent ( "CrioDJ", true ) addEventHandler ( "CrioDJ", resourceRoot, function ( who, Link, isCar ) if ( isElement ( stream ) ) then destroyElement ( stream ) end local x, y, z = getElementPosition ( who ) stream = playSound3D ( Link, x, y, z, true ) setSoundVolume ( stream, 1 ) setSoundMinDistance (stream, 50 ) setSoundMaxDistance ( stream, 50 ) end ) function tocar(_,estado) if dj == true then if estado == "down" then if ismouseinposition(x*624, y*435, x*88, y*35) then setTimer ( function() local meta = getSoundMetaTags(stream) local duracao_musica = getSoundLength(stream) local titulo = meta.title or meta.stream_title or "N/A" local msecs = duracao_musica*1000 local secs = msecs/1000 local duracao = string.format("%.2d:%.2d:%.2d",secs/(60*60),secs/60%60,secs%60) outputChatBox ( "#FFFFFF==> #00FF00Música#FFFFFF: "..titulo.." = #00FF00Duração: #FFFFFF"..duracao..".", 255, 255, 255 ,true) end, 2000, 1 ) triggerServerEvent ( "CrioDJ", resourceRoot, guiGetText ( Link )) addEventHandler("onClientRender",root,dx_2) playSoundFrontEnd(1) isSound = true animON = true end end end end addEventHandler("onClientClick",root,tocar) function Parar(_,estado) if dj == true then if estado == "down" then if ismouseinposition(x*731, y*435, x*88, y*35) then triggerServerEvent ( "DestruiDJ", resourceRoot ) outputChatBox ( "#FFFFFF==> #00FF00Você cancelo a repodrução da musica atual.", 255, 255, 255 ,true) removeEventHandler ("onClientRender", root, dx_2) playSoundFrontEnd(2) isSound = false animON = false end end end end addEventHandler("onClientClick",root,Parar) function Volumemenos(_,estado) if dj == true then if estado == "down" then if ismouseinposition(x*411, y*435, x*88, y*35) then playSoundFrontEnd(3) if ( isSound ) then local volume = math.round ( getSoundVolume ( stream ) - volume_menos, 2 ) if ( volume > 0.0 ) then triggerServerEvent ( "VolumealteradoDJ", resourceRoot, volume ) --outputChatBox ( "#FFFFFF==> #00FF00Volume alterado para "..math.floor ( volume * 100 ).."%.", 0, 255, 255 ,true) else outputChatBox ( "#FFFFFF==> #00FF00DJ está no volume minimo.", 0, 255, 255 ,true) end end end end end end addEventHandler("onClientClick",root,Volumemenos) function Volumemais(_,estado) if dj == true then if estado == "down" then if ismouseinposition(x*518, y*435, x*88, y*35) then playSoundFrontEnd(3) if ( isSound ) then local volume = math.round ( getSoundVolume ( stream ) + volume_mais, 2 ) if ( volume < 1.1 ) then triggerServerEvent ( "VolumealteradoDJ", resourceRoot, volume ) --outputChatBox ( "#FFFFFF==> #00FF00Volume alterado para "..math.floor ( volume * 100 ).."%.", 0, 255, 255 ,true) else outputChatBox ( "#FFFFFF==> #00FF00DJ está no volume maximo.", 0, 255, 255 ,true) end end end end end end addEventHandler("onClientClick",root,Volumemais) function fechar(_,estado) if dj == true then if estado == "down" then if ismouseinposition(x*831, y*220, x*53, y*37) then playSoundFrontEnd(5) showCursor(false) removeEventHandler("onClientRender",root,dx) removeEventHandler ("onClientRender", root, dx_2) guiSetVisible ( Link, false ) dj = false animON = false end end end end addEventHandler("onClientClick",root,fechar) function dj_add (djay_painel) nome=djay_painel; end addEvent ("Djay",true) addEventHandler ("Djay",resourceRoot,dj_add) function mostrarpainelDJ () if dj == false then addEventHandler ("onClientRender", root, dx) djt = getTickCount() guiSetVisible ( Link, true ) addEventHandler("onClientRender",root,dx_2) animON = true showCursor (true) dj = true else removeEventHandler ("onClientRender", root, dx) guiSetVisible ( Link, false ) showCursor (false) dj = false animON = false end end addEvent ("Dj",true) addEventHandler ("Dj",resourceRoot,mostrarpainelDJ) function math.round(number, decimals, method) decimals = decimals or 0 local factor = 10 ^ decimals if (method == "ceil" or method == "floor") then return math[method](number * factor) / factor else return tonumber(("%."..decimals.."f"):format(number)) end end function ismouseinposition ( 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 end1 point
-
افكار حلوه ان شاء الله رح احاول اشتغل عليها بالمستقبل منور انت الاجمل حبء منور الموضوع1 point
-
1 point
-
1 point
-
Audio = {} local merkers = { createMarker(299.12530517578, -1816.7014160156, 4.3,"cylinder", 2, 0, 255, 0, 100), --- PRAIA createMarker(299.12530517578, -1816.7014160156, 4.3,"cylinder", 2, 0, 255, 0, 100), } for i=1, #merkers do setElementData( merkers[i], "tocarSom_marker", true, false ) end function mostrarpainel(thePlayer) if not getElementData(source, "tocarSom_marker") or getElementType(thePlayer) ~= "player" then return end if not Audio[thePlayer] then triggerClientEvent( thePlayer, "Dj", getRootElement() ) end end addEventHandler("onMarkerHit", resourceRoot, mostrarpainel) addEvent ( "CrioDJ", true ) addEventHandler ( "CrioDJ", root, function ( Link ) if ( Link ) then if ( isElement ( Audio [ source ] ) ) then local x, y, z = getElementPosition ( Audio [ source ] ) destroyElement ( Audio [ source ] ) end local x, y, z = getElementPosition ( source ) Audio [ source ] = createMarker(x-0.5, y+0.5, z - 1,"cylinder", 1, 0, 255, 255, 0) triggerClientEvent ( root, "CrioDJ", source, source, Link ) triggerClientEvent(root, "Djay", root, getPlayerName( source ) ) end end) addEvent ( "VolumealteradoDJ", true ) addEventHandler ( "VolumealteradoDJ", root, function ( to ) triggerClientEvent ( root, "VolumeDJ", source, source, to ) end ) addEvent ( "DestruiDJ", true ) addEventHandler ( "DestruiDJ", root, function ( ) if ( isElement ( Audio [ source ] ) ) then destroyElement ( Audio [ source ] ) triggerClientEvent ( root, "DestruiDJ", source, source ) end end ) Tenta isso1 point
-
أعتقد كذا جرب addEventHandler("onClientPedDamage",root, function() if isElement == "ped" then cancelEvent() end end );1 point
-
1 point
-
1 point
-
1 point
-
1 point
-
API: http://getipintel.net/free-proxy-vpn-tor-detection-api/ -- SERVER SIDE local server_owner_email = "[email protected]" -- change it addEventHandler("onPlayerJoin", root, function() local IP = getPlayerIP(source) fetchRemote("http://check.getipintel.net/check.php?ip="..IP.."&contact="..server_owner_email, function(data, errno, player) if errno ~= 0 then print("fetchRemote error - "..errno) return false end local result = tonumber(data) if (result >= 0 and result <= 1) and result > 0.85 then outputChatBox(getPlayerName(player).." use VPN!", root) end end, "", false, source) end) not tested1 point
-
link: https://community.multitheftauto.com/index.php?p=resources&s=details&id=160521 point
-
Sorry for a bit of a late response, haven't been reading forums much lately. https://wiki.multitheftauto.com/wiki/OnClientVehicleDamage https://wiki.multitheftauto.com/wiki/GetVehiclePanelState https://wiki.multitheftauto.com/wiki/SetVehiclePanelState When you active the function loop through the panels and save their states. On vehicle damage loop through and restore their states to what has been saved. damageTable = {} function setVehiclePanelsDamageProof(player) local veh = getPedOccupiedVehicle(player) if isElement(veh) then if damageTable[veh] then damageTable[veh] = nil else damageTable[veh] = {} for i = 0,6 do local state = getVehiclePanelState(veh,i) damageTable[veh][i] = state end end end end addCommandHandler ( "damageProof", setVehiclePanelsDamageProof ) -- # Change this to whatever you want function onVehicleDamage() if isElement(source) and damageTable[source] then for i = 0,6 do setVehiclePanelState(source,i,damageTable[source][i]) end end end addEventHandler("onVehicleDamage", root, onVehicleDamage) Basic script, should work (Untested) . You'll have to modify it to your needs though. When you use the command "damageProof" it loops through the vehicles panels and saves their states (Or if table exists nils it) which enables or disables it. If a table exists (It's enabled) onVehicleDamage it loops through and resets the vehicles panel states. If disabled then it'll ignore it.1 point
-
как то так addEventHandler ( "onPlayerLogin", getRootElement (), function ( _, theCurrentAccount ) setPlayerName ( source, getAccountName ( theCurrentAccount ) ) end )1 point
-
This crash, client.dll @ 0x00281xxx, has received attention on MTA discord's #support channel yesterday, and I will make a summary of the situation for you. A handful of users are suffering this crash which we cannot understand from any recent change. In fact, even downgrading MTA to older builds from months ago won't resolve it, even though some others assumed the onset was related to yesterday's MTA updates. We believe it's related to something Microsoft recently did, with (hidden, silent) Windows updates for all their OSes. It seems it started happening (or suddenly increasing) on builds that were previously unaffected. Even though the amount of impacted MTA users is low, we understand the severity of this issue (because it totally prevents you from running MTA at all) which is why we're actively investigating it. Unfortunately, at this moment we cannot offer you a solution, although some others managed to solve it by following a few steps (of which we still don't know how many are relevant or why; just try them all): - Uninstall MTA completely, and move your GTA installation to another directory. Now re-install MTA (download: https://nightly.multitheftauto.com/?mtasa-1.5-rc-latest), into another directory than previously as well. Try running now. If this doesn't resolve it, then for now you're out of luck; we will inform you once we can offer you a solution. @SantV1 point
-
مهو انته لو بتاخد logical design هترف انك عملت كارثه كبيره باخطاءك لاستخدام بوابة or عالعموم ابحث شوية في or في الانترنت وهتفهم قصدي استخدم الاقواس لتجنب المشاكل بالتوفيق1 point
-
Hi, like majority of the players i got this bug http://prntscr.com/num7sy IS there still any fix available? I tried to download ccw's version that he mentioned somewhere but it didnt work. Also, fun thing is i got the same issue a week ago, i fixed it by changing resolution, but since yesterday crash came back...0 points
-
0 points
-
0 points