Search the Community

Showing results for tags 'lua'.



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
    • Open Source Contributors
    • Suggestions
  • General MTA
    • News
    • Media
    • Site/Forum/IRC/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • community.mtasa.com
    • 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
  • Private Bugtracker

Found 242 results

  1. Pessoal a Pouco Tempo Comecei a Trabalhar Com Linguagem. Lua e Para Conseguir Cria Meu Servidor e Ser Independente De Precisar Pegar Um Painel Entrar Ou Um Script Em SItes Apr Aprendi Bastante Coisa Mais Pulei a Peça Do Painel Login e Queria Saber Se Voces Pode Explicar Como Consigo Criar Short Time Staff I Started Working With Language. Moon and To Be able to Create My Server And Be Independent Of Need To Pick A Login Panel Or A Script In SItes I Learned A Lot More Thing I Have Skipped The Part Of The Login Panel And I Wanted To Know If You Can Explain How I Can Create Краткосрочный персонал Я начал работать с языком. Луна и иметь возможность создавать свой сервер и быть независимыми от необходимости выбирать панель входа или сценарий В SItes я узнал, что многое другое, что я пропустил часть панели входа в систему, и я хотел узнать, можете ли вы объяснить, как я могу создать
  2. Lua f*k sh*t

    I MAKE SO setElementData(source, "countCheckpoitBusRoad", 0) -- somewhere in the code local countCheckpoint = getElementData(player, "countCheckpoitBusRoad") + 1 -- callback hit marker -- AND HERE ERROR setElementData(player, "countCheckpoitBusRoad", countCheckpoint) AND HAVE "ERROR: attempt to perform arithmetic on a boolean value 'countCheckpoint '" WHY??? MY SYSTEM-BUS WORK, BUT IN CONSOLE MORE ERROR
  3. Hello. (sry for english and stupid question) I created window and input field on DGS win = DGS:dgsDxCreateWindow(0.18, 0.27, 0.22, 0.3," ",true,0xFF000000,25,nil,0xFFFFFFFF,nil,0xFFFFFFFF,5,true) -- window emailBoxReg = DGS:dgsCreateEdit( 0.1, 0.36, 0.8, 0.1, "INPUT FIELD", true, win, 0xFF000000, 0.5, 0.5, nil, 0xFFEBEBEB, false) -- input field DGS:dgsDxGUISetVisible( winReg, true) -- show DGS:dgsDxWindowSetMovable(winReg, false) DGS:dgsDxWindowSetSizable(winReg, false) guiSetInputEnabled(true) -- input showCursor(true) -- cursor why if i click on input field, later click on window - next clicks everywhere not work?
  4. Question from Pawn scripter

    Hi. I have 2 problem. In Pawn (sa-mp hello) i can write stock Function(value1, value2 = 5, value3 = 10) // value2 and value3 optional parameters { return 1; } how make it in Lua (i talking about optional parameters)? if make so function Function(value1, value2 = 5, value3 = 10) { } i have error from interpreter and more question... how skip argument? again in Pawn i can write stock Function(value1, value2 = 5, value = 10) { return 1; } public OnPlayerConnect(playerid) { Function(value1, .value3 = 20); // <<<----------- skip value2 } how make it on Lua? thx.
  5. How to start learning?

    Hello dear users of this forum! I'm a beginner in Lua and I don't how to start learning. I know some other languages. As JavaScript, Python, Pawno and etc. Can you help me with it? Which plugin create me for start? Thank you in advance and sorry for my English.
  6. Hello dear users of this forum! The project "American History" need the lua programmers. The form of wage: We will pay from donations. And somtimes will give bonuses. Information about the project: The project will be multi-language. English, Russian and Azerbaijani. It will help for our profit. We make a map of America. On the project will be history of player. It will add atmosphere to the server. All actions on the server will unfold in the 90s. As in the original GTA San Andreas. You can get broad information in: vk.com/cosmolyon & in the messenger of this site. Good bye!
  7. Lua Programmer

    Hello dear users of this forum! The project "American History" need the lua programmers. The form of wage: We will pay from donations. And somtimes will give bonuses. Information about the project: The project will be multi-language. English, Russian and Azerbaijani. It will help for our profit. We make a map of America. On the project will be history of player. It will add atmosphere to the server. All actions on the server will unfold in the 90s. As in the original GTA San Andreas. You can get broad information in: vk.com/cosmolyon & in the messenger of this site. Good bye!
  8. Somehow i can make this possible? When a player connect, then he have to wait the end of download, then he can use the fr gui. I want make fr gui usable when player download the mods. Sorry for my bad english..
  9. Hello, I want to pass the Client-player with the function triggerServerEvent (for example to trigger an event and ONLY the client triggered the event so that ONLY HE would receive a message) and this is how i would do it: triggerServerEvent("blabla", localPlayer, bla) But MTA-wiki says the following sentence: Warning: You should use the global variable client serverside instead of passing the localPlayer by parameter or source. Otherwise event faking (passing another player instead of the localPlayer) would be possible. So I assume, that I shouldn't do it the way I just posted above, but I have no clue what they mean by this sentence and how else I should do it then.. Could anyone explain this WITH an example?
  10. Opa galera! Blz? Esses dias estava com dúvidas sobre como criar algum script que fosse de taxi/uber para players. Acabou que achei um que era exatamente como eu queria. Mas esse tem algum problema que não consegui encontrar que não permite funcionar. Se alguém puder dar uma força, vai ajudar MUITO! Server.lua -- by manawydan taxi_system lado = server local PrecoTaxi = "50" local BlipsTaxi = {} addEventHandler("onResourceStart",getResourceRootElement(getThisResource()), function() if not TimeTaxi then TimeTaxi = createTeam("Taxistas",20,100,20) end end) function PedirTaxi(thePlayer) if (getElementData(thePlayer,"TaxiClient")) then return end --else if (getPlayerMoney(thePlayer) >= tonumber(PrecoTaxi)) then setElementData(thePlayer,"TaxiClient",true) BlipsTaxi[thePlayer] = createBlipAttachedTo(thePlayer,0,2,0,0,250,210) JogadoresTaxistaTabela(thePlayer) outputChatBox("[Taxi]: Taxi logo chegara, por favor aguarde",thePlayer) end end addCommandHandler("taxi",PedirTaxi) function JogadoresTaxistaTabela(Player) local Jogadores = getElementsByType("player") for _,Jogad in ipairs(Jogadores) do if (getElementData(Jogad,"Taxista")) and (getElementData(Jogad,"TaxistaStat") == vazio) and getPlayerTeam(Jogad) == getTeamFromName("Taxistas") then local NomeTaxiClient = getPlayerName(Player) outputChatBox("Taxi solicitado por: "..NomeTaxiClient,Jogad) end end end function TaxiSystemEntrarNoTaxi(Carro,assento,jacked) if not (getElementModel(Carro) == 420) then return end if not (getElementData(source,"TaxiClient")) then return end if not (assento == 0) then local Taxista = getVehicleController(Carro) if Taxista and getElementData(Taxista,"Taxista") and (getPlayerTeam(Taxista) == getTeamFromName("Taxistas")) then destroyElement(BlipsTaxi[source]) setElementData(Taxista,"TaxistaStat",ocupado) end end end addEventHandler ("onPlayerVehicleEnter",getRootElement(),TaxiSystemEntrarNoTaxi) -- function TaxiSystemSairTaxi(Carro,assento,jacked) if not (getElementModel(Carro) == 420) then return end if not (getElementData(source,"TaxiClient")) then return end if not (assento == 0) then local Taxista = getVehicleController(Carro) if Taxista and getElementData(Taxista,"Taxista") and (getPlayerTeam(Taxista) == getTeamFromName("Taxistas")) then removeElementData(source,"TaxiClient") setElementData(Taxista,"TaxistaStat",vazio) takePlayerMoney(source,tonumber(PrecoTaxi)) givePlayerMoney(Taxista,tonumber(PrecoTaxi)) end end end addEventHandler ("onPlayerVehicleExit",getRootElement(),TaxiSystemSairTaxi) function TaxistaSer(Carro,assento,jacked) if not (getElementModel(Carro) == 420) then return end if (getElementData(source,"Taxista")) then return end --not if (getPlayerTeam(source) == getTeamFromName("Taxistas")) then if (assento == 0) then setElementData(source,"Taxista",true) setElementData(source,"TaxistaStat",vazio) outputChatBox("[Taxi]: Você agora é um taxista, fique atento para não perder cliente",source) end end end addEventHandler ("onPlayerVehicleEnter",getRootElement(),TaxistaSer)
  11. I attached a song to my car, but when i'll go far away from car, the music starts from the beginning... s: how to fix this?
  12. client: function rtwjhrt() if isElement(ss) then stopSound(ss) return end local car = getPedOccupiedVehicle ( localPlayer ) local gettext = guiGetText ( GUIEditor.edit[1] ) local x, y, z = getElementPosition( car ) local ss = playSound3D( 'asd.mp3', x, y, z ) setSoundMaxDistance( ss, 85 ) attachElements(ss,car) end addEvent("asd123asd456",true) addEventHandler("asd123asd456",root,rtwjhrt) server: function trig() triggerClientEvent(root,"asd123asd456",root) end addEvent( "asjdlaj", true ) addEventHandler( "asjdlaj", root, trig ) Why not hear the sound another players?
  13. offedit break command

    Heya all, On our server we have this ingame map editor called offedit, which has quite some options to manipulate objects and stuff. For example "mcol", which toggles objects (only colled objects by default) to remove their collision. So lately i was wondering, is it possible to make a similar script for objects that break by default? So with that, you can remove/suppress the break animation. Would the game engine allow us to do that? I know that the default map editor has such an option, but i don't know if it would work in a scripted form. And nope, i don't have LUA knowledge, but i do like to think about possibilities.. Regards, n0rt0x
  14. GUI Over DX Image

    Hellow..!! After creating a DX image [ image created using "dxDrawImage" function ], can a GUI Window set font of that DX image ?? And how ?? [ i think "guiSetFont" function is not useful in this occasion. Because I tested it :3 ]
  15. Hi guys..!! Now I am finding a way, how to create an arrow [ "Down arrow" pickup :- 1318 ] that every-time targeting one position. Like... there is an arrow on player's head and it leads the player to reach a position. So that arrow always target one position. What should i do to set the arrow's target to one position ?? Can you help me ??
  16. I want create a dxdraw rectangle and text on the map. But how to make this possible?
  17. i added this line to my script: takeWeapon( source, 38, 99999 ) buuut, does not working.. how to fix this?
  18. this is my code: function onQuit(thePlayer) for i,v in pairs(getElementsByType("vehicle",resourceRoot)) do if getElementData(v,"oveie") == getPlayerName(thePlayer) then destroyElement(v) end end end addEventHandler ( "onPlayerQuit", root, onQuit ) but this does not working.. why? how to fix it?
  19. local Z1 = createColRectangle(1577, 1723, 60, 140 ) -- LV hospital function spawnRoadblock(id, x, y, z, rx, ry, rz, dim, int) if (not id) then return end if (id == 1225 and dim == 0) then outputChatBox("Explosive barrels can not be placed in main dimension", client, 255, 0, 0) return end if (id == 978) then z = z-1 end local accName = getAccountName(getPlayerAccount(client)) local object = createObject(tonumber(id), x, y, z, rx, ry, rz) setElementDoubleSided(object, true) setElementFrozen(object, true) setElementData(object, "creator", accName, false) roadblocks[object] = {object, getAccountName(getPlayerAccount(client))} if (tonumber(dim) ~= 0) then setElementDimension(object, dim) end if (tonumber(int) ~= 0) then setElementInterior(object, int) end if (id ~= 1225) then triggerClientEvent(client, "nobreak", client, object) end if not isElementWithinColShape (object, Z1) then destroyElement(object) end end addEvent("Zone.ZRB.AddRoadblock", true) addEventHandler("Zone.ZRB.AddRoadblock", root, spawnRoadblock) Hello, in this script as you see it's about adding a Road Block.. but i got one problem and it's i need to make that if the Object was outside a specific area so it will get auto removed, any help? I appreciate who fix this coding... Thanks.
  20. We Need a Scripter

    Hi guys, We working a new roleplay server project. We have some ideas for this server but we do not have a scripter. Someone who want to help us send private message. Money is not important
  21. I want create a custom scoreboard.. But, how to add players to it with rectangle, and dxdrawtext(s), and when there are xy players, how to make scrollable?? Sorry for my bad english.. :c
  22. Ajuda Script

    Olá preciso da ajuda de voces, estou comecando agora com LUA e criei um painel de CORP e tem o botao para clicar onde pega vida e colete e eu queria que quando a pessoa pegasse vida e colete ela aguardasse um tempo de segundos ou ate minutos para poder pegar de novo. Agradeço a todos desde já
  23. local Z1 = createColRectangle(1577, 1723, 60, 140 ) function spawnRoadblock(id, x, y, z, rx, ry, rz, dim, int) if (not id) then return end if ( id =="" and dim == 0) then return true end if (id == 978) then z = z-1 end local accName = getAccountName(getPlayerAccount(client)) local object = createObject(tonumber(id), x, y, z, rx, ry, rz) setElementDoubleSided(object, true) setElementFrozen(object, true) setElementData(object, "creator", accName, false) roadblocks[object] = {object, getAccountName(getPlayerAccount(client))} if (tonumber(dim) ~= 0) then setElementDimension(object, dim) end if (tonumber(int) ~= 0) then setElementInterior(object, int) end if (id ~= 1225) then triggerClientEvent(client, "nobreak", client, object) end end addEvent("events.RB.AddRoadblock", true) addEventHandler("events.RB.AddRoadblock", root, spawnRoadblock) ____________________________________________________________________________________________________________________________ i want to add on it, if Client placed a Object outside Z1 it will not get placed, and if it placed inside the Z1 it will be placed, Please can someone help, and i appreciate that! thank you.
  24. от 70 000 до 120 000 руб. на руки Требуемый опыт работы: 3–6 лет Полная занятость, удаленная работа Мы предлагаем удаленную работу в отделе разработчиков игры компании RP BOX. RP BOX Online(онлайн игра жанра MMORPG) - симулятор ролевого режима игры по сети, где события разворачиваются в одном из южных городов России(Новоросийск, Сочи, Горки-город) в наше время. Игра находит отклики в сердцах игроков и собирает вокруг себя фанатов симуляторных игр. Игровая механика позволяет развиваться в городе, зарабатывать деньги, тратить их на имущество и общаться с остальными игроками по голосовому чату. Видео по нашей игре, вы сможете найти на YouTube и на сайте rpbox. Обязанности: Выполнять поставленный задачи в срок и работать с Jira(научим). Заниматься написанием, оптимизацией и тестированием скриптов. Требования: Опыт программирования на Lua от 3-ех лет, знание ООП, MySQL, XML. Умение разбираться в чужом коде. Владение английским языком на уровне чтения технической документации. Коммуникабельность, открытость и умение работать в команде. Условия: Изучить мультиплеерную платформу MTA(Multi Theft Auto,https://wiki.multitheftauto.com/wiki/Scripting_Introduction). Пройти недельный срок обучения написания скриптов под MTA и частично изучить его особенности. Выполнить тестовое задание. Если вы готовы к сотрудничеству, напишите нам на почту: hr@rpbox.ru
  25. Advice with tables in lua

    Hi everyone, I am facing a small problem with tables, well I am not sure how to add something to a table by using addCommandHandler. Like, if this is my table local random = { -- x = y ['a'] = 'Two', ['b'] = 'One', ['c'] = 'Ten', } Then how can I add another line to this table by a command (addCommandHandler) For example If the command is "/add Q A" ~~~ ("/add d six") then it should add a new line to the table like -> local random = { ['a'] = 'Two', ['b'] = 'One', ['c'] = 'Ten', ['d'] = 'Six', } On the other hand, I have something like this in my mind for the command: local random = { -- x = y ['a'] = 'Two', ['b'] = 'One', ['c'] = 'Ten', ['d'] = 'Six', } function addabcdtotable(client, commandName, x, y) if (blabla ~= "18") then return false end if (x) then return false end --(Checks if (['d'] = 'Six',) already exists, if yes then it will simply return {where x = column and y = column-2}) Add-> (x,y) --(This will add {['d'] = 'Six',} to the table) end addCommandHandler("add", addabcdtotable) --For removing a line from table -> function removeabcdfromtable(client, commandName, x, y) if (blabla ~= "18") then return false end if (x) then --(Checks if (['d'] = 'Six',) already exists, if yes then it will be removed from the table {where x = column-1 and y = column-2) Remove-> (x, y) --(This will remove the whole line and fix the gap ['d'] = 'Six',) else return false end end end addCommandHandler("rem", removeabcdfromtable) -- NOW VERY IMPORTANT THE D IS ONLY THE EXAMPLE IT CAN BE ANYTHING LIKE (['ab'] = 'CD',) etc.. {X and Y is not the position please...}