Jump to content

Marker


yMassai

Recommended Posts

local markers =  
{ 
{1824.73217,-1852.47290,12.41406} 
{1824.53881,1675.97546,12.38281} 
{1855.18969,-1405.53662,12.39062} 
{1661.61486,-1295.06185,13,43967} 
} 
  
function Marca () 
    x, y, z = busmakers () 
    MarkerB = createMarker ( x, y, z, "cylinder", 2.0, 255, 255, 0, 85, localPlayer ) 
    Blip = createBlipAttachedTo ( MarkerB, 51, localPlayer ) 
end 
addEventHandler ( "createMarcaEvent", root, Marca ) 

I want to create not random marks, which obey the order posted.

exemple : 1 {1824.73217,-1852.47290,12.41406}, 2 {1824.53881,1675.97546,12.38281}, ...

Link to comment

What is this? Is totally wrong :/

  
function Marca () 
    x, y, z = busmakers () 
    MarkerB = createMarker ( x, y, z, "cylinder", 2.0, 255, 255, 0, 85, localPlayer ) 
    Blip = createBlipAttachedTo ( MarkerB, 51, localPlayer ) 
end 
addEventHandler ( "createMarcaEvent", root, Marca ) 
  

  x, y, z = busmakers () ?????

createMarcaEvent ?????

Where u look this examples.

Link to comment
local markers =  
{ 
{1824.73217,-1852.47290,12.41406} 
{1824.53881,1675.97546,12.38281} 
{1855.18969,-1405.53662,12.39062} 
{1661.61486,-1295.06185,13,43967} 
} 
  
function busmakers () 
    return unpack (markers [ math.random ( #markers ) ] ) 
end 
  
addEvent ( "createMarcaEvent", true ) 
function Marca () 
    x, y, z = busmakers () 
    MarkerB = createMarker ( x, y, z, "cylinder", 2.0, 255, 255, 0, 85, localPlayer ) 
    Blip = createBlipAttachedTo ( MarkerB, 51, localPlayer ) 
end 
addEventHandler ( "createMarcaEvent", root, Marca ) 

sorry did not put the event

'function busmakers ()

return unpack (markers [ math.random ( #markers ) ] )

end'

how can I use on a non-random?

Link to comment

By "non-random" you mean like a route?

P.S:

local markers = 
{ 
{1824.73217,-1852.47290,12.41406} 
{1824.53881,1675.97546,12.38281} 
{1855.18969,-1405.53662,12.39062} 
{1661.61486,-1295.06185,13,43967} 
} 

You have missing commas after each item.

Link to comment
players = { } 

That would be the table where we'll store each player element and the current index of the table.

players [ playerElement ] = 1 

This would store a player element with the table index as 1, then you can do this:

local index = players [ playerElement ] 
local x, y, z = unpack ( markers [ index ] ) 

Link to comment

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...