Jump to content

Table Problem , please help me.


Twiz.

Recommended Posts

Hey Guys need help , i want to create a Marker with the Coordinates from the Table. I already did a thread like this but i was too dumb to understand :( . I hope you understand what i want , i want to create a little job to run into marker then go to another marker etc. . I can script everything else i want to but this is not working for me :( .

local markerst = { <---- Table with Coordinates  
    [1] = { 1, 1, 1}, 
    [2] = { 2, 2, 2},  
    [3] = { 3, 3, 3}, 
}  
  
function idontgethowtodothis ( )  
local x, y, z = i want the coordinates from up there ^ 
testarker = createMarker( x, y, z , . . . . )  
addEventHandler("onMarkerHit", testarker, destroy)  
end  
  
function destroy()  
destroyElement( testarker )  
end  
  
-- This is just an Example please help me : (  

Link to comment
local markerst = -- Table with Coordinates 
{ 
    [ 1 ] = { 1, 1, 1 }, 
    [ 2 ] = { 2, 2, 2 }, 
    [ 3 ] = { 3, 3, 3 }, 
} 
  
function idontgethowtodothis ( ) 
    local x, y, z = unpack ( markerst [ 1 ] ) 
    testarker = createMarker ( x, y, z ) 
    addEventHandler ( "onMarkerHit", testarker, destroy ) 
end 
  
function destroy ( ) 
    destroyElement ( testarker ) 
end 

Has to work.

Link to comment
local markerst = -- Table with Coordinates 
{ 
    [ 1 ] = { 1, 1, 1 }, 
    [ 2 ] = { 2, 2, 2 }, 
    [ 3 ] = { 3, 3, 3 }, 
} 
  
function idontgethowtodothis ( ) 
    local x, y, z = unpack ( markerst [ 1 ] ) 
    testarker = createMarker ( x, y, z ) 
    addEventHandler ( "onMarkerHit", testarker, destroy ) 
end 
  
function destroy ( ) 
    destroyElement ( testarker ) 
end 

Has to work.

no its still not working :( , i tryed alot and i still dont know why its not working :( . I just want to script something like a job >.<.

Link to comment

Oh, so you expected a function to execute on it's own? great.

You must add either a command or a event handler, to test you can do this:

local markerst = -- Table with Coordinates 
{ 
    [ 1 ] = { 1, 1, 1 }, 
    [ 2 ] = { 2, 2, 2 }, 
    [ 3 ] = { 3, 3, 3 }, 
} 
  
function idontgethowtodothis ( ) 
    local x, y, z = unpack ( markerst [ 1 ] ) 
    testarker = createMarker ( x, y, z ) 
    addEventHandler ( "onMarkerHit", testarker, destroy ) 
end 
addEventHandler ( "onResourceStart", resourceRoot, idontgethowtodothis ) 
  
function destroy ( ) 
    destroyElement ( testarker ) 
end 

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