Wei Posted May 18, 2012 Posted May 18, 2012 local theTable = { [1]={1812.65198, -1889.86047, 13.41406}, [2]={1825.22791, -1635.03711, 13.38281}, [3]={1855.01685, -1430.47449, 13.39063}, [4]={1732.81580, -1296.87122, 13.44294}, [5]={1473.19226, -1295.77124, 13.48315}, } This is the table how can I make when player hits a maker it destroys marker id 1 and show the marker ID 2? Sory but I don't know anything about tables. Diet with russian vodka, lose 3 days in one week !
Castillo Posted May 18, 2012 Posted May 18, 2012 local theTable = { [ 1 ] = { 1812.65198, -1889.86047, 13.41406 }, [ 2 ] = { 1825.22791, -1635.03711, 13.38281 }, [ 3 ] = { 1855.01685, -1430.47449, 13.39063 }, [ 4 ] = { 1732.81580, -1296.87122, 13.44294 }, [ 5 ] = { 1473.19226, -1295.77124, 13.48315 } } function getMarkerPositionFromIndex ( index ) local index = ( tonumber ( index ) or 1 ) if ( theTable [ index ] ) then return unpack ( theTable [ index ] ) end return false end You must set element data on the player and increase it every time you hit the marker, and create the new marker with the position returned from: getMarkerPositionFromIndex. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Wei Posted May 18, 2012 Author Posted May 18, 2012 thanks ! Diet with russian vodka, lose 3 days in one week !
Castillo Posted May 18, 2012 Posted May 18, 2012 You're welcome. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Kenix Posted May 18, 2012 Posted May 18, 2012 P.S Define indexes is optional in table local Array = { { '1' }; [ 2 ] = { [ 1 ] = '2' }; } print( Array[ 1 ][ 1 ] ) -- 1 print( Array[ 2 ][ 1 ] ) -- 2 Index auto-defined from 1. http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now