Hazardinho

Members
  • Content Count

    40
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Hazardinho

  • Rank
    Rat

Recent Profile Visitors

220 profile views
  1. 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
  2. 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)
  3. 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?
  4. 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
  5. I can't even imagine how to start it, I don't know anything about sql ...
  6. 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?
  7. 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?
  8. 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.
  9. Incredible, thank you so much for giving me the ready function, it really helped, I am forever grateful
  10. 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? .
  11. 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)
  12. Hello community, I created a script to mark the location of the location in dx, where it shows the location, how many meters are from the location, and I was looking to improve this function where, basically, if the 3D Dx image is not activated On the player screen , the image will be in the corner of the image corresponding to the side where the mark is. Image: https://imgur.com/a1AKZ96 Expectation made in the Photo Shop: https://imgur.com/Tskkamp
  13. Hello community, Well, I need your help ... I'm trying to create a system in which the player releases an object, and the object is next to the player, regardless of the rotation, I did this check, but it always falls on the first check, regardless of rotation. local _, _, rotz = getElementRotation(element) outputChatBox(math.floor(rotz), element) if math.floor(rotz) > 0 and math.floor(rotz) < 80 then local x,y,z = getElementPosition(element) object[element] = createObject(2969, x, y - 1, z - 0.8) setObjectScale(object[element],1.4) setElementCollisionsEnabled(object[element],false) outputChatBox("1", element) else if math.floor(rotz) > 165 and 250 < math.floor(rotz) then local x,y,z = getElementPosition(element) object[element] = createObject(2969, x, y - 1, z - 0.8) setObjectScale(object[element],1.4) setElementCollisionsEnabled(object[element],false) outputChatBox("2", element) else if math.floor(rotz) > 251 and 350 < math.floor(rotz) then local x,y,z = getElementPosition(element) object[element] = createObject(2969, x, y - 1, z - 0.8) setObjectScale(object[element],1.4) setElementCollisionsEnabled(object[element],false) outputChatBox("3", element) end end end The coordinates are incorrect, I know, but basically I just want help checking the element's rotation.