Jump to content

[ASK] About getElementsByType


sheenidgs

Recommended Posts

Posted

Hi... I have a problem with getElementsByType.

  
local location = getElementsByType ( "carjunk" ) 
print (#location) 
  

And this is my .map file

  
<jobsystem> 
    <carjunk x="1643.1171" y="-1515.9602" z="13.6608" />    <!-- Car junk LS - Dealer --> 
    <carjunk x="2050.0410" y="-2493.8975" z="13.5469" />    <!-- Car junk LS - Airport --> 
    <carjunk x="2449.2085" y="-2717.8171" z="1.2407" />     <!-- Car junk LS - Dock --> 
    <carjunk x="-1936.1998" y="276.2972" z="41.0469" />     <!-- Car junk SF - Dealer --> 
    <carjunk x="-1444.9786" y="-518.4357" z="13.8330" />    <!-- Car junk SF - Airport --> 
    <carjunk x="-1650.2468" y="254.0446" z="-0.4856" />     <!-- Car junk SF - Dock --> 
    <carjunk x="1406.0493" y="970.4077" z="10.8130" />      <!-- Car junk LV - Dealer --> 
    <carjunk x="1370.8197" y="1769.5979" z="10.4103" /> <!-- Car junk LV - Airport --> 
    <carjunk x="1628.2588" y="572.7244" z="-0.4549" />      <!-- Car junk LV - Dock --> 
</jobsystem> 
  

But, the return value is 0. I've already change theType on getElementsByType to jobsystem, but it's keep 0.

Posted

Is the map file on the meta.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.

Posted

That's a wrong map file, try this:

    "1643.1171" y="-1515.9602" z="13.6608" />    -- Car junk LS - Dealer --> 
    "2050.0410" y="-2493.8975" z="13.5469" />    -- Car junk LS - Airport --> 
    "2449.2085" y="-2717.8171" z="1.2407" />     -- Car junk LS - Dock --> 
    "-1936.1998" y="276.2972" z="41.0469" />     -- Car junk SF - Dealer --> 
    "-1444.9786" y="-518.4357" z="13.8330" />    -- Car junk SF - Airport --> 
    "-1650.2468" y="254.0446" z="-0.4856" />     -- Car junk SF - Dock --> 
    "1406.0493" y="970.4077" z="10.8130" />      -- Car junk LV - Dealer --> 
    "1370.8197" y="1769.5979" z="10.4103" /> -- Car junk LV - Airport --> 
    "1628.2588" y="572.7244" z="-0.4549" />      -- Car junk LV - Dock --> 

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
That's a wrong map file, try this:
    "1643.1171" y="-1515.9602" z="13.6608" />    -- Car junk LS - Dealer --> 
    "2050.0410" y="-2493.8975" z="13.5469" />    -- Car junk LS - Airport --> 
    "2449.2085" y="-2717.8171" z="1.2407" />     -- Car junk LS - Dock --> 
    "-1936.1998" y="276.2972" z="41.0469" />     -- Car junk SF - Dealer --> 
    "-1444.9786" y="-518.4357" z="13.8330" />    -- Car junk SF - Airport --> 
    "-1650.2468" y="254.0446" z="-0.4856" />     -- Car junk SF - Dock --> 
    "1406.0493" y="970.4077" z="10.8130" />      -- Car junk LV - Dealer --> 
    "1370.8197" y="1769.5979" z="10.4103" /> -- Car junk LV - Airport --> 
    "1628.2588" y="572.7244" z="-0.4549" />      -- Car junk LV - Dock --> 

Hey, it works! Thanks :D

Btw, could you resolve my another problem ? -> viewtopic.php?f=91&t=64828

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