Search the Community

Showing results for tags 'script'.



More search options

  • 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
  • Archive
  • Private Bugtracker

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


About Me


Gang


Location


Occupation


Interests

Found 668 results

  1. This is the dumbest question I've ever asked on this forum, but I have problem even not only with this. So, how can I add scripts from different folders in my meta.xml? And in these scripts, how can I load xml files from different folders, too? Any idea? If yes, please, show me example I know, that I would use xml = xmlLoadFile("filename.xml") But how to load xml in different folders? Same <script src="script.Lua" type="server"/> But how to tell MTA to load script from different folder?
  2. I tried to load a file, that is in a subfolder, nothing's happening, no errors in console. What's the problem (all code below)? Line of code in script, to load xml file: xml = xmlLoadFile("cars/saved.xml") meta.xml: <file src="cars/saved.xml"/> What's wrong? BTW, everything exists. IDK what's wrong with this, everything's is existing, file is assigned into xml. I clearly don't know what's worng.
  3. It should spawn me in the Las Venturas planning department but it spawns me to nowhere.. probably there is a problem with the dimension or idk.. local Exitdoor = createMarker( 385.23818969727,173.71939086914,1007.3828125, "arrow", 1.5, 150, 255, 255, 0 ) setElementInterior( Exitdoor, 3 ) function Exitd( player ) if (source == Exitdoor) then if getElementType(player) == "player" then fadeCamera ( player, false, 1, 0, 0, 0 ) setTimer ( fadeCamera, 1000, 1, player, true, 1 ) setTimer ( setElementPosition, 1000, 1, player, 1367, -1279, 13 ) setTimer ( setElementInterior, 1000, 1, player, 0, 1367, -1279, 13 ) toggleControl ( player, "fire", true ) end end end addEventHandler ("onMarkerHit", getRootElement() ,Exitd ) local Doorentry = createMarker(593.58807373047,-1250.8880615234,19.250591278076, "arrow", 1.5, 255, 255, 255, 0 ) function Doore( player ) if (source == Doorentry) then if getElementType(player) == "player" then fadeCamera ( player, false, 1, 0, 0, 0 ) setTimer ( fadeCamera, 1000, 1, player, true, 1 ) setTimer(setElementPosition, 1000, 1, player, 593.58807373047,-1250.8880615234,19.250591278076) setTimer ( setElementInterior, 1000, 1, player, 3, 593.58807373047,-1250.8880615234,19.250591278076 ) toggleControl ( player, "fire", false ) end end end addEventHandler ("onMarkerHit", getRootElement(), Doore )
  4. Eu gostaria de saber como faz para prender um player ou objeto junto a um player ou um veiculo como nesses vídeos em que o player fica preso a maca que por sua vez está presa a um player ou o meliante preso ao policial. https://m.facebook.com/watch/?v=708992856247025&_rdr Ou neste do minuto 4:35 à 5:50
  5. Selam. MTA sunucuları basite indirgenmiş "Araç,Karakter,Silah,Blip (Haritada Simge),Kodlu Kapı,3D Ses" oluşturucu programımı bitirip sizlerle paylaşmak istedim. Klasörleri programın çalıştığı dizine oluşturur. Araç ve Silah ID'leri isimleri ile beraber sizin için hazır olarak ComboBox'a eklenmiştir. Programa dair görüntüler; VirusTotal: https://www.virustotal.com/#/file/ab64043693b44cec50caa1358bc7b6fe279758f5962b08cbded351fb706a1d5a/detection Link: http://link.tl/1jzJ9 Programın sorunlarını ve eksik bulduğunuz kısımları bildirirseniz mutlu olurum.
  6. local marker = createMarker(2167.1208496094,-1672.4111328125,13.075506210327,"cylinder", 1.5, 139, 0, 285,77) local Blip = createBlipAttachedTo(marker,31) function myCommandHandler(thePlayer) if isElementWithinMarker(thePlayer, marker) then takePlayerMoney( thePlayer, 35000 ) outputChatBox('Gratulálok az új lakásához! A Lakás kulcsai mostantól az Öné! (IK: /086372)',player,60,238,7) end end addCommandHandler('lakasvetel1',myCommandHandler) So with this if I'm in the marker and type the command it gonna take the money from me and gonna get the output message. It obviously works. But I want a part in this script that does not allow you (with an outputchatbox text) to take the money from you when entering the command when you dont have sufficient money. Cause currently it just goes to minus, I mean my money even if I dont have sufficient money..
  7. lo local vehicleSlotID = 0 addCommandHandler("car",function(source,cmd, vehicle) if not vehicle then return outputChatBox("/"..cmd.." [ID/ VehicleName]",source) end local playerX, playerY, playerZ = getElementPosition(source) local vehID = tonumber(vehicle) and tonumber(vehicle) or getVehicleModelFromName(vehicle)
  8. local vehicleSlotID = 0 addCommandHandler("car",function(source,cmd, vehicle) if not vehicle then return outputChatBox("/"..cmd.." [ID/ VehicleName]",source) end local playerX, playerY, playerZ = getElementPosition(source) local vehID = tonumber(vehicle) and tonumber(vehicle) or getVehicleModelFromName(vehicle) Examples : if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Vip" ) ) then
  9. So I'd need a script what with typing a command would make a blip appear in a random position on the map (and radar) and if you reach it ,it disappears. Is it possible to make at all
  10. Pessoal eu to fazendo um menu no canto direito da tela, com a dxDrawText, funcionou certinho ate olhei no forum para deixar o dxDrawText no canto direito da tela e do lado esquerdo so do lado esquerdo eu consegui fazer, mais o lado direito ele some , vou mostrar uma imagem. Print: https://ibb.co/wsz6929 addEventHandler("onClientRender", getRootElement(), function() local menuCX = screenWidth*0.545 local menuCY = screenHeight*0.135 dxDrawRectangle(menuCX-2, menuCY+110, screenHeight*0.25, screenHeight*0.12, tocolor(0, 0, 0, 170)) dxDrawText("Murders: ",menuCX+3,menuCY+131,0,0,tocolor(255,255,255,255),1, "default", "left", "top", false, false, false, true, false) end) Quando eu coloco o right não aparece mais na tela mais o left funcionou certinho. eu queria que ela fica-se encostado no lado direito da tela
  11. I want create a HUD with image progress bars. I think i need dxDrawImageSection, but i don't know how to use this for a progress bar. Anyone can give me a example of this progress bar with imagesection?
  12. Boa Noite, Quero acrescentar 1 a opção de freezar o veiculo dentro de um ColShope, eu utilizo essa função para proteger os veículos e quero colocar essa opção junto a ela. So que não sei como eu identifico o player que ta dentro do veiculo. Quero colocar setElementFrozen, mais so quando o jogador estiver fora do veiculo. setTimer(function() for i,col in pairs(getElementsByType("colshape"))do if getElementData(col,"BaseCol") then for i,veh in pairs(getElementsWithinColShape(col,"vehicle"))do setVehicleDamageProof(veh,true) --setElementFrozen (veh,true) --- Freezar o veiculo quando o jogador nao estiver dentro do veiculo. end end end end,1000,0)
  13. Pessoal fiz um sistema de salvar dados q ESTÁ funciomando corretamente(quando a pessoa da disconect) mais quando dar /reconnect n funfa. Estou usando o parametro (onPlayerQuit)
  14. Boa Noite, Jpa estou 1 semana tentando fazer essa função mais nada da certo, ou quando acho que da certo aparece bug. Eu resolvi hoje tentar de volta, consegui so que ele fica criando varias vezes o objeto, ai resolvi colocar um setElementData so que ai ao inves de aparecer 4 objetos que ta no chao, ele aparece apenas 2. Ou o outro lado do X,Y,Z nao aparece o objeto do chao, eu preciso muito arrumar isso. Alguem pode me ajuda pelo discord, ou aqui pelo forum, pois eu mando mais demora a resposta. Script: Client.Lua obejctItem = {} function startRefreshLoot() if getElementData(getLocalPlayer(),"logedin") then for i,col in pairs(getElementsByType("colshape"))do if getElementData(col,"itemloot") == true then local cx, cy, cz = getElementPosition (col) local px, py, pz = getElementPosition (localPlayer) --Aqui você acha a localização do player. local distancia = math.floor(getDistanceBetweenPoints3D (cx, cy, cz, px, py, pz)) if tonumber(distancia) <= 50 then obejctItem = {} if getElementData(localPlayer,"objetsddsdsoCdd22") == 1 then outputChatBox("JA CRIADO") return end for i, item in ipairs(itemTable["other"]) do counter = 0 if getElementData(col,item[1]) and getElementData(col,item[1]) > 0 then if counter == 3 then break end counter = counter + 1 obejctItem[counter] = createObject(item[2],cx+math.random(-1,1),cy+math.random(-1,1),cz-0.875,item[4]) setObjectScale(obejctItem[counter],item[3]) setElementCollisionsEnabled(obejctItem[counter], false) setElementFrozen (obejctItem[counter],true) end end setElementData(localPlayer,"objetsddsdsoCdd22",1) outputChatBox("CRIADO") setTimer(function() startRefreshLoot() end,5000,1) elseif tonumber(distancia) > 50 and tonumber(distancia) < 60 then if (getElementData(localPlayer,"objetsddsdsoCdd22") == 1) then for i,colObjet in pairs(obejctItem)do if isElement(colObjet) then destroyElement(colObjet) colObjet = false outputChatBox("DESTROI"--[[.." / Y: "..cy.."/ Z: "..cz--]]) end end setElementData(localPlayer,"objetsddsdsoCdd22",false) end end end end end end startRefreshLoot() obrigado desde de já
  15. So basically I wanna have a marker in which you enter, a menu will appear and by pressing the arrows you can click between the different (vehicle) pictures (of what are in the library of the resource) and the name of the vehicle should appear below each picture. Is it possible to make a script like this? I really need your help guys, I already tried a lot but failed so far on this one..
  16. So basically I want it to work in this way -> The car enters the cylinder then some text gonna appear in chat like "repairing is under process" and you should wait for example 10 seconds before the starting of the function. The function and everything is below in my script. Can someone help in adding this into it? The script: spray1 = createMarker ( -2437.853515625, 1036.1303710938, 49.5, "cylinder", 5, 0, 255, 0, 50 ) function Reparar ( thePlayer ) local dinero = getPlayerMoney ( thePlayer ) local vehicle = getPedOccupiedVehicle ( thePlayer ) if ( not vehicle ) then outputChatBox( "#c8c8c8Steven: #ffffffGuruljon be a járműjével ide Uram, ha szervízre van szüksége. ", thePlayer, 255, 0, 0, true ) return end if ( dinero >= 300 ) then takePlayerMoney( thePlayer, 300 ) fixVehicle( vehicle ) outputChatBox ( "#c8c8c8Steven: #00ff00Sikeresen megjavítottam a járművét Uram!", thePlayer, 0, 255, 0, true ) else outputChatBox ( "#c8c8c8Steven: #ff1100Ne vesztegesse itt az időmet! 300$ alatt nem vállalok javítást!", thePlayer, 255, 0, 0, true ) end end addEventHandler( "onMarkerHit", spray1, Reparar ) spray2 = createMarker ( 1219.9140625,188.96229553223,18.952247619629, "cylinder", 5, 0, 255, 0, 50 )
  17. Bom dia, Preciso de uma ajuda, eu tenho um sistema que eu fiz um modo Server.Lua e quero tirar ele e colocar como client so que da erro AVISO: Bad argument @'xmlNodeGetChildren' [Expected xml-node at argument 1, got boolean] blipBases = {} addEvent("blipsMapsBases",true) addEventHandler("blipsMapsBases",getRootElement(),function(typeB) if blipBases then for i,blip in pairs(blipBases)do destroyElement(blip) end blipBases = false end if tonumber(typeB) then if not blipBases then blipBases = {} end xml2 = xmlLoadFile("others/Save/Saves/Panel/Bases.xml") for i,node in ipairs(xmlNodeGetChildren(xml2)) do -------------- AVISO AQUI if xmlNodeGetAttribute(node,"ownerAccount") == "AvailableBase" then local baseName = xmlNodeGetName(node) local baseCol = getBaseColshape(baseName) outputChatBox("OK") end end xmlUnloadFile(xml2) end end)
  18. Boa Noite, Eu to com problema, fiz um timer a onde cria o objeto quando chega proximo da col, e deu certo mais ele fica criando varias vezes o mesmo objeto e queria que cria-se apenas 1 vez, so que com o timer rodando ainda setTimer(function(col) local cx, cy, cz = getElementPosition (col) --Aqui você deve colocar a posição do loot.. local px, py, pz = getElementPosition (localPlayer) --Aqui você acha a localização do player. local distancia = math.floor(getDistanceBetweenPoints3D (cx, cy, cz, px, py, pz)) -- outputChatBox(distancia) if tonumber(distancia) <= 20 then --Caso a distância seja maior ou igual que "x", então.. outputChatBox("COL PROXIMA: "..distancia) -- if not(isElement(obejctItem[counter])) then obejctItem[counter] = createObject(item[2],cx,cy,cz,item[4]) setObjectScale(obejctItem[counter],item[3]) setElementCollisionsEnabled(obejctItem[counter], false) setElementFrozen (obejctItem[counter],true) outputChatBox("OBJETOS CRIADOS") -- end else -- if isTimer(timerObjetos) then -- killTimer(timerObjetos) -- end if (cx and cy and cz) then if isElement(obejctItem[counter]) then destroyElement(obejctItem[counter]) end end -- outputChatBox("COL FORA: "..distancia) end end,1000,0,col)
  19. local NPC = createPed(285,376.39947509766,-65.617164611816,1001.5078125) setElementInterior( NPC, 10 ) function NPCRotate ( ) local rotX, rotY, rotZ = getElementRotation(NPC) -- get the local players's rotation setElementRotation(NPC,0,0,rotZ+10,"default",true) -- turn the player 10 degrees clockwise end addCommandHandler ( "turn", NPCRotate ) local screenWidth, screenHeight = guiGetScreenSize() local range = 10 function NPCnametag() local x,y,z = getPedBonePosition(NPC,6) local px,py,pz = getElementPosition(localPlayer) if getDistanceBetweenPoints3D(x,y,z,px,py,pz) <= range then local sx,sy = getScreenFromWorldPosition(x,y,z) if sx then dxDrawText("Bob",sx,sy,sx,sy,tocolor ( 255, 255, 0, 255 ), 2,"sans") end end end function HandleTheRendering() addEventHandler("onClientRender",getRootElement(), NPCnametag) end addEventHandler("onClientResourceStart",resourceRoot, HandleTheRendering)
  20. local rootElement = getRootElement() local NPC = createPed(124,0,0,5) local screenWidth, screenHeight = guiGetScreenSize() function NPCnametag() local sx,sy = getScreenFromWorldPosition (getElementPosition(NPC)) if sx then dxDrawText("Bob",sx,sy,screenWidth, screenHeight,tocolor ( 255, 255, 0, 255 ), 2,"sans") end end function HandleTheRendering() addEventHandler("onClientRender",rootElement, NPCnametag) end addEventHandler("onClientResourceStart",rootElement, HandleTheRendering)
  21. Olá pessoal, boa tarde! Faz tempo que tenho um conhecimento relativamente avançado em Lua e MTA Scripting, porém não sabia absolutamente NADA em relação á banco de dados SQLite. Há pouco tempo atrás aprendi sobre, porém preciso de ajuda com o seguinte problema: » Preciso salvar no banco de dados, a cada vez que um comando é efetuado, salvar +1 número na célula da coluna... Deu pra entender? Tipo assim: Carro Estoque Camaro 1 Quando eu efetuar o comando: Carro Estoque Camaro 1 +1 *eu preciso pegar o valor existente na coluna e somar 1, porém estou com problemas para fazer haha *Não postei meu código pois simplesmente não consegui fazer um... hahah
  22. Hey! My (not so original) idea is putting this /rp command into the server (local). I want it to work like this -> If you write your IC action next to /rp in chat (for example: /rp fasten the seat belt) then it gonna appear above the player in this form -> *fasten the seat belt. So basically it would repeat the action text above the player who said it (without the "/rp"). Is it possible to script it? If it is, then can someone help me, Im kindda new in scripting. If its not possible then it would be still cool if the repeated action would appear only in the chatbox. But the best and the coolest would be if it would appear above the player.. Thank you in advance!!
  23. Bom dia alguem poderia me ajudar estou com uma dificuldade no meu chat local, estou tentando colocar o meu chat local para quando os jogadores usar codigos de cores no nick deles ficar branco a cor quando eles for falar no chat, Assim bloqueando as cores para não modificar no chat local. Esse script abaixo é meu chat local, espero que me ajudem, já tem muito tempo que tou tentando não consigo de jeito nenhum. DistanciaDoChatLocal = 200 -- Metros MensagemFalandoRapidoDemaisLocal = '#ffffff[ #CE98EBAnti Flood #ffffff] - #ffffffVocê Esta Digitando Muito Rapido, Aguarde 2 Segundos' -- ComandoDoChatGlobal = "f" -- Ex /g Mensagem ComandoDoChatGlobal2 = "u" ValorDoChatGlobal = 0 -- Dinheiro --MensagemFalandoRapidoDemaisGlobal = '#ffffff[ #FF0000Anti Flood #ffffff] - #ffffffVocê Esta Digitando Muito Rapido, Aguarde 5 Segundos' MensagemVoceEstaMutadoGlobal2 = '#ffffff[ #FF0000Aviso #ffffff] - #FF0000Você Esta Mutado, e Não Podera Utilizar os Chat do Servidor' MensagemVoceEstaMutadoGlobal = '#ffffff[ #FF0000Aviso #ffffff] - #FF0000Você Esta Mutado, e Não Podera Utilizar os Chat do Servidor' -------------------------------------------------------------------------------------------- -- Config do Chat Local addEventHandler("onPlayerChat", root, function(tresc, msgtype) if (msgtype == 0) then cancelEvent() local x,y,z = getElementPosition(source) for key, gracze in ipairs(getElementsByType("player")) do local x2,y2,z2 = getElementPosition(gracze) -- if getElementData (source, "ChatLocal:Delay", true) then -- outputChatBox ( MensagemFalandoRapidoDemaisLocal, source, 255, 255, 255, true ) return end if ( getDistanceBetweenPoints3D ( x, y, z, x2, y2, z2 ) < DistanciaDoChatLocal ) then local int = getElementInterior ( source ) local dim = getElementDimension ( source ) local int2 = getElementInterior ( gracze ) local dim2 = getElementDimension ( gracze ) if ( int == int2 and dim == dim2 ) then conta = getAccountName ( getPlayerAccount ( source ) ) if isObjectInACLGroup ("user."..conta, aclGetGroup ( "Console" ) ) then outputChatBox("*#FFEE00ʙᴄʙ ʟᴏᴄᴀʟ #FFEE00- #FF6A6APresidente #FFEE00- #ffffff"..getPlayerName(source).. " ("..getElementData(source, "ID")..")#FFEE00 - #ffffff#FF6A6A "..tresc, gracze, 255, 255, 255, true) elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Admin" ) ) then outputChatBox("*#FFEE00ʙᴄʙ ʟᴏᴄᴀʟ #FFEE00- #FF6A6AVice Presidente #FFEE00- #ffffff"..getPlayerName(source).." ("..getElementData(source, "ID")..")#FFEE00 - #ffffff#FF6A6A "..tresc, gracze, 255, 255, 255, true)
  24. So, i made a script using Lua, basically the script is it : local a = false game.Players.PlayerAdded:Connect(function(player) game.Workspace.Part.Touched:Connect(function(hit) while true do wait(0.5) if hit.Parent:FindFirstChild("Humanoid") and a == false and player.GameStats.Body.Value <= 200 then a = true hit.Parent.Humanoid:TakeDamage(50) player.GameStats.Body.Value = player.GameStats.Body.Value + 2 wait(1) a = false end while true do wait(0.5) if hit.Parent:FindFirstChild("Humanoid") and a == false and player.GameStats.Body.Value >= 201 then a = true hit.Parent.Humanoid:TakeDamage(1) player.GameStats.Body.Value = player.GameStats.Body.Value + 2 wait(1) a = false end end end end) end) So, i made this script with a program called Roblox Studio, and then i made a damage brick, that only will take 50 dmg if who touched has 200 (or less) Body force, otherwise the brick will deal 1 dmg. Ok, the script's working, but when my friend joins(I'm 1 quadrillion body and he's 160) the brick deal 50 damage for me and for he, not 1 only for me and for he, 50. SO, basically i want to solve that error, the script only works if just 1 guy in the server, basically a individual script.
  25. EU ACHEI O PROBLEMA, MAIS PRECISO DE AJUDA. No meu servidor de DayZ ele tem objetos criados que são as GEAR itens que dropa em toda parte do mapa e na area 51 também e como a area 51 é editada com objetos também ela fica pistando eu vou mostrar imagens. UMA PARTE DO SCRIPT DA GAMEMODE, ESSE SCRIPT ABAIXO É AS 'GEAR' a onde dropa os itens dentro de uma Col. OBS: esse escript é server.Lua function createPickupsOnServerStart() iPickup = 0 for i,pos in ipairs(pickupPositions["residential"]) do iPickup = iPickup + 1 createItemLoot("residential",pos[1],pos[2],pos[3],iPickup) end for i,pos in ipairs(pickupPositions["industrial"]) do iPickup = iPickup + 1 createItemLoot("industrial",pos[1],pos[2],pos[3],iPickup) end for i,pos in ipairs(pickupPositions["farm"]) do iPickup = iPickup + 1 createItemLoot("farm",pos[1],pos[2],pos[3],iPickup) end for i,pos in ipairs(pickupPositions["supermarket"]) do iPickup = iPickup + 1 createItemLoot("supermarket",pos[1],pos[2],pos[3],iPickup) end for i,pos in ipairs(pickupPositions["military"]) do iPickup = iPickup + 1 createItemLoot("military",pos[1],pos[2],pos[3],iPickup) end end createPickupsOnServerStart() function createItemLoot(lootPlace,x,y,z) col = createColSphere(x,y,z,1.25) setElementData(col,"itemloot",true) setElementData(col,"parent",lootPlace) setElementData(col,"MAX_Slots",12) for i, item in pairs(itemTable[lootPlace]) do if not tonumber(item[5]) then outputServerLog(item[1]) end local value = math.percentChance (item[5],math.random(1,2)) setElementData(col,item[1],value) end refre:~emLoot (col,lootPlace,true) return col end > Essa imagem é com os objetos da gamemode(ITENS) ATIVADO, olhe como ela some os objetos. https://ibb.co/tDKn0Lg > Já essa aqui é com esse aqui é com os (ITENS) DESATIVADO DA GAMEMODE, ela renderiza certinho o mapa. https://ibb.co/YPsG9VH Ai queria se colocando uma função de distancia da col de cada GEAR, iria resolver ou o que?