Leaderboard
Popular Content
Showing content with the highest reputation on 12/07/20 in all areas
-
O evento está com uma letra errada, é onMarkerHit, e não OnMarkerHit.2 points
-
جرب _________ GUIEditor = { label = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.label[1] = guiCreateLabel(20, 176, 234, 76, "تعليمات الزراعة\n1- plant للزارعة\"\n2- seeds لمعرفة عدد البذور\n3- hplant لمعرفة عدد المحاصيل الي تملكها\n4- cplant لبيع المحصول\n ", false) guiLabelSetColor(GUIEditor.label[1], 244, 235, 9) guiSetVisible (GUIEditor.label[1],false) end ) Farms = { label = {}, button = {}, edit = {}, window = {}, memo = {}, } local Cls = createColRectangle ( -1195.2862548828, -1064.8507080078, 192, 145 ) Farms.window[1] = guiCreateWindow(348, 236, 466, 209, "Farms Job ", false) guiWindowSetSizable(Farms.window[1], false) guiSetVisible (Farms.window[1],false) Farms.button[1] = guiCreateButton(10, 159, 45, 40, "Close", false, Farms.window[1]) guiSetFont(Farms.button[1], "default-bold-small") Farms.edit[1] = guiCreateEdit(60, 27, 216, 29, "0", false, Farms.window[1]) Farms.label[2] = guiCreateLabel(10, 27, 50, 15, "Seeds :", false, Farms.window[1]) guiSetFont(Farms.label[2], "default-bold-small") Farms.button[2] = guiCreateButton(10, 73, 120, 39, "Buy", false, Farms.window[1]) guiSetFont(Farms.button[2], "default-bold-small") Farms.label[2] = guiCreateLabel(140, 78, 136, 24, "$".. tonumber(guiGetText ( Farms.edit[1] ))*50 .."", false, Farms.window[1]) guiLabelSetColor(Farms.label[2], 48, 253, 1) guiSetFont(Farms.label[2], "default-bold-small") guiLabelSetHorizontalAlign(Farms.label[2], "center", false) Farms.label[3] = guiCreateLabel(290, 20, 15, 183, "|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n", false, Farms.window[1]) guiSetFont(Farms.label[3], "default-bold-small") Farms.label[4] = guiCreateLabel(290, 26, 15, 183, "|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n|\n", false, Farms.window[1]) guiSetFont(Farms.label[4], "default-bold-small") Farms.memo[1] = guiCreateMemo(297, 19, 159, 180, "1- plant للزارعة\n2- seeds لمعرفة عدد البذر \n3- hplant لمعرفة عدد المحاصيل الي تملكها\n4- cplant لبيع المحصول", false, Farms.window[1]) local getJob = createMarker ( -1059.8812255859, -1195.4334716797, 128.42066955566, "cylinder", 1.5, 255, 255, 0, 170 ) function MarkerHit ( hitPlayer, matchingDimension ) local playerTeam = getPlayerTeam (localPlayer) if ( playerTeam and getTeamName ( playerTeam ) == "Police" ) then return end if hitPlayer == localPlayer then if source == getJob then guiSetVisible (Farms.window[1],true) showCursor (true) end end end addEventHandler ( "onClientMarkerHit", getRootElement(), MarkerHit ) function GUIChanged () if ( source == Farms.edit[1] ) then if tonumber(guiGetText ( Farms.edit[1] )) ~= nil then if tonumber(guiGetText ( Farms.edit[1] )) > 500 then guiSetText(Farms.edit[1],"500") end guiLabelSetColor(Farms.label[2], 48, 253, 1) guiSetText(Farms.label[2],"$".. tonumber(guiGetText ( Farms.edit[1] ))*100 .."") else guiSetText(Farms.edit[1],"0") end end end addEventHandler ( "onClientGUIChanged", getRootElement(), GUIChanged ) addEventHandler ("onClientGUIClick", getRootElement(), function() if (source == Farms.button[1]) then guiSetVisible (Farms.window[1],false) showCursor (false) elseif (source == Farms.button[2]) then if tonumber(guiGetText ( Farms.edit[1] )) > 0 then if tonumber(guiGetText ( Farms.edit[1] )) <= getPlayerMoney(localPlayer) then triggerServerEvent ( "buySeeds", localPlayer,guiGetText ( Farms.edit[1] ),guiGetText ( Farms.edit[1] )*50 ) else guiSetText(Farms.label[2],"you don't have money !") guiLabelSetColor(Farms.label[2], 255, 0, 0) end end end end ) addEvent("setLabel",true) addEventHandler("setLabel",root, function (player,text,r,g,b) if player == localPlayer then guiSetText(Farms.label[2],text) guiLabelSetColor(Farms.label[2], r,g,b) end end ) function ShapeHit( theElement, matchingDimension ) local playerTeam = getPlayerTeam (localPlayer) if ( playerTeam and getTeamName ( playerTeam ) == "Police" ) then return end if ( theElement == getLocalPlayer() ) then if source == Cls then guiSetVisible (GUIEditor.label[1],true) end end end addEventHandler("onClientColShapeHit",getRootElement(),ShapeHit) function ShapeLeave( theElement, matchingDimension ) if ( theElement == getLocalPlayer() ) then if source == Cls then guiSetVisible (GUIEditor.label[1],false) end end end addEventHandler("onClientColShapeLeave",getRootElement(),ShapeLeave) function onPlayerTarget ( ) if isElementWithinColShape ( source, Cls ) then cancelEvent( true ) end end addEventHandler ( "onClientPlayerTarget", getRootElement(), onPlayerTarget ) addEventHandler ( 'onClientPlayerDamage', localPlayer,function ( ) if isElementWithinColShape ( source, Cls ) then cancelEvent ( ) end end )1 point
-
1 point
-
اعرض الكود الي يخلي لما الاعب يدخل المركر البانل حق الوظيفه تفتح و راح اساعدك أن شاء الله ولو بدك ترسله خاص لعدم تكرار الكلام فل توبك تنور وراح اساعدك بردو أن شاء الله تحياتي1 point
-
Make a simple cooldown disable the button with guiSetEnabled and enable it after 5 secs for example with setTimer btw @Sisqo0 you can use the global variables instead of these functions getRootElement() - root getLocalPlayer() - localPlayer getResourceRootElement() - resourceRoot1 point
-
Podrías crear una col, posteriormente adicionar el comando cuando el jugador ingrese en ella y removerlo cuando salga. Esto hará que solo en una zona definida por ti el jugador pueda utilizar el comando.1 point
-
1 point
-
New :: مودات سيرفر الوزارة للهجولة والتدشير | 2018 ✔ MTASA ♥♥ ربط :https://youtu.be/djsO0dNQlWQ1 point
-
Ambos, principalmente o número de triângulos na malha. E as texturas devem ser as mais otimizadas possível. De preferência com proporção 1:1 e resolução múltipla de 2. 1024x1024 (Casos raríssimos onde exige extremo detalhamento de textura, nenhuma textura original do GTA SA chega nessa resolução) 512x512 (Objetos detalhados) 256x256 (Objetos intermediários) 128x128 (Objetos leves) 64x64 (Objetos muito leves) 32x32 (Objetos irrelevantes) 16x16 (Partes de objetos irrelevantes, texturas de modelos LOD) 8x8 e abaixo (geralmente nem é textura e sim uma paleta de cores) A propósito, quantos triângulos tem no total da construção? Ela está substituindo qual objeto? O objeto original que foi substituído tem quantos triângulos?1 point
-
Tente isso : -- Server-Side addEventHandler("onPlayerLogin", getRootElement( ), function ( ) bindKey( source, "F5", "down", abrir_painel_f5 ) end) addEventHandler("onResourceStart", resourceRoot, function ( ) for i, player in ipairs(getElementsByType("player")) do bindKey( player, "F5", "down", abrir_painel_f5 ) end end) addEventHandler("onResourceStop", resourceRoot, function ( ) for i, player in ipairs(getElementsByType("player")) do unbindKey( player, "F5", "down", abrir_painel_f5 ) end end) function abrir_painel_f5 ( thePlayer ) local accountname = getAccountName( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup("user." .. accountname, aclGetGroup("Armas")) then triggerClientEvent( thePlayer, "Painel_de_Armas:Abrir", thePlayer) end end -- Client-Side local screenW, screenH = guiGetScreenSize() local x, y = (screenW/1366), (screenH/768) local dxfont0_icons = dxCreateFont("font/icons.ttf", x*12) local dxfont1_icons = dxCreateFont("font/icons.ttf", x*11) local ID = createElement("TS:EditBoxArmas") local Preco = createElement("TS:EditBoxArmas") local Municao = createElement("TS:EditBoxArmas") painel = false painel3 = false --[[ ><><><><><><><><><><><><><><><><><><><>< >< Painel Inicial >< ><><><><><><><><><><><><><><><><><><><>< --]] function painelsamu () exports["Blur"]:dxDrawBluredRectangle(screenW * 0.2848, screenH * 0.2839, screenW * 0.4305, screenH * 0.4323, tocolor(255, 255, 255, 230)) dxDrawRectangle(screenW * 0.2848, screenH * 0.2839, screenW * 0.4305, screenH * 0.4323, tocolor(0, 0, 0, 77), false) dxDrawRectangle(screenW * 0.2848, screenH * 0.2839, screenW * 0.4305, screenH * 0.0599, tocolor(0, 0, 0, 167), false) dxDrawLine(screenW * 0.2848, screenH * 0.3424, screenW * 0.7152, screenH * 0.3424, tocolor(5, 0, 217, 254), 3, false) dxDrawText("Enviar Armas", screenW * 0.4641, screenH * 0.2969, screenW * 0.5381, screenH * 0.3229, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false) dxDrawEditBox("ID Do Jogador", screenW * 0.5124, screenH * 0.3659, screenW * 0.1559, screenH * 0.0534, false, 10, ID) dxDrawEditBox("Preço da Arma", screenW * 0.5124, screenH * 0.4648, screenW * 0.1559, screenH * 0.0534, false, 10, Preco) dxDrawEditBox("Quantidade de Munição", screenW * 0.5124, screenH * 0.5534, screenW * 0.1559, screenH * 0.0534, false, 10, Municao) if isCursorOnElement(screenW * 0.3507, screenH * 0.6328, screenW * 0.1127, screenH * 0.0625) then dxDrawImage(screenW * 0.3507, screenH * 0.6328, screenW * 0.1127, screenH * 0.0625, "0.png", 0, 0, 0, tocolor(5, 0, 217, 255), false) else dxDrawImage(screenW * 0.3507, screenH * 0.6328, screenW * 0.1127, screenH * 0.0625, "0.png", 0, 0, 0, tocolor(5, 0, 217, 123), false) end if isCursorOnElement(screenW * 0.5015, screenH * 0.6328, screenW * 0.1127, screenH * 0.0625) then dxDrawImage(screenW * 0.5015, screenH * 0.6328, screenW * 0.1127, screenH * 0.0625, "0.png", 0, 0, 0, tocolor(5, 0, 217, 255), false) else dxDrawImage(screenW * 0.5015, screenH * 0.6328, screenW * 0.1127, screenH * 0.0625, "0.png", 0, 0, 0, tocolor(5, 0, 217, 123), false) end dxDrawText("Enviar Arma", screenW * 0.3763, screenH * 0.6471, screenW * 0.4502, screenH * 0.6732, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false) dxDrawText("Fechar Painel", screenW * 0.5234, screenH * 0.6484, screenW * 0.5974, screenH * 0.6745, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false) end addEventHandler("onClientResourceStart", resourceRoot, function () Lista_Armas = dxGridW:Create(408, 278, 254, 192) Lista_Armas:AddColumn("Armas", 150) Lista_Armas:AddColumn("Muniçao", 70) Lista_Armas:AddColumn("ID", 100) Lista_Armas:SetVisible(false) end) function Refresh_Jogadores () Lista_Armas:Clear(true) for slot = 0, 12 do local Armamento = getPedWeapon ( localPlayer, slot ) local Municao = getPedTotalAmmo ( localPlayer, slot ) if Armamento > 0 then local NomeDaArma = getWeaponNameFromID ( Armamento ) Lista_Armas:AddItem(1, ""..NomeDaArma) Lista_Armas:AddItem(2, ""..Municao) Lista_Armas:AddItem(3, ""..Armamento) end end end function painelsamu2 () local Jogador = getElementData(localPlayer, "TS:Vendedor") local Preco = getElementData(Jogador, "TS:Preco") or "Error" local Municoes = getElementData(Jogador, "TS:Muni") or "Error" local IDArma = getElementData(Jogador, "TS:IDArma") or "Error" local NomeArma = getWeaponNameFromID(IDArma) dxDrawRectangle(screenW * 0.3426, screenH * 0.0130, screenW * 0.3155, screenH * 0.2578, tocolor(0, 0, 0, 123), false) dxDrawRectangle(screenW * 0.3426, screenH * 0.0130, screenW * 0.3155, screenH * 0.0560, tocolor(0, 0, 0, 162), false) dxDrawLine(screenW * 0.3426, screenH * 0.0690, screenW * 0.6589, screenH * 0.0690, tocolor(10, 0, 198, 254), 3, false) dxDrawText("Venda de Armas", screenW * 0.4605, screenH * 0.0260, screenW * 0.5527, screenH * 0.0560, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false) dxDrawText("Algum jogador está querendo te vender uma "..NomeArma.." por #00FF00R$#FFFFFF "..Preco.." \ncom "..Municoes.." Munições. Você deseja:", screenW * 0.3499, screenH * 0.0820, screenW * 0.4422, screenH * 0.1120, tocolor(255, 255, 255, 255), 1.00, dxfont1_icons, "left", "top", false, false, false, true, false) if isCursorOnElement(screenW * 0.3572, screenH * 0.1628, screenW * 0.1061, screenH * 0.0534) then dxDrawImage(screenW * 0.3572, screenH * 0.1628, screenW * 0.1061, screenH * 0.0534, "0.png", 0, 0, 0, tocolor(10, 0, 198, 255), false) else dxDrawImage(screenW * 0.3572, screenH * 0.1628, screenW * 0.1061, screenH * 0.0534, "0.png", 0, 0, 0, tocolor(10, 0, 198, 126), false) end if isCursorOnElement(screenW * 0.5110, screenH * 0.1628, screenW * 0.1061, screenH * 0.0534) then dxDrawImage(screenW * 0.5110, screenH * 0.1628, screenW * 0.1061, screenH * 0.0534, "0.png", 0, 0, 0, tocolor(10, 0, 198, 255), false) else dxDrawImage(screenW * 0.5110, screenH * 0.1628, screenW * 0.1061, screenH * 0.0534, "0.png", 0, 0, 0, tocolor(10, 0, 198, 126), false) end dxDrawText("Comprar", screenW * 0.3865, screenH * 0.1732, screenW * 0.4348, screenH * 0.2031, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false) dxDrawText("Rejeitar", screenW * 0.5410, screenH * 0.1732, screenW * 0.5893, screenH * 0.2031, tocolor(255, 255, 255, 255), 1.00, dxfont0_icons, "left", "top", false, false, false, false, false) end --[[ ><><><><><><><><><><><><><><><><><><><>< >< Configurações N Altere >< ><><><><><><><><><><><><><><><><><><><>< --]] function convertTime(ms) local min = math.floor ( ms/60000 ) local sec = math.floor( (ms/1000)%60 ) return min, sec end -- /> APENAS FIZ ALTERAÇÃO AQUI : addEvent("Painel_de_Armas:Abrir", true) function AbrirArmas ( ) if getElementData(localPlayer, "TS:Cliente") then return end if painel == false then addEventHandler ( "onClientRender", root, painelsamu ) painel = true showCursor ( true ) playSoundFrontEnd ( 43 ) setElementData(ID, "text2", "") setElementData(Preco, "text2", "") setElementData(Municao, "text2", "") Lista_Armas:SetVisible(true) Refresh_Jogadores ( ) end end addEventHandler("Painel_de_Armas:Abrir", getRootElement(), AbrirArmas ) --bindKey("F5", "down", AbrirArmas) --/> Removido function FecharPainel (_,state) if painel == true then if state == "down" then if isCursorOnElement ( screenW * 0.5015, screenH * 0.6328, screenW * 0.1127, screenH * 0.0625 ) then removeEventHandler("onClientRender", root, painelsamu ) showCursor (false) playSoundFrontEnd ( 43 ) painel = false Lista_Armas:SetVisible(false) end end end end addEventHandler ("onClientClick", root, FecharPainel ) function VenderArmas (_,state) if painel == true then if isCursorOnElement ( screenW * 0.3507, screenH * 0.6328, screenW * 0.1127, screenH * 0.0625 ) then local getID = tonumber(getElementData(ID, "text2")) local getPreco = tonumber(getElementData(Preco, "text2")) or 0 local getMunicao = tonumber(getElementData(Municao, "text2")) or 0 local gridItem = Lista_Armas:GetSelectedItem() local Arma_Selecionada = Lista_Armas:GetItemDetails(1, gridItem, 1) or nil local MunicaoAtual = Lista_Armas:GetItemDetails(2, gridItem, 2) or nil local WeaponID = Lista_Armas:GetItemDetails(3, gridItem, 3) or nil removeEventHandler("onClientRender", root, painelsamu ) showCursor (false) playSoundFrontEnd ( 43 ) painel = false Lista_Armas:SetVisible(false) setElementData(localPlayer, "TS:IDArma", WeaponID) setElementData(localPlayer, "TS:MuniAtual", MunicaoAtual) triggerServerEvent( 'TS:IniciarVendaArmas', getLocalPlayer(), localPlayer, Arma_Selecionada, getID, getPreco, getMunicao, WeaponID) end end end addEventHandler ("onClientClick", root, VenderArmas ) painelcomprador = false function ConfirmacaoWeapon () addEventHandler("onClientRender", root, painelsamu2) end addEvent("TS:ConfirmacaoWeapon", true) addEventHandler("TS:ConfirmacaoWeapon", getRootElement(), ConfirmacaoWeapon) function ParteComprador (_,state) if state == "down" then if isCursorOnElement ( screenW * 0.5110, screenH * 0.1628, screenW * 0.1061, screenH * 0.0534 ) then removeEventHandler("onClientRender", root, painelsamu2 ) triggerServerEvent("TS:Rejeitado", localPlayer) elseif isCursorOnElement(screenW * 0.3572, screenH * 0.1628, screenW * 0.1061, screenH * 0.0534) then removeEventHandler("onClientRender", root, painelsamu2 ) triggerServerEvent("TS:AceitarWeapon", localPlayer) end end end addEventHandler ("onClientClick", root, ParteComprador ) 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 end1 point