Jump to content

Search the Community

Showing results for tags 'script'.

  • 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. Hello, I want to ask you for help. I'm trying to create a gang system but I do not want to use mta's default createTeam. I wanted to use an elementData, but I do not know how to do it. Tell me how to do in elementData. I have one with the default createTeam that is working, I wanted to change this by elementData. function createGang(name, tag, gr, gg, gb) if getTeamFromName(name) then triggerClientEvent(source,"servers",source) outputChatBox("#666666[#B30A0AGang#666666] #FF0000Uma gang com esse nome já existe", source, 255, 255, 255, true) return else if name == "" or name == " " or tag == "" or tag == " " then triggerClientEvent(source,"servers",source) outputChatBox("#666666[#B30A0AGang#666666] #FF0000Você deve completar todos os campos pedidos para criar uma gang.", source, 255, 255, 255, true) else gangCreate = createTeam(name) setPlayerTeam(source, getTeamFromName(name)) setTeamColor(gangCreate, gr, gg, gb) gang = getPlayerTeam(source) setElementData(source, "GangPTT", lider) if not getElementData(gang, "GangPlayer1") then setElementData(gang, "GangPlayer1", getPlayerName(source)) end local r, g, b = getTeamColor (gang) local hex = string.format("#%.2X%.2X%.2X", r, g, b) triggerClientEvent(source,"servers",source) outputChatBox("#666666[#B30A0AGang#666666] #FFFFFFVocê criou a gang #666666[ "..hex..getTeamName(gang).." #666666]#FFFFFF e agora é lider dela.", source, 255, 255, 255, true) end end end addEvent("createGang", true) addEventHandler("createGang", getRootElement(), createGang)
  2. Idea: Creating a marker on Map "Draqonlife" (gamemode play), which leads you to to another map. In this case "DraqonDocks" (gamemode race). known issues to be ignored: event triggers any marker known issues to be fixed: after gamemode change, the map wont change. Marker.lua : >Creates a marker (works) >Triggers player on entering and leaving any Marker (works) >Starts gamemode race (works) ! Does not start Map ! !! No error when map does not start !! !! ERROR: lobby/ChangeMode.lua:7: attempt to call global 'changeGamemodeMap' (a nil value) !! resourceRoot = getResourceRootElement() function onCurrentResourceStart(Draqonlife) local resourceName = getResourceName(Draqonlife) outputChatBox("Hello and welcome to " .. resourceName .. "!") Marker = createMarker (2860, -2115, 10, "corona", 4.0, 0, 0, 255, 255) -- create Marker end addEventHandler("onResourceStart", resourceRoot, onCurrentResourceStart) //Create Marker function MarkerHit( hitElement, matchingDimension ) local elementType = getElementType( hitElement ) local resource = getResourceFromName ("race") -- | this works, startResource( resource ) -- | really good tho --local resource = getResourceFromName ("DraqonDocks") --startResource( resource ) // If I try to start the map Resource directly after the race resource, // the Map resource wont load up end addEventHandler( "onMarkerHit", root, MarkerHit) //Should start gamemode race (and map) function MarkerLeave( leaveElement,matchingDimension) local elementType = getElementType( leaveElement ) local resource = getResourceFromName ("DraqonDocks") -- |Also not working, server ignores this line, startResource( resource ) -- |as it Ignores this line too. end addEventHandler( "onMarkerLeave", root, MarkerLeave ) ChangeMode.lua > My Idea to fix this problem --Thats why i want to import the mapmanager (or the function changeGamemodeMap) --Sadly I found no useful documentation for my case. --adding <exports.mapmanager:changeGamemodeMap/> to the meta.xml of the scripts didnt work function changeGamemodeMap() changeGamemodeMap("DraqonDocks", "race") -- this doesnt work end addCommandHandler("420", changeGamemodeMap) ___________________________________________________________________________________________ It would be very kind if someone could enlight me and give me a short introduction to using mapmanagers functions properly. Sadly the Mapmanager post in wiki didnt help me too much. If you find a fix for the existing (half working) Marker.lua, then I'd be really glad too I would love to get feedback and already thank everyone
  3. function adminuzi(thePlayer, commandName, ...) for i,v in pairs(getElementsByType( "player" )) do for group, serverGroupName in pairs( names ) do if isGuestAccount( getPlayerAccount( v ) ) then return end if group then if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup( group ) then message = table.concat({...}, " ") groupName = names["group"] end end end end outputChatBox("#0088FF["..groupName.."]#d8001f "..getPlayerName(thePlayer)..": "..message,getRootElement(),0,0,0,true) end addCommandHandler("asay", adminuzi) Sometimes working the "asay xy" cmd, sometimes not working. How to fix this bug?
  4. local titles = { "AdminSegéd", "Moderátor", "SzuperModerátor", "Admin", "FőAdmin", "Tulajdonos", "Fejlesztő" } function getPlayerAdminTitle() local text = titles if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Admin")) then text = "Tulajdonos" elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("FoAdmin")) then text = "FőAdmin" elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Adminseged")) then text = "AdminSegéd" elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("KisAdmin")) then text = "Admin" elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Fejleszto")) then text = "Fejlesztő" elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Moderator")) then text = "Moderátor" end end function getFixedName(player) if isElement(player) then local hisName = getPlayerName(player) if hisName then result = string.gsub(hisName, '#%x%x%x%x%x%x', '') if result then return result end end end end function adminuzi(thePlayer, commandName, ...) if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("Admin")) or isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("FoAdmin")) or isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("Adminseged")) or isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("KisAdmin")) or isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("Fejleszto")) or isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("Moderator")) then if not (...) then outputChatBox("#00FF7F[Használat]:#FFFFFF /".. commandName .." [üzenet]", thePlayer, 0, 206, 209,true) else local adminrang = getPlayerAdminTitle(thePlayer) message = table.concat({...}, " ") local playerName = getFixedName ( thePlayer ) outputChatBox("#0088FF[SUPERFUN-Admin]#d8001f "..playerName..": "..message,getRootElement(),0,0,0,true) end end end addCommandHandler("asay", adminuzi, false, false) i have this script, and i get this warnings/error: How to fix this?
  5. Jogador fica a travesando o objeto que é feito a base,queria saber porque isso acontece e como fazer para isso n acontecer mas?
  6. I want add a function to the admintag script, but i don't know how to create. When i type this for example: "asd", the script make this automatically to "Asd". And may add to this function special characters? For example: é,á,ű,ő,ó,ú...etc? Those too replace to big letter sorry for my bad english:(
  7. Hey guys! I had suggested a script in SAUR before.. my nick there is "airforce" and I had built the script. It got good amount of votes, but sadly I got banned for "ban evading" which was for "no absolute reason" seriously. So finish my anger, I removed that suggestion and I am adding my script here. (100% working. 224 lines, written in Lua) You can modify my script in any way you want. All permissions granted. If you're willing to make a server with my script, then yes! for sure! https://uploadfiles.io/zp685 Enjoy! Yours Sincerely, DeepuDon PS: PEACE! SAUR :Oers!
  8. i want create a cool radar for mta, but i don't know, how to make a radar I do not want blips, just localplayer, and otherplayers blip. how to create? sorry for my very bad english
  9. local image = dxCreateTexture( "tesztkep.jpg" ) local white = tocolor(255,255,255,255) addEventHandler("onClientRender", root,function() dxDrawMaterialLine3D( 2463.71143, -1658.97595, 15.31024,2463.55469, -1651.24609, 15.47028,image,7,white ) end) this is my code, and this is the problem: how to fix this rotation problem?
  10. I was thinking of something like "putting two heads" on a character, and then the first, which would be the helmet, would take a shot and leave, exposing the "main" head. Is it possible to do?
  11. Boa noite, novamente eu estou com varios projetos em mente, e estou criando eu mesmo por isso venho aqui no forum pedir ajuda, por que eu nao gosto de pega coisa feita, gosto de aprender com meus erros... Bom mais vamos la OPS: FIZ ESSE SISTEMA DO ZERO (AGORA MESMO FIQUEI 3 HORAS FAZENDO) Fiz esse Painel de radio, nele vai ter varios IP de radios.. o jogador seleciona a radio que quer e clica em Escutar Musica (botão), e a musica começa a toca e se quiser pausar ele clica no botão (Pausar Musica)... Só que no sistema se vc fica varias vezes clicando em "escutar musica" com ip selecionado começa a toca varias vezes a radio e buga, e nao da para pausar mais, outro bug é que ele seleciona todos os IP que esta na tabela da gaveta dele ["","",""] ai começa toca varias radio junto Podem me ajudar? GuiOpen = guiCreateWindow(60, 197, 400, 470, "", false) GuiTable = guiCreateGridList(21, 34, 358, 304, false, GuiOpen) Guiesta = guiGridListAddColumn(GuiTable,"Estação da Radio",0.60) Guilocal = guiGridListAddColumn(GuiTable,"Localidade",0.35) GuiButtonPlay = guiCreateButton(21, 355, 170, 54, "Escutar Radio", false, GuiOpen) GuiButtonStop = guiCreateButton(205, 355, 170, 54, "Pausar Radio", false, GuiOpen) TbaleMusic = { ["Radios"] = { {"Sound POP","Brasil","https://radiosoundpop.com.br/ouvir/windows.asx"}, {"Jovem Pan","Brasil","http://69.175.13.131:8280"} }, ["Generos"] = { {"RAP","Brasil","http://67.228.177.4:9944/"}, {"RAP 2","Brasil","http://69.64.56.11:8130/ "}, {"Funk","Brasil","http://96.47.227.156:9122/"} }, } addEventHandler("onClientGUIClick",getRootElement(),function(Guiesta) if source == GuiButtonPlay then if SpamTime and SpamTime + 7000 > getTickCount() then return else SpamTime = getTickCount() end local Lists = guiGridListGetItemText(GuiTable,guiGridListGetSelectedItem(GuiTable)) if Lists ~= "" then for i,music in ipairs(TbaleMusic["Radios"])do sound = playSound(music[3]) setSoundVolume(sound,1) alert("Você esta escutando: "..music[3]) end for i,music in ipairs(TbaleMusic["Generos"])do sound = playSound(music[3]) setSoundVolume(sound,1) alert("Você esta escutando: "..music[3]) end end elseif source == GuiButtonStop then local ListsStop = guiGridListGetItemText(GuiTable,guiGridListGetSelectedItem(GuiTable)) if ListsStop ~= "" then for i,music in ipairs(TbaleMusic["Radios"])do sound = playSound(music[3]) setSoundVolume(sound,0) end for i,music in ipairs(TbaleMusic["Generos"])do sound = playSound(music[3]) setSoundVolume(sound,0) end end end end) function refreshList () if(Guiesta) then row1,column1 = guiGridListGetSelectedItem(GuiTable) guiGridListClear(GuiTable) local rows = guiGridListAddRow(GuiTable) guiGridListSetItemText(GuiTable,rows,Guiesta,"- Radios",true,false) for id,Radioss in ipairs(TbaleMusic["Radios"])do local Radiosssss = guiGridListAddRow(GuiTable) guiGridListSetItemText(GuiTable,Radiosssss,Guiesta,Radioss[1],false,false) guiGridListSetItemText(GuiTable,Radiosssss,Guilocal,Radioss[2],false,false) end local rowss = guiGridListAddRow(GuiTable) guiGridListSetItemText(GuiTable,rowss,Guiesta,"- Generos",true,false) for id,Radio in ipairs(TbaleMusic["Generos"])do local Radios = guiGridListAddRow(GuiTable) guiGridListSetItemText(GuiTable,Radios,Guiesta,Radio[1],false,false) guiGridListSetItemText(GuiTable,Radios,Guilocal,Radio[2],false,false) end if row1 and column1 then guiGridListSetSelectedItem(GuiTable,row1,column1) end end end Obrigado desde de já
  12. Boa Tarde, precisava de uma ajuda nesse sistema que eu fiz ele cria uma caixa com as cordenadas da tabela e cria um blip marcando local onde esta a caixa SpwanLoot = { {252.67047,1802.4464,7.4140625}, {219.33887,1826.9991,6.4140625}, {261.08423,1853.5132,8.7578125}, {280.4285,1838.0157,17.648058}, } function removeLootsMilitarys (blip,Military,LootMility) if isElement(blip) then destroyElement(blip) end if isElement(Military) then destroyElement(Military) end if isElement(LootMility) then destroyElement(LootMility) end end function LootMilitarys () local item_id = math.random( 3,#SpwanLoot ) local x,y,z = SpwanLoot[item_id][1], SpwanLoot[item_id][2], SpwanLoot[item_id][3], SpwanLoot[item_id][4] Military = createObject(964,x,y,z, 0, 0, 0) outputChatBox("CRIADO") blip = createBlip ( x,y,z, 23 ) LootMility = createColSphere(x,y,z,3) attachElements(LootMility, Military, 0, 0, 0) setElementData(Military,"parent",LootMility) setElementData(LootMility,"parent",Military) setElementData(LootMility,"Loot Militar",true) setElementData(LootMility,"MAX_Slots",0) setElementData(LootMility, "MAX_Slots", 0) setTimer(removeLootsMilitarys,120000,1,blip,Military,LootMility) end setTimer(LootMilitarys,120000,0) O problema é que ele só cria 1 caixa, eu queria que ela cria-se 3 caixa (usando 3 cordenadas da tabela) Tentei usar esse aqui ate local item_id = math.random( 3,#SpwanLoot ) Obrigado
  13. I have a gun sight system, but it keeps warning me when I click to aim ('Mouse2') I did a function to see if the error was going to go I'm going to put the old script and what I did PLEASE WHAT SHOULD I DO? old bindKey("mouse2","down",function() Crosshair_table = {} if getElementData(getLocalPlayer(),"sight") then if oldSight and oldSight == getElementData(getLocalPlayer(),"sight") then return end defaults = dxCreateTexture(getElementData(getLocalPlayer(),"sight")) oldSight = getElementData(getLocalPlayer(),"sight") Crosshair_table = dxCreateShader("utilitarios/painel/texreplace.fx") engineApplyShaderToWorldTexture(Crosshair_table, "siteM16") dxSetShaderValue(Crosshair_table, "gTexture", defaults) end end) I did bindKey("mouse2","down",function() Crosshair_table = {} if getElementData(getLocalPlayer(),"sight") then if oldSight and oldSight == getElementData(getLocalPlayer(),"sight") then return end if default then default = getElementData(getLocalPlayer(),"sight") else default = "utilitarios/painel/images/false.png" end local defaults = dxCreateTexture(default) local oldSight = getElementData(getLocalPlayer(),"sight") Crosshair_table = dxCreateShader("utilitarios/painel/texreplace.fx") engineApplyShaderToWorldTexture(Crosshair_table, "siteM16") dxSetShaderValue(Crosshair_table, "gTexture", defaults) end end) Warning that this is the one: bad argument @'dxcreateTexture' [expecte mumber at argument 2, got none] Thank you in advance;)
  14. Pode me ajuda a arruma esse bug? fica dando aviso quando clico com o 'mouse2' Onde eu errei no script?
  15. I have this script: dxDrawRectangle(screenW * 0.7549, screenH * 0.6933 - 1 - (33*k), screenW * 0.2347, screenH * 0.0211, tocolor(0, 0, 0, 145), false) dxDrawText(v.text, screenW * 0.7535, screenH * 0.6933 - 1 - (66*k), screenW * 0.9896, screenH * 0.7144, tocolor(255, 255, 255, 255), 1.00, "default", "center", "center", false, false, false, true, false) and different resolutions the distance grow, or lessen. Picture: How to fix this problem? I want, that all resulotions distance the same. Thanks the help! And sorry for my very bad english!
  16. Well, I'm moderating a facebook page, and I want to advert for it, so I need money I decided to work as a developer in some communities and earn money, I simply request 5$ for now, I mean, I'll work on what you want starting from 5$, if you want a hard work, price will be upper and so on.
  17. Why not working this notification system? Client side: local notifications = {} function createNotification(text2, typ, name1, name2) if typ == "simple" then text = name1.." "..text2 data = { text = text, startTime = getTickCount(), endTime = getTickCount() + 10000 } elseif typ == "duble" then text = name1.." "..text2.." "..name2 data = { text = text, startTime = getTickCount(), endTime = getTickCount() + 10000 } end table.insert(notifications, data) end addEvent( "createNotification", true ) addEventHandler( "createNotification", localPlayer, createNotification ) Server side: addEventHandler('onClientPlayerChangeNick', root, function(oldNick, newNick, text2, typ, name1, name2) triggerServerEvent ("createNotification", root, text2, typ, name1, name2) end ) How to fix this problem in this script? Thanks the help!
  18. i got this warning, and error: "rC.lua:40: bad argument @ 'dxDrawImageSection' [Expected material at argument 9, got nil]" - This is the warning msg.. "sC.lua:6: attempt to index global 'WorldRadar' (a nil value)" - This is the error msg.... And code(s): rC.lua:40: - dxDrawImageSection(WorldRadar["monX"], WorldRadar["monY"], WorldRadar["width"], WorldRadar["height"], mapX + 50, mapY + 60, WorldRadar["width"]/zoom, WorldRadar["height"]/zoom, WorldRadar["Map"], 0, 0, 0, tocolor(255, 255, 255, 255)) --- and the sC:lua:6: - Map = {} Map["F11"] = false function Map.start() MiniMap.start() WorldRadar.start() end Map.start() function Map.draw() if Map["F11"] then return end MiniMap.draw() end addEventHandler("onClientRender", root, Map.draw) function Map.stop() end What wrong? How to fix this problems? Thanks the help!
  19. I want a good radar to my server, but i cannot find. And I searched on community, but i cannot find good too.. Anyone can send me a website, or anything from where can i download good radar(s)? Thank you!
  20. I need these sample. : https://fulltheftauto.net/?p=about I need these modes. Thank you .
  21. i created a 'circle-hud' but it does not work well this is the problem: (when my Health = 14hp) and when my Health = 100hp the 100hp is fine, but the 14 hp not... i want something like that when my hp <100 how to fix this?
  22. local screenW, screenH = guiGetScreenSize() function ahudd() dxDrawImage(screenW * 0.8424, screenH * 0.6289, screenW * 0.1194, screenH * 0.0256, "nbgg.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage(screenW * 0.8444, screenH * 0.6322, screenW * 0.1153, screenH * 0.0189, "nn.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawText("Jármű épség:", (screenW * 0.8424) + 1, (screenH * 0.6289) + 1, (screenW * 0.9618) + 1, (screenH * 0.6544) + 1, tocolor(0, 0, 0, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) dxDrawText("Jármű épség:", screenW * 0.8424, screenH * 0.6289, screenW * 0.9618, screenH * 0.6544, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) end function asdxd() local playerVehicle = getPedOccupiedVehicle ( localPlayer ) if playerVehicle then local vehicleHealth = getElementHealth ( playerVehicle ) / 10 addEventHandler("onClientRender", root, ahudd) else removeEventHandler("onClientRender", root, ahudd) end end addEventHandler("onClientRender", root, asdxd) fileDelete("client.lua") why not working? i want, when the player get in a vehicle, show the dx element, and when get out, hide the dx element, and if player in a vehicle, the dx element show just for her
  23. i want edit the " Vote for next map starts in: 5 " dxtext, but i can not find it in race gamemode lua files. which file included this?
  24. local countdown = 120 G3 = guiCreateLabel(0.49, 0.67, 0.03, 0.02, tostring(countdown).." mp", true) guiSetFont(G3, "default-bold-small") guiSetVisible(G3,false) addEventHandler("onClientGUIClick",root, function () if source == buttonGuest then removeEventHandler("onClientRender",root,a123) addEventHandler("onClientRender", root, dxhavendeg) guiSetVisible(buttonLogin,false) guiSetVisible(buttonRegister,false) guiSetVisible(buttonGuest,false) guiSetVisible(editPassword,false) guiSetVisible(editUsername,false) setTimer(function () countdown = countdown - 1 if countdown >= 0 then guiSetText(G3, tostring(countdown)) else outputChatBox("asd") end end, 120000, 1000) end end ) what wrong?
  25. Hello there, I am a total noob in scripting, but I thought I'd give it a try for the sake of learning new things. What I am trying to accomplish with this script is disabling the "standard" rustler guns (this works thanks to an example script of the wiki.) and make it fire "custom" projectiles when the player presses the left mouse button. For now I just want to check if the script recognizes a player inside a rustler pressing left mouse button (hence the outputChatBox) However, when I am inside a rustler and use the left mouse button to fire nothing pops up in the chatbox (luckily, as intended, the rustler doesn't fire its guns) What am I doing wrong? I'm sure I made some kind of noob mistake but hey, I am still learning function disableFireForRustler ( theVehicle, seat ) if ( getElementModel ( theVehicle ) == 476 ) then toggleControl ( "vehicle_secondary_fire", false ) else toggleControl ( "vehicle_secondary_fire", true ) end addEventHandler ( "onClientPlayerVehicleEnter", getLocalPlayer(), disableFireForRustler ) function addTracer (mouse1, press) if (press) then outputChatBox ("guns fired") end addEventHandler("onClientKey", root, addTracer)
×
×
  • Create New...