Jump to content

The_GTA

Helpers
  • Posts

    822
  • Joined

  • Last visited

  • Days Won

    86

Posts posted by The_GTA

  1. Good job. I have looked into the newest 1.6 features and I am impressed. I think the most impacting QoL improvement is for race servers that suffered from the FPS-bound tire-smoke effect. Now that the 2DFX particle spawning is time-based it should not be too bad. I am excited about the more-advanced engine functions and how that will be used by MTA scripters. Thank you for your continued effort to improve MTA!

    • Like 1
  2. On 03/04/2023 at 12:05, AREPIUU said:

    voce abriu minha mente aobrigado estava entrigado com isso a dias sobre roubo de ideias tem acontecido muito comigo

    No problem, bro. This intellectual property theft is heavier than ever. In the past it was hindered by the intellect and perseverance of people. But now countless of machines that are capable to estimate and logically deduce using "examples" can be used for that purpose. The degeneration of society using such wild technology is inevitable if politics does not remove the money source. My idea is the following:

    - instead of being given the benefit of the doubt in court, CSG or higher language science software models (1) have to prove that they own the intellectual property rights to their output (goes in hand with the AI being a commercial product)

    - watch every company or entity involved in (1) by market and political checks, them having to apply to various programmes opening up their databases and activities

    - humanize internet technologies, partition the web, make an alternative "internet"

    Just some ideas. But the "as-if" principles that those crooks use could make any political safe-guard a joke. In the worst case the theft happens purely in energetical interactions not traceable by the human perception, hidden behind cryptograhically strong communication, output far-and-wide in stochastical spread.

  3. ChatGPT ist eine weltverändernde Form von künstlicher Intelligenz. In ihrer Art die Mehrdeutigkeit der Kommunikation zu erfassen und daraus zielgerichtet Antworten zu geben stellt eine Gefahr für unsere heutige Gesellschaft dar. Die grundfesten Ideale des Kapitalismus, der Wertschätzung werden beraubt in dem man seine eigene Existenz in diese Netzwerke opfert. Mit meinem Expertenwissen versuche ich euch zu erklären worum es in Wahrheit geht:

     

     

  4. 1 minute ago, vicisdev said:

    Think this is going to be really helpful in an inventory framework I'm planning to develop. Inventories have a strong customizability factor. Each use case is a unique use case. People would want to add their own stuff, etc. I'm pretty sure this module will allow me to do things much more automagically.

    I am happy to hear that! Have fun with this project.

    1 minute ago, vicisdev said:

    One down side is that people would need to manually include the module binary. Not that this is of a great effort, but it's not very common.

    I agree. This workflow seems really complicated. Not much I can do about that though on the module's end. We know the steps of adjusting the server configuration and adding the binary. But I hope that people are willing to get into stuff that seems new to them!

    • Like 1
  5. Just now, vicisdev said:

    Yes! One particular useful case is to let people add as much assets (images, col, txd, etc) as they want and automatically add them into the meta.xml using the scanDir API

    Yes, you can read files inside of any resource and adjust the meta.xml files according to rules. Be careful and do not add the same file twice. Also think about removing meta.xml entries whose files do not exist anymore.

  6. 9 hours ago, FernandoMTA said:

    Hi! Very interesting, it definitely sounds useful. Do you know any practical applications of this module so far?

    I would like to see a modloader that uses the scanDir API instead of the meta.xml.

    Also a personal webspace on the MTA server for user-submitted mods could be cool.

    • Like 1
  7. local function invMoveSlots(sinv, sslot, tinv, tslot)
        if not sslot or not tslot or not sinv or not tinv then return end
    
        local selectedSlot1 = sinv.items[sslot]
        local selectedSlot2 = tinv.items[tslot]
    
        sinv.items[sslot] = selectedSlot2
        tinv.items[tslot] = selectedSlot1
    end
    
    local isdragging = false;
    local draginv = false;
    local dragslot = false;
    local slotrender = false;
    
    function Inventory:drag(button,state,mouseX,mouseY)
        if button == 'left' then
            if state == 'down' then
                if (isdragging == false) then
                    self.getSlotInfo = {self:getSlot(mouseX,mouseY)}
                    firsSlot = self.getSlotInfo[4]
                    if (firsSlot) then
                        isdragging = true;
                        draginv = self;
                        dragslot = firsSlot;
                        slotrender = self.fSlot;
                        addEventHandler('onClientRender',root,self.fSlot)
                    end
                end
            end
            if state == 'up' then
                if (isdragging) then
                    self.getSlotInfo = {self:getSlot(mouseX,mouseY)}
                    print(self.getSlotInfo[4])
                    if (self.getSlotInfo[4]) then
                        invMoveSlots(draginv, dragslot, self, self.getSlotInfo[4])
                    end
                    removeEventHandler('onClientRender',root,slotrender)
                    isdragging = false;
                    draginv = false;
                    dragslot = false;
                    slotrender = false;
                end
            end
        end
    end

    Your system is fundamentally flawed because it does not contain the global inventory list but you are ignoring my messaging so I won't remind you any further.

  8. local function invMoveSlots(sinv, sslot, tinv, tslot)
        if not sslot or not tslot or not sinv or not tinv then return end
    
        local selectedSlot1 = sinv.items[sslot]
        local selectedSlot2 = tinv.items[tslot]
    
        sinv.items[sslot] = selectedSlot2
        tinv.items[tslot] = selectedSlot1
    end
    
    local isdragging = false;
    local draginv = false;
    local dragslot = false;
    local slotrender = false;
    
    function Inventory:drag(button,state,mouseX,mouseY)
        if button == 'left' then
            if state == 'down' then
                self.getSlotInfo = {self:getSlot(mouseX,mouseY)}
                firsSlot = self.getSlotInfo[4]
                if (firsSlot) then
                    isdragging = true;
                    draginv = self;
                    dragslot = firsSlot;
                    slotrender = self.fSlot;
                    addEventHandler('onClientRender',root,self.fSlot)
                end
            end
            if state == 'up' then
                if (isdragging) then
                    self.getSlotInfo = {self:getSlot(mouseX,mouseY)}
                    print(self.getSlotInfo[4])
                    if (self.getSlotInfo[4]) then
                        invMoveSlots(draginv, dragslot, self, self.getSlotInfo[4])
                    end
                    removeEventHandler('onClientRender',root,slotrender)
                    isdragging = false;
                    draginv = false;
                    dragslot = false;
                    slotrender = false;
                end
            end
        end
    end

    This is just an example and does not contain the code for cross inventory dragging. You have to implement the list of inventories to do it.

  9. 2 minutes ago, iwalidza said:

    i now it how i can do it i want check if player is still clicking

    i use on client click

    its do that

    I think that with "clicking" you are not referring to the repeat motion of clicking the mouse button BUT the motion of leaving your finger on the mouse button clicked? You can query this information using the getKeyState function by passing the "mouse1" string to it for the left mouse button, "mouse2" for the right mouse button.

  10. 9 minutes ago, iwalidza said:

    and how i can get the inventory player click

    Put all inventories into a list, iterate over them in the mouse click handler and check which one has a defined rectangle item slot at the current mouse position. Store the successful inventory in a variable and retrieve it's type field to check which one it is.

  11. function Inventory:getSlot (x,y)
        for i = 1, #self.slots do -- table
            local t = i - 1
            local xOffset = self.startX + (t*(self.iconSize + self.padding)) 
            local yOffset = self.startY + (math.floor(t/6)*(self.iconSize + self.padding))
            xOffset = xOffset - math.floor(t/6)*(6*(self.iconSize + self.padding))
     
            if isInBox(x,y,xOffset,xOffset + self.iconSize,yOffset,yOffset + self.iconSize) then
                return i
            end
        end
        return false -- good idea
    end

    What is the definition of the isInBox function?

  12. Hello Dzsozi (h03),

    your script appears to be missing the path of menus that you are visiting. The path of menus is defined as a list of menu displays d1...dn where d1 is the initially displayed menu, di is the menu that was selected in menu d(i-1). Then switching back to the previous menu is defined as removing the top-most menu entry dn and setting the menu entry d(n-1) as the current menu display.

    With that idea in your head, I hope that you can figure out it's implementation. Feel free to ask.

    • Confused 1
  13. 4 minutes ago, SinaAmp said:

    id select from column id and skin from column skin

    You misunderstand how the SQL language works. To get all rows and columns of accounts SQL table, you execute...

    SELECT * FROM accounts

    But if you want just id and skin, you execute...

    SELECT id, skin FROM accounts

    Thus I recommend you to change the database query to...

    	local skinData = dbQuery(connection,"SELECT skin,id FROM accounts LIMIT 1")

     

    • Like 2
×
×
  • Create New...