Jump to content

Mature

Members
  • Posts

    52
  • Joined

  • Last visited

Everything posted by Mature

  1. Hello, I want to know how I can send my file to compile with the MTA API, but not in .LUA but in JS through fetch.
  2. Hello guys, well I'm looking for how to send a file to be encrypted by the MTA api, but I didn't have any results, could someone help me? I'm using the Node JS language, but a good explanation would help.
  3. Hello, I'm trying to work with the MTA SDK in Node js as I saw in this topic https://forum.multitheftauto.com/topic/79810-nodejs-sdk-v100/; I happen to be able to make the connection only on a local server, if I try to connect to any server it gives the TCP PORT error, I've tried to put it as 22005 but it didn't work, can someone help me?
  4. Pode enviar seu código por favor para te ajudar?
  5. Só altere a ACL, coloquei como admin, mas deve funcionar function abrir1 (thePlayer) if (thePlayer) and (getElementType (thePlayer) == "player") then if (isGuestAccount(getPlayerAccount(thePlayer)) == false) and isObjectInACLGroup ("user."..getAccountName ( getPlayerAccount ( thePlayer ) ), aclGetGroup ( "Admin" ) ) then triggerClientEvent (thePlayer, "tec9gui", thePlayer) end end end addEventHandler ("onMarkerHit", tec9, abrir1)
  6. utilize resourceRoot em ambos scripts no lugar do root
  7. https://www.mtabrasil.com.br/2012/09/veiculo-radio.html
  8. Envia o código de quando abre ele por favor, ou você pode adicionar: --#Adicione isso quando o painel abrir local timerDelay function openPanel () if not isTimer(timerDelay) then --#Painel abriu timerDelay = setTimer(function() end, 3000, 1) else --#Informa que o painel não pode ser acionado no momento end end
  9. Não testei, mas pode funcionar local blip = {} addEventHandler('onResourceStart', resourceRoot, function () local player = nil for i=1, #getElementsByType("player") do player = getElementsByType("player")[i] local x,y,z = getElementPosition(player) blip[player] = createBlipAttachedTo ( player, 0) if isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(player)), aclGetGroup ("Moderator")) or isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(player)), aclGetGroup ("SuperModerator")) or isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(player)), aclGetGroup ("Admin")) or isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(player)), aclGetGroup ("Console")) then setElementVisibleTo (blip[player], player, true ) else setElementVisibleTo (blip[player], player, false ) end end end) addEventHandler('onPlayerQuit', root, function () if blip[source] then destroyElement(blip[source]) end end) addEventHandler('onPlayerLogin', root, function () local x,y,z = getElementPosition(source) blip[source] = createBlipAttachedTo (source, 0) setElementVisibleTo (blip[source], root, false ) if isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(source)), aclGetGroup ("Moderator")) or isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(source)), aclGetGroup ("SuperModerator")) or isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(source)), aclGetGroup ("Admin")) or isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(source)), aclGetGroup ("Console")) then local blips = nil for i=1, #getElementsByType("blip", resourceRoot) do blips = getElementsByType("blip", resourceRoot)[i] setElementVisibleTo (blips, source, true ) end end end)
  10. para não ter risco dele pressionar algo que tenha uma função de unfreeze, da para cancelar as teclas do teclado, pode funcionar addEventHandler("onClientKey", root, function (button, press) if (press) then cancelEvent() end end) Ou utilizando um setTimer com um isElementFrozen e se o frozen ser falso ativa ele novamente https://wiki.multitheftauto.com/wiki/IsElementFrozen
  11. Hello, I have a doubt that I have no idea to execute, I would like to create a radio frequency system, along with the voice, after the player pressing 'Z', he will speak normally in the voice and when pressing, for example, ' X 'he will speak in the voice of the radio or in the key configured as Tokovoip, is it possible? How can I do? you don't need to give me the script by hand, just tell me what to use. Thank you in advance
  12. Hello, I have a problem that I don't understand, the inventory loads normally, but it is loading only slots 1 and 2, it is not loading slot 8, but if the slots are in sequence, it loads normally, can someone help me? On the server when I finish loading I pull the value that the table is on and it always returns me as 2, instead of 3 As it is in the database: https://imgur.com/LEXgGQf As it is in the inventory: https://imgur.com/undefined (The black slots are basically occupied by an item) The Event ("rzk: load: items") is done when you open the inventory Server: addEvent('rzk:load:all:items', true) addEventHandler('rzk:load:all:items', resourceRoot, function (thePlayer) local idPlayer = tonumber(getElementData(thePlayer, 'char:id')) if idPlayer then local hq = dbQuery(sql, "SELECT * FROM Items WHERE owner=?", idPlayer) local loaderQuery = dbPoll(hq, -1) if #loaderQuery ~= 0 then local loadQ = nil for i = 1, #loaderQuery do loadQ = loaderQuery[i] if not items[thePlayer] then items[thePlayer] = {} end if not items[thePlayer][tonumber(loadQ["slot"])] then items[thePlayer][tonumber(loadQ["slot"])] = {} end items[thePlayer][tonumber(loadQ["slot"])] = { ["itemid"] = tonumber(loadQ["itemid"]), ["value"] = tonumber(loadQ["value"]), ["type"] = tonumber(loadQ["type"]), ["slot"] = tonumber(loadQ["slot"]), ["actionslot"] = tonumber(loadQ["actionslot"]), ["dutyitem"] = tonumber(loadQ["dutyitem"]), } print('Carregada') end end end end) addEvent('rzk:load:items', true) addEventHandler('rzk:load:items', resourceRoot, function (thePlayer) if items[thePlayer] then print(#items[thePlayer]) triggerClientEvent(thePlayer, 'rzk:client:load:item', resourceRoot, items[thePlayer]) end end) Client: addEventHandler('onClientResourceStart', resourceRoot, function () triggerServerEvent('rzk:load:all:items', resourceRoot, localPlayer) end) addEvent('rzk:client:load:item', true) addEventHandler('rzk:client:load:item', resourceRoot, function (tabela) if tabela then tableItems = tabela for i = 1, #tableItems do if tableItems[i] then if not items then items = {} end if not items[i] then items[i] = {} end items[i] = { ["itemid"] = tonumber(tableItems[i]["itemid"]), ["value"] = tonumber(tableItems[i]["value"]), ["type"] = tonumber(tableItems[i]["type"]), ["slot"] = tonumber(tableItems[i]["slot"]), ["actionslot"] = tonumber(tableItems[i]["actionslot"]), ["dutyitem"] = tonumber(tableItems[i]["dutyitem"]), } print(tableItems[i]["slot"]) end end loadInv = true end end)
  13. Mature

    [Doubts] IPB

    Hello, I am creating a large script and I would like to know how many percent are considered healthy for a script to reach IPB and start to be something bad for the player and the server?
  14. Basically they are login resources etc, yes it does have a resource where the SQL is located and does the saving, the way I tried to do it was to create the tables in MySql, kind of manue and after calling a for with all the data, it gave until right, but it did give some error: Method: function savedatabase () dbHandler = dbConnect("mysql","dbname=".. sqlDatas["database"] ..";host="..sqlDatas["host"], sqlDatas["user"], sqlDatas["pw"], "autoreconnect=1") if dbHandler then print('O Database foi conectado.') else error('O Database não foi conectado.') end deletTabela () end function deletTabela () dbExec ( dbHandler, "DROP TABLE `Admin`" ) dbExec ( dbHandler, "DROP TABLE `Banimentos`" ) dbExec ( dbHandler, "DROP TABLE `Caracters`" ) dbExec ( dbHandler, "DROP TABLE `Dados`" ) dbExec ( dbHandler, "DROP TABLE `Logins`" ) dbExec ( dbHandler, "DROP TABLE `Policia`" ) dbExec ( dbHandler, "DROP TABLE `items`" ) dbExec ( dbHandler, "DROP TABLE `safe`" ) print('Tabelas removidas.') _call(createTabelaSql); end function createTabelaSql () dbExec(dbHandler, "CREATE TABLE IF NOT EXISTS Dados ( ID TEXT, Nome TEXT, Data TEXT, Senha TEXT, Email TEXT, Pais TEXT, Estado TEXT, Cidade TEXT, IP TEXT, Serial TEXT)") dbExec(dbHandler, "CREATE TABLE IF NOT EXISTS Logins ( Serial TEXT, Atualiza TEXT, Online TEXT, Nome TEXT, Admin TEXT, AdminName TEXT, BP TEXT, account TEXT, password TEXT, LastLogin TEXT, Adv TEXT, IRRAccount TEXT, ReasonIRR TEXT)") dbExec(dbHandler, "CREATE TABLE IF NOT EXISTS Caracters ( Serial TEXT, ID TEXT, Pos TEXT, Money TEXT, MoneyS TEXT, RG TEXT, Sexo TEXT, Hp TEXT, Fome TEXT, Sede TEXT, Cj TEXT, Skin TEXT, Roupa TEXT, Level TEXT, Exp TEXT)") dbExec(dbHandler, "CREATE TABLE IF NOT EXISTS items ( actionslot TEXT, slot TEXT, itemid TEXT, value TEXT, count TEXT, owner TEXT, type TEXT, dutyitem TEXT)") dbExec(dbHandler, "CREATE TABLE IF NOT EXISTS safe ( Position TEXT, Interior TEXT, Dimension TEXT)") dbExec(dbHandler, "CREATE TABLE IF NOT EXISTS Policia ( RG TEXT, Nome TEXT, Passagens TEXT, Artigo TEXT)") dbExec(dbHandler, "CREATE TABLE IF NOT EXISTS Admin ( ID TEXT, ADML TEXT, STATES TEXT, LL TEXT, CH TEXT, H TEXT, M TEXT, HT TEXT, MN TEXT, RK TEXT)") dbExec(dbHandler, "CREATE TABLE IF NOT EXISTS Banimentos ( Serial TEXT, Responsavel TEXT, Dias TEXT, Data TEXT)") print('Tabelas criada.') _call(loadDataLogin); end function loadDataLogin () local loaderQuery = dbPoll(dbQuery(sql, "SELECT * FROM Logins"), -1) if loaderQuery then for i, v in ipairs(loaderQuery) do local serial = tostring(v["Serial"] or 0) local att = tonumber(v["Atualiza"] or 0) local on = tostring(v["Online"] or 0) local name = tostring(v["Nome"] or 0) local admin = tonumber(v["Admin"] or 0) local adinna = tostring(v["AdminName"] or 0) local bp = tonumber(v["BP"] or 0) local accoun = tostring(v["account"] or 0) local pass = tostring(v["password"] or 0) local lastlo = tostring(v["LastLogin"] or 0) local adv = tonumber(v["Adv"] or 0) local irrac = tonumber(v["IRRAccount"] or 0) local reason = tostring(v["ReasonIRR"] or 0) dbFree(dbQuery(dbHandler, "INSERT INTO Logins (Serial, Atualiza, Online, Nome, Admin, AdminName, BP, account, password, LastLogin, Adv, IRRAccount, ReasonIRR) VALUES ('"..serial.."', '"..att.."', '"..on.."', '"..name.."', '"..admin.."', '"..adinna.."', '"..bp.."', '"..accoun.."', '"..pass.."', '"..lastlo.."', '"..adv.."', '"..irrac.."', '"..reason.."')")) sleep(500); end end print('Tabela: Logins criada com sucesso.') _call(loadDataAdmin); end function loadDataAdmin () local loaderQuery = dbPoll(dbQuery(sql, "SELECT * FROM Admin"), -1) if loaderQuery then local values = nil for i, v in ipairs(loaderQuery) do local id = tonumber(v["ID"] or 0) local adml = tonumber(v["ADML"] or 0) local states = tostring(v["STATES"] or 0) local ll = tostring(v["LL"] or 0) local ch = tonumber(v["CH"] or 0) local h = tonumber(v["H"] or 0) local m = tonumber(v["M"] or 0) local ht = tonumber(v["HT"] or 0) local mn = tonumber(v["MN"] or 0) local rk = tonumber(v["RK"] or 0) dbFree(dbQuery(dbHandler, "INSERT INTO Admin (ID, ADML, STATES, LL, CH, H, M, HT, MN, RK) VALUES ('"..id.."', '"..adml.."', '"..states.."', '"..ll.."', '"..ch.."', '"..h.."', '"..m.."', '"..ht.."', '"..mn.."', '"..rk.."')")) sleep(500); end end print('Tabela: Admin criada com sucesso.') _call(loadDataBanimentos); end function loadDataBanimentos () local loaderQuery = dbPoll(dbQuery(sql, "SELECT * FROM Banimentos"), -1) if loaderQuery then for i, v in ipairs(loaderQuery) do local serial = tostring(v["Serial"] or 0) local respon = tostring(v["Responsavel"] or 0) local dias = tonumber(v["Dias"] or 0) local data = tonumber(v["Data"] or 0) dbFree(dbQuery(dbHandler, "INSERT INTO Banimentos (Serial, Responsavel, Dias, Data) VALUES ('"..serial.."', '"..respon.."', '"..dias.."', '"..data.."')")) sleep(500); end end print('Tabela: Banimentos criada com sucesso.') _call(loadDataCaracters); end function loadDataCaracters () local loaderQuery = dbPoll(dbQuery(sql, "SELECT * FROM Caracters"), -1) if loaderQuery then for i, v in ipairs(loaderQuery) do local serial = tostring(v["Serial"] or 0) local id = tonumber(v["ID"] or 0) local pos = tostring(v["Pos"] or 0) local money = tonumber(v["Money"] or 0) local moneys = tonumber(v["MoneyS"] or 0) local rg = tostring(v["RG"] or 0) local sexo = tonumber(v["Sexo"] or 0) local hp = tonumber(v["Hp"] or 0) local fome = tonumber(v["Fome"] or 0) local sede = tonumber(v["Sede"] or 0) local cj = tostring(v["Cj"] or 0) local skin = tonumber(v["Skin"] or 0) local roupa = tonumber(v["Roupa"] or 0) local level = tonumber(v["Level"] or 0) local exp = tonumber(v["Exp"] or 0) dbFree(dbQuery(dbHandler, "INSERT INTO Caracters (Serial, ID, Pos, Money, MoneyS, RG, Sexo, Hp, Fome, Sede, Cj, Skin, Roupa, Level, Exp) VALUES ('"..serial.."', '"..id.."', '"..pos.."', '"..money.."', '"..moneys.."', '"..rg.."', '"..sexo.."', '"..hp.."', '"..fome.."', '"..sede.."', '"..cj.."', '"..skin.."', '"..roupa.."', '"..level.."', '"..exp.."')")) sleep(500); end end print('Tabela: Caracters criada com sucesso.') _call(loadDataDados); end function loadDataDados () local loaderQuery = dbPoll(dbQuery(sql, "SELECT * FROM Dados"), -1) if loaderQuery then for i, v in ipairs(loaderQuery) do local id = tonumber(v["ID"] or 0) local nome = tostring(v["Nome"] or 0) local data = tostring(v["Data"] or 0) local senha = tostring(v["Senha"] or 0) local email = tostring(v["Email"] or 0) local ips = tostring(v["IP"] or 0) local serial = tostring(v["Serial"] or 0) dbFree(dbQuery(dbHandler, "INSERT INTO Dados (ID, Nome, Data, Senha, Email, IP, Serial) VALUES ('"..id.."', '"..nome.."', '"..data.."', '"..senha.."', '"..email.."', '"..ips.."', '"..serial.."')")) sleep(500); end end print('Tabela: Dados criada com sucesso.') _call(loadDataPolicia); end function loadDataPolicia () local loaderQuery = dbPoll(dbQuery(sql, "SELECT * FROM Policia"), -1) if loaderQuery then for i, v in ipairs(loaderQuery) do local rg = tonumber(v["RG"] or 0) local nome = tostring(v["Nome"] or 0) local passa = tonumber(v["Passagens"] or 0) local artigo = tonumber(v["Artigo"] or 0) dbFree(dbQuery(dbHandler, "INSERT INTO Policia (RG, Nome, Passagens, Artigo) VALUES ('"..rg.."', '"..nome.."', '"..passa.."', '"..artigo.."')")) sleep(500); end end print('Tabela: Policia criada com sucesso.') _call(loadDataitems); end function loadDataitems () local loaderQuery = dbPoll(dbQuery(sql, "SELECT * FROM items"), -1) if loaderQuery then for i, v in ipairs(loaderQuery) do local slot = tonumber(v["slot"] or 0) local itemid = tonumber(v["itemid"] or 0) local value = tonumber(v["value"] or 0) local count = tonumber(v["count"] or 0) local owner = tonumber(v["owner"] or 0) local type = tonumber(v["type"] or 0) local dutyit = tonumber(v["dutyitem"] or 0) dbFree(dbQuery(dbHandler, "INSERT INTO items (slot, itemid, value, count, owner, type, dutyitem) VALUES ('"..slot.."', '"..itemid.."', '"..value.."', '"..count.."', '"..owner.."', '"..type.."', '"..dutyit.."')")) sleep(500); end end print('Tabela: Items criada com sucesso.') _call(loadDataSafe); end function loadDataSafe () local loaderQuery = dbPoll(dbQuery(sql, "SELECT * FROM safe"), -1) if loaderQuery then for i, v in ipairs(loaderQuery) do local pos = tostring(v["Position"] or 0) local interi = tonumber(v["Interior"] or 0) local dimens = tonumber(v["Dimension"] or 0) dbFree(dbQuery(dbHandler, "INSERT INTO safe (Position, Interior, Dimension) VALUES ('"..pos.."', '"..interi.."', '"..dimens.."')")) sleep(500); end end print('Tabela: Safe criada com sucesso.') print('Backup realizado com sucesso.') end
  15. I can't even imagine how to start it, I don't know anything about sql ...
  16. I made a small system where every day at 4 o'clock in the morning, it disconnects all players and saves saved tables, but I find it very rustic and giving some errors, I have mastered the basics of SQL so I wanted to know a method , this method you put there the server itself may be saving?
  17. Hello, I need a little help, I'm creating a server where your database is through SQLite, and I, to reinforce data security, I wanted to make a backup on MySql, copying the table to MySql in case there is a problem may be recovering, can someone help me ?, is it possible?
  18. Hello community, I am creating a system of shaders, both for clothes and for fur, etc., and I realized that shaders need to be applied to the client and I would like to know how I can facilitate this application, can someone Help me? . As there are many shader updates, this can have a certain impact on the server and I would like a simple way.
  19. Incredible, thank you so much for giving me the ready function, it really helped, I am forever grateful
  20. This will help me a lot, but a question, how can I do to identify that the markup is not showing on my screen? since 3D has certain angles that I am not visible on the screen? .
  21. The argument you cited is giving an error. I don't know why, am I doing it right? getScreenFromWorldPosition (x, y, pz + 2, 0.0.3, verdadeiro)
×
×
  • Create New...