Jump to content

Firespider

Members
  • Posts

    222
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Firespider's Achievements

Trick

Trick (18/54)

3

Reputation

  1. ddEventHandler("onClientClick", root, function(Button, State) if IsInvShow then for i, slot in ipairs(slots) do if isMouseInPosition(sx * slot[1], sy * slot[2], sx * slot[3], sy * slot[4]) then if Button == "right" and State == "down" then if slot[5][1] then ClickOnItem(slot[5], i) break end else if not slot[5][1] then if Button == "left" and State == "down" then local x, y = getCursorPosition() WindowMove = {x - InvPos[1], y - InvPos[2]} else WindowMove = {false, false} end else if Button == "left" and State == "down" then DragNDrop = {slot[5], i} slot[5] = {false} else if DragNDrop[1] then ItemMove() end end end end end end end end) This is how I call the function --slot, ID, stack {1, 1, 1, ""} This is the content of the slot table
  2. Can anyone help me?
  3. Hello, I'm making an inventory and now I've found that the items can be moved, but it's not good, for example, that if I bring it to another item, they don't change places, the slot[5] table contains the items. Can someone help me fix the bugs? function ItemMove() for i, slot in ipairs(slots) do if isMouseInPosition(sx * slot[1], sy * slot[2], sx * slot[3], sy * slot[4]) then if slot[5] then if slot[5][1] == DragNDrop[1][1] then if slot[5][2] < items[slot[5][1]][3] then if slot[5][2] + DragNDrop[1][2] > items[slot[5][1]][3] then slot[5][2] = items[slot[5][1]][3] else slot[5][2] = slot[5][2] + DragNDrop[1][2] end else DragNDrop[1] = slot[5] slot[5] = DragNDrop[5] end else slots[DragNDrop[2]][5] = slot[5] slot[5] = DragNDrop[5] end else slot[5] = DragNDrop[1] print("XD") end end end end DragNDrop = {slot[5], i} Below, I only wrote what is in the DragNDrop table
  4. local DashPos = {.2, .2} Server Side: addEventHandler("onPlayerJoin", root, function () local serail = getPlayerSerial(source) local dq = dbQuery(db, "SELECT * FROM vehicle WHERE serial=?", serail) local result = dbPoll(dq, 250) if (#result > 0) then for i, car in ipairs(result) do outputChatBox(i) outputChatBox(car["carid"]) triggerClientEvent("CarData", source, car["carid"]) end end end )
  5. Can anyone help me?
  6. Hello, I need some help with writing out data using a cycle, but the problem is that the DxDrawTexts flow into one, what can you do to help me with this for i, carID in ipairs(id) do dxDrawText(carID, sx*(DashPos[1]+.11), sy*(DashPos[2]+.125), sx*.6, sy*.6, tocolor(255, 255, 255), relx*1.5, rely*1.5, "default-bold", "center", "top") end
  7. And if i set the pics download false then also save pics in the memory?
  8. @FileEX And if i set the Chache false then the player can use the script?
  9. Can I also use this cache in server scripts?
  10. Hello, I'm currently working on an RP mod and I've started testing it with several people, the only problem is that when they log in, it downloads the MTA mod for them, but they can easily publish it because they can access client.lua, etc. see the script files
  11. I wrote a small code that can be connected to chat, the problem is that if I start the resource there will be a double chat, how can I solve this so that there is only one chat local radius = 10 addEventHandler("onPlayerChat", root, function (message, messageType) if (messageType == 0) then local x, y, z = getElementPosition(source) for i, player in ipairs(getElementsByType("player")) do local x1, y1, z1 = getElementPosition(player) local name = getPlayerName(source) if getDistanceBetweenPoints3D(x, y, z, x1, y1, z1) <= radius then outputChatBox("#cccccc" .. name .. " #ffffff mondja: #cccccc"..message , root, 0, 0, 0, true) end end end end )
  12. Hello, I want to write a system with which the player can fly, the only problem is that I have never written a fly system in my life. Can you recommend a few functions that can help in making it?
  13. This problem is that one encrypted text is shorter than the other and so it is not the same what to do with it
×
×
  • Create New...