Jump to content

explain me please


Wei

Recommended Posts

Posted
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 !

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

560x95_FFFFFF_FF9900_000000_000000.png

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

Posted

You're welcome.

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

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.

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