Leaderboard
Popular Content
Showing content with the highest reputation on 21/04/20 in all areas
-
Installation: extract files to C:\Program Files (x86)\MTA San Andreas 1.5\MTA\cgui\images replace & launch the game. Mediafire Dropbox Google Drive1 point
-
Project trains This resource creates multiple trains driving around the map and make them drive automatic. It makes San Andreas a little bit more alive. You can set-up how much trains are created, how fast they go, minimal/maximal amount of trainscarts they are pulling and some more. Versions Version 1.0.0 Serverside time synced trains for multiplayer Admin panel settings Version 2.0.0 Uncompiled Better optimised than previous versions. CPU (3,5-3,9 GHz) 4 trains +/- 1.22% usage 40 trains +/- 7.05% usage Overkill Cleaned up a lot of the old code (I wrote this in 2015.. , never the less it is still ugly :C) Added some custom train-cart designs. Fixed all known bugs. Trains won't stop, even in this version. But you can try to make that yourself... Improved bandwidth You can design your own traincarts in the map editor, see documentation after clicking on the lazy download link Bugs: GTA spawn bug: Incorrect train spawn, see documentation. Repository Lazy <you> transport Armed to the teeth Admin panel settings Building your own traincarts with the map editor Download here - project trains 2.0.01 point
-
1 point
-
Hello, you are using numbers on line 6 in the outputChatBox but you didnt assign any value to it. you should add this to the dchat function and i guess it should work. local numbers = tostring(math.random(1,100))1 point
-
Na próxima vez, poste na seção de Programação em Lua, pois se trata de uma dúvida relacionada a scripting e não ao servidor/cliente em si. E não fique postando o mesmo tópico em diferentes seções, isso é considerado spam. Quanto a sua dúvida, na linha 41, troque sound por sound1.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
-
1 point
-
Se não quiser algo tão complexo, pode usar a função getPlayerIdleTime. Essa função retorna um inteiro que é o tempo em milissegundos em que a posição de um jogador não mudou, pode ser útil eu espero.1 point
-
1 point
-
1 point
-
În principiu, nu, însă acest lucru depinde foarte mult și de ceea ce dorești să faci. De cele mai multe ori, dacă te vei întâlni cu matematica va fi sub o formă a acesteia foarte rudimentară (la nivel de gimnaziu: scăderi/adunări/împărțiri/înmulțiri) și cel mai des te vei întâlni la partea de GUI unde trebuie să calculezi pozițiile elementelor grafice.1 point
-
Seu erro, é aparentemente o mesmo problema ocorrido com uns dos membro do fórum que postou o mesmo problema AQUI NESTE TÓPICO. Eu, já tentei descobri uma solução para este problema, infelizmente, não encontrei (Nem mesmo formatando o PC), Então o problema pode está no hardware do PC. A única solução está apenas da parte da administração responsável pela programação do servidor, mas, eu creio que não é um problema do servidor, e sim do PC do client.1 point
-
Para você verificar o grupo ACL de um Jogador, você precisará fazer isso do lado server-side. Então, você vai precisa muda basicamente, algumas coisinhas, como : 1. BindKey : remove do client-side, e enviar para o server-side (fazer alterações). 2. isObjectInACLGroup : verificar o grupo ACL do jogador. 3. triggerClientEvent : utilizar para dispara um evento para o client-side, para abrir o painel.0 points
