Jump to content

Search the Community

Showing results for tags 'lua'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • User Guides
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • MTA Community
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Gang


Location


Occupation


Interests

  1. Opa, sou recente jogador de mta e, tenho uma grande dúvida sobre a linguagem .lua, eu sou especializado na linguagem Python e, não sei nada sobre a linguagem .lua que é a linguagem usada no app de vocês. A linguagem .lua é uma linguagem única ou pode colocar códigos em Python dentro da linguagem .lua? Desde já agradeço.
  2. Queria fazer uma animação do player varrendo. queria saber se é possivel e como. agradeço des de já <3
  3. Quero que ele gire! local gate = createObject(13831, 1401.72900, -806.37512, 84.99246, 0, 0, 0) function girar () moveObject(gate, 6000, 1401.72900, -806.37512, 84.99246, 0, 0, 10) moveObject(gate, 6000, 1401.72900, -806.37512, 84.99246, 0, 0, 20) moveObject(gate, 6000, 1401.72900, -806.37512, 84.99246, 0, 0, 30) moveObject(gate, 6000, 1401.72900, -806.37512, 84.99246, 0, 0, 40) moveObject(gate, 6000, 1401.72900, -806.37512, 84.99246, 0, 0, 50) moveObject(gate, 6000, 1401.72900, -806.37512, 84.99246, 0, 0, 60) moveObject(gate, 6000, 1401.72900, -806.37512, 84.99246, 0, 0, 70) moveObject(gate, 6000, 1401.72900, -806.37512, 84.99246, 0, 0, 80) moveObject(gate, 6000, 1401.72900, -806.37512, 84.99246, 0, 0, 90) moveObject(gate, 6000, 1401.72900, -806.37512, 84.99246, 0, 0, 100) moveObject(gate, 6000, 1401.72900, -806.37512, 84.99246, 0, 0, 110) moveObject(gate, 6000, 1401.72900, -806.37512, 84.99246, 0, 0, 120) moveObject(gate, 6000, 1401.72900, -806.37512, 84.99246, 0, 0, 130) moveObject(gate, 6000, 1401.72900, -806.37512, 84.99246, 0, 0, 140) moveObject(gate, 6000, 1401.72900, -806.37512, 84.99246, 0, 0, 150) moveObject(gate, 6000, 1401.72900, -806.37512, 84.99246, 0, 0, 160) moveObject(gate, 6000, 1401.72900, -806.37512, 84.99246, 0, 0, 170) moveObject(gate, 6000, 1401.72900, -806.37512, 84.99246, 0, 0, 180) moveObject(gate, 6000, 1401.72900, -806.37512, 84.99246, 0, 0, 190) moveObject(gate, 6000, 1401.72900, -806.37512, 84.99246, 0, 0, 200) moveObject(gate, 6000, 1401.72900, -806.37512, 84.99246, 0, 0, 210) moveObject(gate, 6000, 1401.72900, -806.37512, 84.99246, 0, 0, 220) moveObject(gate, 6000, 1401.72900, -806.37512, 84.99246, 0, 0, 230) moveObject(gate, 6000, 1401.72900, -806.37512, 84.99246, 0, 0, 240) moveObject(gate, 6000, 1401.72900, -806.37512, 84.99246, 0, 0, 250) moveObject(gate, 6000, 1401.72900, -806.37512, 84.99246, 0, 0, 260) moveObject(gate, 6000, 1401.72900, -806.37512, 84.99246, 0, 0, 270) moveObject(gate, 6000, 1401.72900, -806.37512, 84.99246, 0, 0, 280) moveObject(gate, 6000, 1401.72900, -806.37512, 84.99246, 0, 0, 290) moveObject(gate, 6000, 1401.72900, -806.37512, 84.99246, 0, 0, 300) moveObject(gate, 6000, 1401.72900, -806.37512, 84.99246, 0, 0, 310) moveObject(gate, 6000, 1401.72900, -806.37512, 84.99246, 0, 0, 320) moveObject(gate, 6000, 1401.72900, -806.37512, 84.99246, 0, 0, 330) moveObject(gate, 6000, 1401.72900, -806.37512, 84.99246, 0, 0, 340) moveObject(gate, 6000, 1401.72900, -806.37512, 84.99246, 0, 0, 350) moveObject(gate, 6000, 1401.72900, -806.37512, 84.99246, 0, 0, 360) end addEventHandler("onResourceStart", root, girar)
  4. Hello, i'm trying to make a script that when a player clicks on the keypad, local screenW, screenH = guiGetScreenSize() function keypad () dxDrawRectangle(screenW * 0.3772, screenH * 0.2500, screenW * 0.2390, screenH * 0.5156, tocolor(52, 52, 52, 255), false) dxDrawRectangle(screenW * 0.3846, screenH * 0.2734, screenW * 0.2243, screenH * 0.0404, tocolor(255, 255, 255, 255), false) dxDrawRectangle(screenW * 0.4110, screenH * 0.3477, screenW * 0.0500, screenH * 0.0781, tocolor(254, 254, 254, 255), false) dxDrawRectangle(screenW * 0.4110, screenH * 0.6693, screenW * 0.0500, screenH * 0.0781, tocolor(255, 255, 255, 255), false) dxDrawRectangle(screenW * 0.4713, screenH * 0.6693, screenW * 0.0500, screenH * 0.0781, tocolor(255, 255, 255, 255), false) dxDrawRectangle(screenW * 0.5331, screenH * 0.6693, screenW * 0.0500, screenH * 0.0781, tocolor(255, 255, 255, 255), false) dxDrawRectangle(screenW * 0.4110, screenH * 0.4388, screenW * 0.0500, screenH * 0.0781, tocolor(255, 255, 255, 255), false) dxDrawRectangle(screenW * 0.4110, screenH * 0.5299, screenW * 0.0500, screenH * 0.0781, tocolor(255, 255, 255, 255), false) dxDrawRectangle(screenW * 0.4713, screenH * 0.5299, screenW * 0.0500, screenH * 0.0781, tocolor(255, 255, 255, 255), false) dxDrawRectangle(screenW * 0.5331, screenH * 0.5299, screenW * 0.0500, screenH * 0.0781, tocolor(255, 255, 255, 255), false) dxDrawRectangle(screenW * 0.5331, screenH * 0.3477, screenW * 0.0500, screenH * 0.0781, tocolor(255, 255, 255, 255), false) dxDrawRectangle(screenW * 0.4713, screenH * 0.4388, screenW * 0.0500, screenH * 0.0781, tocolor(255, 255, 255, 255), false) dxDrawRectangle(screenW * 0.4713, screenH * 0.3477, screenW * 0.0500, screenH * 0.0781, tocolor(255, 255, 255, 255), false) dxDrawRectangle(screenW * 0.5331, screenH * 0.4388, screenW * 0.0500, screenH * 0.0781, tocolor(255, 255, 255, 255), false) dxDrawText("1", screenW * 0.4110, screenH * 0.3477, screenW * 0.4610, screenH * 0.4258, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "center", "center", false, false, false, false, false) dxDrawText("2", screenW * 0.4713, screenH * 0.3477, screenW * 0.5213, screenH * 0.4258, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "center", "center", false, false, false, false, false) dxDrawText("3", screenW * 0.5331, screenH * 0.3477, screenW * 0.5831, screenH * 0.4258, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "center", "center", false, false, false, false, false) dxDrawText("4", screenW * 0.4110, screenH * 0.4388, screenW * 0.4610, screenH * 0.5169, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "center", "center", false, false, false, false, false) dxDrawText("5", screenW * 0.4713, screenH * 0.4388, screenW * 0.5213, screenH * 0.5169, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "center", "center", false, false, false, false, false) dxDrawText("6", screenW * 0.5331, screenH * 0.4388, screenW * 0.5831, screenH * 0.5169, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "center", "center", false, false, false, false, false) dxDrawText("7", screenW * 0.4110, screenH * 0.5299, screenW * 0.4610, screenH * 0.6081, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "center", "center", false, false, false, false, false) dxDrawText("8", screenW * 0.4713, screenH * 0.5299, screenW * 0.5213, screenH * 0.6081, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "center", "center", false, false, false, false, false) dxDrawText("9", screenW * 0.5331, screenH * 0.5299, screenW * 0.5831, screenH * 0.6081, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "center", "center", false, false, false, false, false) dxDrawText("ESC", screenW * 0.4110, screenH * 0.6693, screenW * 0.4610, screenH * 0.7474, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "center", "center", false, false, false, false, false) dxDrawText("OK", screenW * 0.4713, screenH * 0.6693, screenW * 0.5213, screenH * 0.7474, tocolor(0, 0, 0, 255), 1.00, "bankgothic", "center", "center", false, false, false, false, false) end function toggleCursor () showCursor(not isCursorShowing()) end bindKey("m", "down", toggleCursor) function keypadClick(button, state, wx, wy, wz, clickedElement) if button == "left" and state == "down" then if (clickedElement == keypad) then local x, y, z = getElementPosition(localPlayer) if (getDistanceBetweenPoints3D(x, y, z, wx, wy, wz) <=5) then triggerEvent ("keypad_panel", root) end end end end addEventHandler("onClientClicked", getRootElement(), keypadClick) function renderPanel () if panel == false then addEventHandler ("onClientRender", root, keypad) panel = true end end addEvent ("keypad_panel", true) addEventHandler ("keypad_panel", root, renderPanel) 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 it shows a dxGui, but, it dosen't show any errors and dosen't work, can someone help me?
  5. Estou começando a programar agora e estou tentando desenvolver um comando de ''Auxilio Emergencial'' que pode pegar R$600 a cada um dia (ou um determinado tempo) Só que eu não consigo de jeito nenhum colocar um timer function dinheiro(player, commandName, quantidade) givePlayerMoney(player, 600) exports.InfoBox:addBox(player, "success", "Seu Auxílio foi pago!") end addCommandHandler("auxilio", dinheiro)
  6. I wanted to ask if you can access variable x from scrip1.lua in script2.lua. The thing is that I have a special variable in a script that loads an XML file, and I wanted to create another script specifically for commands, and in it I wanted to acces the special variable.
  7. Oi, estou a bastante tempo tentando solucionar um problema em um script e não estou conseguindo. O script é de contagem regressiva, e eu estou tentando por para que somente "X" acl possa utilizar o comando, que até então, o script está permitindo que todos utilizem. este é o script virgem, sem as minhas modificações falhas; countdRunning = false function conteoTick (thePlayer) se restante == 0 then killTimer (conteoTimer) playSoundFrontEnd (root, 45) outputChatBox ("VAI VAI VAI!", root, 0,188,0) countdRunning = false else playSoundFrontEnd (root, 44) local factorGreen = 255 / (countdStart-1) local resultadoGreen = factorGreen * restante-factorGreen local factorSpaces = 12 / (countdStart-1) local resultSpaces = math.floor (factorSpaces * restante-factorSpaces) local permanentStr = "" para i = 0, resultSpaces do restanteStr = restanteStr .. "" end restanteStr = restanteStr .. restante outputChatBox (restanteStr, root, 255, resultadoGreen, 0) restante = restante - 1 end end addCommandHandler ("contar", função (thePlayer, cmd, startArg) --addCommandHandler ("countd", função (thePlayer , cmd, startArg) --addCommandHandler ("contagem regressiva", função (thePlayer, cmd, startArg) --addCommandHandler ("conteo", função (thePlayer, cmd, startArg) se countdRunning then outputChatBox ("Já existe uma contagem regressiva atual" , thePlayer) return else if startArg and tonumber (startArg) then countdStart = tonumber (startArg) else countdStart = 3 end if countdStart ~ = 3 and countdStart ~ = 4 then outputChatBox ("Disponível apenas: 3 e 4", thePlayer, 255,0,0) return end restante = countdStart outputChatBox (getPlayerName (thePlayer) .. "# FF8C00começouçou uma contagem regressiva ", root, 255.255.255 , true) conteoTick (thePlayer) conteoTimer = setTimer (conteoTick, 1000,0, thePlayer) countdRunning = true end end)
  8. addEventHandler("onResourceStart", resourceRoot, function(res) local resourceName = getResourceName(resourceRoot) local commandsList = {} --table to store commands for _, subtable in pairs( getCommandHandlers() ) do local commandName = subtable[1] local theResource = subtable[2] if not commandsList[theResource] then commandsList[theResource] = {} end table.insert( commandsList[theResource], commandName ) local commands = getCommandHandlers( theResource ) for _, command in pairs( commands ) do commandFound = command if commandFound then outputDebugString("Commands found in "..resourceName..": "..commandFound, 3, 255, 0, 0) end end end end) I'm trying to get all commands found in some resource, i'm trying to use this code, but doesnt works! any kind of help? please? How i want to work: On resource starts > Get Resource Name > Get Resource Commands > return (resName, Commands).
  9. I want to do this: Using webhook, something like this: -- created by zsenel local discordWebhookURL = "https://discord.com/api/webhooks/835103134270488596/FY5*********EXAMPLE************yKEaRsKJp4" function sendDiscordMessage(message) sendOptions = { formFields = { content = "Example:", username = "webhook - Example", embed = { description= "```Some user have typed \"help\" command.```", color= null, author= { name= "Webhook - Example" }, footer = { text = "I want to do this..." }, }, }, } fetchRemote ( discordWebhookURL, sendOptions, WebhookCallback ) end function WebhookCallback(responseData) outputDebugString("(Discord webhook callback): responseData: "..responseData) end function SendDiscordTestMessage(player, command, ...) local msg = table.concat({...}," ") -- for multiple words sendDiscordMessage(msg) end Return < Thats only a example do i want to do, any kind of help please?
  10. local gate = createObject(980, 1001.5, -1096.9000244141, 25.60000038147, 0, 0, 110) local marker = createMarker(1001.5, -1096.9000244141, 25.60000038147, "cylinder", 8, 0, 0, 0, 0) function moveGate(thePlayer) if isObjectInACLGroup("user." .. nomeAcc, aclGetGroup("TDF")) then moveObject(gate, 3000, 1001.5, -1096.9000244141, 20) end end addEventHandler("onMarkerHit", marker, moveGate) function move_back_gate() moveObject(gate, 3000, 1001.5, -1096.9000244141, 25.60000038147) end addEventHandler("onMarkerLeave", marker, move_back_gate) I think its all ok with this code, but... ERROR. I wrongly have deleted a wrong line on my code, thats all ok now guys, i think. local nomeAcc = getAccountName (getPlayerAccount (source))
  11. Hi guys, this is my first topic and I hope to get my answer soon :D The question I had was, can the cmd be entered into MTA:SA Server through Discord Bot? for example: Inside the discord: !kill <playerid> Then inside the MTA:SA: function kill(player) { setElementHealth(player, 0) } I just wanted to know if this is done or not. In that case, I'm glad you taught me a solution :D
  12. Hi friends, I have a small problem In the console it gives this warning Bad argument @ 'setElementModel' [Expected element at argument 1, got number '100'] Which corresponds to the following line setElementModel (tonumber(getElementData(accSys:getPlayerAcc(thePlayer), "cSkin"))) cods ---- admin duty skin ---- addCommandHandler("a209", function ( thePlayer, command ) if tonumber(getElementData(accSys:getPlayerAcc(thePlayer), "pAdmin")) < 10 then return false end setElementData(accSys:getPlayerAcc(thePlayer), "dSkin", 209) setElementModel (thePlayer, 209) end) --- admin off skin ---- addCommandHandler("o209", function ( thePlayer, command ) if tonumber(getElementData(accSys:getPlayerAcc(thePlayer), "pAdmin")) < 10 then return false end setElementModel (tonumber(getElementData(accSys:getPlayerAcc(thePlayer), "cSkin"))) end) in part of ---- admin duty skin ---- There is no problem in the ---- admin duty skin ---- part but In the second part, --- admin off skin ----, when I order, Warning comes The second part must set the player model from the part of cSkin But it does not and gives high warning Sorry for the bad English language Please help me, my only hope is you
  13. Mas não consigo, algo da errado no 'isElementInRange', alguém poderia me ajudar? addCommandHandler("car", function(thePlayer,veh) local x, y, z = getElementPosition (thePlayer) local veh = getElementsByType('vehicle') if isElementInRange(veh, x, y, z, 25) then outputChatBox("teste",thePlayer,255,255,255,true) end end end ) Print do erro: https://prnt.sc/12bhy03
  14. Пытались уже таблицой сделать не чего не вышло Очень странно! Что же не так?
  15. Anyone can send me a working yt mp3 converter API? Or how to create one, to play music from youtube on my server?
  16. Eu sou novo no fórum e novo em script em lua, queria saber qual o problema que o meu script de limpar chat não funciona, o que eu quero fazer é com que a ACL Staff consiga usar o comando... ( esse é o server side ) function limpar(player) local accountname = getAccountName(getPlayerAccount(player)) if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)) , aclGetGroup("Staff")) then outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") outputChatBox(" ") triggerClientEvent(root, "limparchat", root, getPlayerName( player ) ) else outputChatBox("Você não tem acessa a este comando !", player, 255, 100, 100, true) end end addCommandHandler("chat", limpar) (EDIT) O Erro do debug é este abaixo
  17. Welcome to my store If you want to buy from Turkey, please contact me on Discord (Hexon#0388) Contacts Discord: Hexon#0388 E-mail: [email protected] YouTube: https://www.youtube.com/hexondev Facebook: https://www.facebook.com/hexondev If you found a bug please ontat me on Discord (Hexon#0388) [MTA:SA] Fire system 0.2 (UPDATED AT 05/02/2021) [MTA:SA] WhatsApp messenger [MTA:SA] Animation system with custon anim support & anim circle [MTA:SA] Taximeter [MTA:SA] Car trailer [MTA:SA] Scratch card game [MTA:SA] Spinner with new design [MTA:SA] Pointing system [MTA:SA] Spike system (Free) [MTA:SA] Weapon skin panel [MTA:SA] Garbage collector job (Bone attach required!) [MTA:SA] Trucker job [MTA:SA] Container carrier job (FREE) [MTA:SA] Container crane job [MTA:SA] Attachment system [MTA:SA] Drone system [MTA:SA] Lightbar editor with multiple lightbar support and custom siren sound [MTA:SA] Lightbar editor with multiple lightbar support [MTA:SA] Lightbar editor with custom siren sound [MTA:SA] Lightbar editor [MTA:SA] CSGO style spinner
  18. function getPlayerID(id) v = false for i, player in ipairs (getElementsByType("player")) do if getElementData(player, "ID") == id then v = player break end end return v end function playerHasItem(player, itemID) for i, v in pairs(getElementData(player, 'TS:InventarioInfo')) do if type(v) == 'table' then if v['Item'] == tonumber(itemID) then return true end end end return false end function returnQntdItem(player, itemID) if (player) then for i, v in pairs(getElementData(player, "TS:InventarioInfo")) do if (type(v) == "table") then if (v['Item'] == tonumber(itemID)) then return v['Quantidade'] end end end end return false end function verificarDistancia (player, abordado) if player and abordado then local x,y,z = getElementPosition(player) local x2,y2,z2 = getElementPosition(abordado) local distancia = getDistanceBetweenPoints3D(x,y,z,x2,y2,z2) if distancia then return distancia end end end local items = { [9] = "Cerveja(s)", } function revista (thePlayer, commandName, id) if (tonumber(id)) then local targetPlayer = getPlayerID(tonumber(id)) if (targetPlayer) then if (verificarDistancia (thePlayer, targetPlayer) > 5) then outputChatBox ("O jogador com este ID não está perto o suficiente para ser revistado.", thePlayer, 255, 150, 0) return end for i, item in pairs (items) do if (playerHasItem (targetPlayer, i) == true) then else outputChatBox ("Mochila Vazia") outputChatBox ("Libere o Cidadão") end end else outputChatBox ("✘#ffffffINFO#0037FF✘➺ #ffffff O Cidadão tem "..returnQntdItem (targetPlayer, i).." "..item.." em sua mochila!", thePlayer, 0, 55, 255, true) end end end addCommandHandler ("revistar", revista) ja tentei de todas formas esse codigo e não consigo alguem poderia me dizer aonde esta o erro ou me ajudar no codigo?
  19. download it here https://github.com/rivor/dayz-mta screenshots http://prntscr.com/heso7h http://prntscr.com/hesp1n http://prntscr.com/hesp9l http://prntscr.com/hespjo http://prntscr.com/hesqgu http://prntscr.com/hesqqz http://prntscr.com/hesrb8 http://prntscr.com/hesrhg http://prntscr.com/hesrqh http://prntscr.com/hessgx http://prntscr.com/hested
  20. Sou iniciante em lua e estou tentando criar um script que faça com que quando o player esteja no "ModoPassivo" e pegue um veículo, o veículo dele fique blindado, e quando ele saia do "ModoPassivo" o veículo fique normal. Acontece que simplesmente não funciona. Alguem poderia me ajudar apontando onde errei ou algo do tipo? Server: function test47 (thePlayer) if getElementData ( thePlayer, "ModoPassivo" ) == true then local theVehicle = getPedOccupiedVehicle (thePlayer) if theVehicle and isElement (theVehicle) then setVehicleDamageProof (theVehicle, true) else setVehicleDamageProof (theVehicle, false) end end end
  21. Eu tenho um sistema de assalto e quero colocar um portão na porta da loja para que o assaltante não saia da loja; O portão vai fechar quando o player iniciar o roubo e vai abrir quando o roubo terminar, alguém consegue me ajudar?
  22. --Função no SERVER addEvent ("DS: Pegar_armas", true) addEventHandler ("DS: Pegar_armas", root, function (jogador, plano) if plano == "Bronze" then for _, v in ipairs (armas_bronze) do if not exports.inventario: hasItemS (jogador, v) then extensions.inventario: giveItem (jogador, v, 1, 1, 1, 1) end end elseif plano == "Prata" then for _, v in ipairs (armas_prata) do if not exports.inventario : hasItemS (jogador, v) depois exporta.inventario: giveItem (jogador, v, 1, 1, 1, 1) end end elseif plano == "Ouro" então triggerEvent ("TS: giveItem", source, source, 28, 1) - Arma elseif plano == "Diamante" then for _, v in ipairs (armas_diamante) do if not extensions.inventario: hasItemS (jogador, v) depois exportações.inventario: giveItem (jogador, v, 1, 1, 1, 1) end end end end) Essa função funciona da seguinte maneira, o jogador abre o painel e ao clicar para pegar armas esse elemento 'triggerEvent ("TS: giveItem", source, source, 28, 1)' seta no invetario do mesmo a arma com id 28 e 1 quantidade, na primeira vez funciona normalmente mas na segunda ele incrementa automaticamente 2 quantiade e assim sucessivamnete, o erro pode estar nesta parte?
  23. Доброго времени суток. Возникла необходимость читать на JS файлы, располагающиеся в http://mta/... (как правило там же, где и сам index.html). Вариант с input type = file отпадает, так как отсутствует возможность инжектнуть туда путь (путь к файлам не должен передаваться пользователем вручную). Пробовал разные костыли, но все они не работают из соображений безопасности ( как например загнать в css селектор в свойство content содержимое файла ). Остается вариант скачивания через XMLHttpRequest (возможен наверно аналог через fetch ). Не ясно еще возможно ли скачивание с локалхоста на локалхост. (Вопрос еще в том насколько быстро оно работать будет. Если будет.) P.S: Вариант препроцессинга html страницы на луа ( впихивание содержимого файла в значение какого либо dom объекта ) отпадает сразу, тк. суть задачи читать файлы именно на JS и именно в CEF.
  24. Eu peguei uma skin da net que supostamente ela foi feita com varias camadas para txd de roupas e etc... Porem eu sou novo mexendo com modelagens e texturas no MTA, Gostaria de saber se alguem sabe algum jeito de eu trocar camada por camada? Imagem da modelagem que mostra as camadas: https://prnt.sc/veg627 no jogo a skin vem padrão "nua"
  25. ShayF

    CoreMTA

    Hello everyone, my name is Shay. I'm a 19 year old scripter from USA who started a good community called CoreMTA. This community is dedicated towards teaching people how to script. We also occasionally post public scripts for download on our website, which are free to download and edit. It's our goal to help the MTA community as much as possible. If you have any questions feel free to message me, email me, hit me up on discord, whatever you need. ~ ShayF Website: CoreMTA Forums: CoreMTA Forums Discord: CoreMTA Discord
×
×
  • Create New...