Jump to content

StiviK

Members
  • Posts

    14
  • Joined

  • Last visited

Posts posted by StiviK

  1. I mean the modules find's the neighbour node of a node by looking at the edges of a node. The edges of a node are defined in the graph, the defined edges are only realistic reachable nodes.

    Which means if the Input graph (sa_nodes) is correct, what you described should not happen.

  2. The return value of the function is a table with this structure: { { x1, y1, z1 }, { x2, y2, z2 }, ..., { xN, yN, zN } } (where N is the count of the used nodes in the Route)

     

    @Jayceon are you trying to use the functions server-side or client-side?

  3. You should see a message like 'MODULE: Loaded "Pathfind Module" (1.00) by "Jusonex, StiviK"' in the console, otherwise it was not loaded!

    Did you add it to your mtaserver.conf! Or try 'loadmodule ml_pathfind_TYPE.dll' in the console.

  4. An example script directly not, but here is it how i use it in my Gamemode:

    function GPS:constructor()
    	-- Check if module is loaded
    	if not loadPathGraph then
    		outputDebugString("GPS module not loaded. Continuing without...", 2)
    		return
    	end
    
    	-- Load path graph
    	self.m_GraphId = loadPathGraph("files/paths/sa_nodes.json")
    end
    
    function GPS:destructor()
    	if unloadPathGraph then
    		unloadPathGraph()
    	end
    end
    
    function GPS:getRoute(callback, from, to)
    	if not findShortestPathBetween then
    		return false
    	end
    	return findShortestPathBetween(self.m_GraphId, from.x, from.y, from.z, to.x, to.y, to.z, callback)
    end

     

    • Like 1
  5. Hello,

    I create a class which can create moveable dxElements. It is very easy to use.

    If you don't know what i mean, just watch one of the Videos :D

      
    -- create 
    dxMoveableElement dxMoveable:createMoveable(int w, int h, bool withAlpha) 
    --destroy  
    dxMoveableElement:destroyElement() 
      
    

      
    -- how to draw the moveable 
    myMoveable = dxMoveable:createMoveable(259, 254, true) 
    dxSetRenderTarget(myMoveable.renderTarget, true) 
            dxDrawRectangle(0, 0, 259, 254) 
    dxSetRenderTarget() 
      
    myMoveable.posX, myMoveable.posY = 100, 500 -- default (0, 0) 
      
    addEventHandler("onClientRender", root, function () 
            dxDrawImage(myMoveable.posX, myMoveable.posY, myMoveable.w, myMoveable.h, myMoveable.renderTarget) 
    end) 
      
    

    To move the Elements just press F2.

    Old Video:

    New Video:

    Download:

    https://community.multitheftauto.com/index.php?p= ... s&id=10330

    - StiviK

×
×
  • Create New...