Jump to content

Markers


~Gangsta~

Recommended Posts

Posted

how to keep position markers after restart resource?

local markers = { 
{2473.29834, -1667.39075, 13.31641}, 
{2484.35034, -1660.34570, 13.33595}, 
{2491.05371, -1675.56274, 13.33595}, 
} 
  
  
local Marker = {} 
  
addEventHandler( 'onResourceStart', getResourceRootElement( getThisResource () ), 
  function() 
    for i, pos in ipairs( markers ) do 
      Marker[i] = createMarker( pos[1], pos[2], pos[3], 'cylinder', 2.5, 0,255,0,255 ) 
      addEventHandler ( "onMarkerHit", Marker[i], destroy ) 
    end 
  end 
) 
  
function destroy(hitPlayer, matchingDimension) 
         if getElementType( hitPlayer ) == "player" then 
                        destroyElement ( source ) 
             
            end 
        end 
  

Posted

I don't understand what do you mean.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Ah, you want the destroyed markers to stay destroyed after the resource restarts, for that, you'll need to create a system to save the state of every marker, then when the resource starts, load that state.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Well, you must choose one method for saving, there's SQL, MySQL, XML.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...