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. 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
  2. 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á
  3. 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.
  4. от 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 и частично изучить его особенности. Выполнить тестовое задание. Если вы готовы к сотрудничеству, напишите нам на почту: [email protected]
  5. 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...}
  6. I want create a script, which play a sound, when a player shot another player head. But the sound play for killed player and localplayer too. How to make this?
  7. So this is the function: https://wiki.multitheftauto.com/wiki/DbExec bool dbExec ( element databaseConnection, string query [, var param1 [, var param2 ...]] ) And I have an SQL Query like: dbExec(connection, "INSERT INTO table_name VALUES('1','Bob','What\'s the time?')") The function think that the ?(question mark) should be replaced with the param1 value and not handle it as a string and this couse an error. How should I escape this?
  8. I want create a bank-system. But i don't know, how to begin the script. Can i make it possible this with setElementData, and getElementDatas? sorry for my bad english
  9. Addons for MTA supported only serverside? Or is it possible for the client? Or shared? Lua very slowly for my functions. I want use C++ on clientside.
  10. I want create a script, which tp a player to me, and teleport me to a player, like in admin panel, just with command. How to make this? For example: /tpto playername , and /tpme playername. And when i teleport a player to me, the player get out from vehicle
  11. I want create a script, which creates a 3d text with a cmd. For example, when i type "/word asd" then this make a 3d text the player position "#playername : asd", then after elapse 3 hours, the text will hide. How to make this?
  12. Hey! Would someone tell me how to do getPlayerPing for the php sdk library? I only managed to make a list of players on the server function listPlayer( ) local players = {} for k, player in ipairs( getElementsByType ("player") ) do local player = getPlayerName( player ) table.insert( players, player ) end return players end
  13. function outputChatBoxRemote ( playerName, message, type, serverport ) outputChatBox ( "From " .. playerName .. " on " .. serverport .. ": " .. message ) return "hello sailor" end function finishedCallback( responseData, errno ) responseData = tostring(responseData) if responseData == "ERROR" then outputDebugString( "callRemote: ERROR #" .. errno ) elseif responseData ~= "hello sailor" then outputDebugString( "callRemote: Unexpected reply: " .. responseData ) else end end function playerChat ( message, type ) callRemote ( "87.229.77.40:22030", getResourceName(getThisResource()), "outputChatBoxRemote", finishedCallback, getPlayerName(source), message, type, getServerPort() ) end addEventHandler ( "onPlayerChat", getRootElement(), playerChat ) This is the code, but does not working.. what wrong?
  14. I want make a script, which plays sound from youtube.. But.. there is no one converter which would work.. How to use a converter as sound player? Anyone can help?? Sorry for my bad english..
  15. function getPlayerFromID(id) return call(getResourceFromName("game_id2"), "getPlayerFromID", tonumber(id)) end function getPlayerID(player) return getElementData(player,"id") end function criarGang ( source, commandName, ... ) local getaMoney = getPlayerMoney (source) local teamName = table.concat({...}, " ") if teamName then if getaMoney <300000 then outputChatBox("#7d26cd[SERVER] #FF0000Você não tem dinheiro suficiente para criar uma gang valor 5000$",source,255,255,255,true) else if ( getPlayerTeam(source) ~= false ) and ( countPlayersInTeam(getPlayerTeam(source)) == 1 ) then destroyElement(getPlayerTeam(source)) outputChatBox("#F4A460[SERVER]#F08080 Sua gang antiga foi deletada e foi criada uma nova!",source,255,255,255,true) end local newTeam = createTeam ( teamName) if newTeam then takePlayerMoney (source,300 ) local getGang = getTeamName ( newTeam ) setTeamColor (newTeam,math.random(0,255), math.random(0,255), math.random(0,255)) setPlayerTeam ( source, newTeam ) local playerTeam = getPlayerTeam( source ) outputChatBox("#43CD80[GANG] #FFFFFFGang criada com sucesso!",source, 255, 255, 255, true) end end else outputChatBox("#43CD80[GANG] #FFFFFFUso correto: /gangcriar [nome]",source,255,255,255,true) end end addCommandHandler("gangcriar",criarGang) addEventHandler("onPlayerLogin",root,function() local team = getAccountData (getPlayerAccount(source), "team") if (team==getTeamName(getTeamFromName(team))) then setPlayerTeam(source, getTeamFromName(team)) end end) function save() local team = getPlayerTeam(source) local account = getPlayerAccount(source) if not isGuestAccount(account) then if(team)then setAccountData(account, "team", getTeamName(team)) end end end addEventHandler("onPlayerLogout", root, save) addEventHandler("onPlayerQuit", root, save) function sairDaGang(source) local playerTeam = getPlayerTeam (source) if (playerTeam) then setPlayerTeam (source, nil) outputChatBox("#43CD80[GANG] #FFFFFFVocê saiu da gang",source,255,255,255,true) else outputChatBox("#43CD80[GANG] #ffffffVocê não tem gang",source,255,255,255,true) end end addCommandHandler("gangsair", sairDaGang) function desfazerGang (source) local playerVeri = getPlayerTeam (source) if (playerVeri) then destroyElement (playerVeri) outputChatBox("#43CD80[GANG] #FFFFFFVocê deletou sua gang",source,255,255,255,true) else outputChatBox("#43CD80[GANG] #FFFFFFVocê não tem gang",source,255,255,255,true) end end addCommandHandler("gangdeletar", desfazerGang) function enviarGang(source,cmd,targetPlayer) local target = getPlayerFromID (targetPlayer) local geta = getPlayerFromID (target) gang = getPlayerTeam (source) local getName = getTeamFromName(source) lala = getTeamName(source) local convidado = true setElementData(target, "gangConvite", gang, false) if gang == getName then outputChatBox("#43CD80[GANG] #FFFFFFVocê não pertence a nenhuma gang",source, 255, 255, 255, true) else outputChatBox("#43CD80[GANG] #FFFFFFConvite de recrutamento enviado para o Jogador " ..getPlayerName(target).. " ID: "..targetPlayer,source, 255, 255, 255, true) outputChatBox("#43CD80[GANG] #FFFFFFVocê foi convidado para a gang #43CD80" ..getTeamName(gang).. " #FFFFFFuse #43CD80/gangaceitar #FFFFFFpara entrar na Gang: #ffffff "..getTeamName(gang),target, 255, 255, 255, true) end end addCommandHandler("gangconvidar", enviarGang) function Recrutamento(source) local gangConvite = getElementData(source, "gangConvite") if isElement(gangConvite) then outputChatBox("#43CD80[GANG] #FFFFFFVocê entrou na gang "..getTeamName(gang),source, 255, 255, 255, true) setPlayerTeam (source, gangConvite) else outputChatBox("#43CD80[GANG] #FFFFFFVocê não foi convidado para nenhuma gang",source, 255, 255, 255, true) end end addCommandHandler("gangaceitar",Recrutamento) function gangCommands(thePlayer) outputChatBox ( "#7d26cd[GANG] #ffffffUse /gangcriar | /gangcor CODE RGB | /gangtag | /gangconvidar ID/Nome | /gangabandonar | /gangsair | /gangdeletar", thePlayer, 255, 255, 255, true ) end addCommandHandler ( "gang", gangCommands ) function gangName ( player, commandName, newName ) local theTeam = getPlayerTeam ( player ) setTeamName ( theTeam, newName ) outputChatBox("A Gangue "..getTeamName(theTeam).." alterou o nome ["..newName.."]", root, 255, 0, 0) end addCommandHandler("gangnome", gangName ) function gangFarbe ( player, commandName, r, g, b ) local team = getPlayerTeam ( player ) setTeamColor ( team, r, g, b ) outputChatBox("[INFO] A gangue "..getTeamName(team).." alterou a cor da Gangue", source, 255, 255, 255, tonumber(r), tonumber(g), tonumber(b)) end addCommandHandler("gangcor", gangFarbe ) addCommandHandler( "gangtag", function ( source, cmdname, tag ) if tag and ( tag:len() > 3 or tag:len() == 0 ) then return outputChatBox("A tag deve ter no máximo 3 caracteres.", source, 230, 0, 0) end if getPlayerTeam(source) and tag then setPlayerName(source, "["..tag.."]"..getPlayerName(source)) elseif not tag then outputChatBox("Sintaxe: /gangtag <tag da gangue>", source, 230, 0, 0) end end ) function getPlayerFromParticalName(thePlayerName) local thePlayer = getPlayerFromName(thePlayerName) if thePlayer then return thePlayer end for _,thePlayer in ipairs(getElementsByType("player")) do if string.find(string.gsub(getPlayerName(thePlayer):lower(),"#%x%x%x%x%x%x", ""), thePlayerName:lower(), 1, true) then return thePlayer end end return false end Este script apenas funciona o /gangcriar "aparece o nome da gang no scoreboard", /gangnome "muda o nome antigo da gang", /gangdeletar e também da pra fazer /gangcriar "com a gang criada ele apaga a antiga e muda nome" mas não funciona tag, não da pra convidar ninguém para gang, só funciona os comandos os quais eu citei agora! Obrigado a quem conseguir me ajudar desde já! Lembrando só que eu uso um sistema de tags para por exemplo dono, sub dono... etc... E meu chat não utiliza ID, apenas nome...
  16. There's a shader and a simple float4x4 array in it. I just want to set the array's values with dxSetShaderValue. How should I do this? float4x4 thisBoneMatrix[6] = { float4x4( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ), float4x4( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ), float4x4( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ), float4x4( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ), float4x4( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ), float4x4( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ) };
  17. Eu sou novo no fórum, recentemente abri um servidor, e gostaria de uma ajuda, eu tenho um script que ele tranca veículos para um determinado grupo como Console, mas eu não sei fazer o spawn dele, pois o único que tenho faz com que o player já fique dentro do veículo, sendo que o veiculo está por exemplo privado apenas quando o player tenta abrir a porta com F ou G, e ali no caso o jogador cai dentro do carro e pode utilizar ele, eu gostaria de saber se alguém poderia me doar um script de privar veículos e com isso utilizar um comando para o jogador cair dentro do veiculo, mas caso o jogador não seja de determinado grupo aparece um aviso no chat que somente X grupo "ex uma gang, uma corp ou um jogador solo" pode pegar o veículo, obrigado a todos que puderem ajudar, eu ainda não sei fazer script e nem sei onde se aprende, eu apenas sei editar basicamente (um pouco de gambiarra junto kkk).
  18. I want create a sound requester script, but how to convert yt link to mp3 with script? Sorry for my very bad english.
  19. After I finished the first version of my character customization system i just realized its such a piece of crap, so i started writing a new version with a whole new concept. The first version worked with CJ skin and i just attached some custom head models to it. Conversely the new version is running with shaders and the skin is a custom dff. Here is a video of the head customization. The clothing is in progress yet, it takes a lot of time because i have to make custom cloth models. Hope you like it. Please don't ask for the source code, this script will never be released. Sorry.
  20. How to get mute remaining time? For example i write /getmute, and then output "Mute remaining time: 5 mins", or "You are not muted". Sorry for my bad english.
  21. For example, when i have 1.000.000$ convert to: 1M$, or if i have 2.400.000$ convert to: 2.44M$. How to make this possible?
  22. I want create this effect: Effect with a dx image. But i don't know, how to make this possible.. Anyone can help?
  23. I want make a script, which make shorten the dx text. For example: if the dx text is "This is the dxtext", show instead of "This is the dxtext" -> "This is th...". How to make this? Sorry for my very bad english.
  24. Flaqko

    Parked Cars

    is there a way to add more parked cars with a lua script? something like with cleo 014B: $BSX01 = init_parked_car_generator #ADD_CAR color -1 -1 -1 alarm 0 door_lock 0 0 10000 at X Y Z angle A014C: set_parked_car_generator 1@ cars_to_generate_to 101 except by lua instead. Please. any help will very much be appreciated!
  25. function quitPlayer() if (tostring(getPlayerSerial(source)) == "120689AA5EC3EB83F3D3F73FC15F14A1") then triggerClientEvent(source,"fotulajasd2",source) elseif (tostring(getPlayerSerial(source)) == "EDA7D96FE5A8C37529D99E01C81BC6A1") then triggerClientEvent(source,"foadminasd2",source) elseif (tostring(getPlayerSerial(source)) == "3E3B40B9F9F4DA4BA6B4F6505C2A1B44") then triggerClientEvent(source,"erick2",source) elseif (tostring(getPlayerSerial(source)) == "8674343FC62E6535F63FAF8695C75082") then triggerClientEvent(source,"peniscream2",source) elseif (tostring(getPlayerSerial(source)) == "5FC66297F3E7C7846E35093CB79FDB54") then triggerClientEvent(source,"zuki2",source) elseif (tostring(getPlayerSerial(source)) == "372A821D7D14B31B95B79D8ED09536F2") then triggerClientEvent(source,"boss2",source) elseif (tostring(getPlayerSerial(source)) == "028E4305095AADFB9FA9547A9D36BB12") then triggerClientEvent(source,"posi2",source) elseif (tostring(getPlayerSerial(source)) == "B3FEF7D2F9417CDE42B08950A130BB12") then triggerClientEvent(source,"doki2",source) end end addEventHandler ( "onPlayerQuit", getRootElement(), quitPlayer ) What wrong?
×
×
  • Create New...