Wei Posted June 9, 2012 Posted June 9, 2012 How can I make this working ? local thePickups = { "1236.14709, -1326.85632, 13.76983" } function createPickups() for i, n in pairs(thePickups) do infopointpickup = createPickup(n, 3, 1239, 0.1) end end addEventHandler("onResourceStart", getRootElement(), createPickups) And how can I add the text to them. Like Pickup 1 has position 0,0,0 and when i hit pickup 1 it outputs Pickup 1 text Diet with russian vodka, lose 3 days in one week !
Castillo Posted June 9, 2012 Posted June 9, 2012 local thePickups = { { 1236.14709, -1326.85632, 13.76983 } } function createPickups ( ) for i, n in pairs ( thePickups ) do infopointpickup = createPickup ( n [ 1 ], n [ 2 ], n [ 3 ], 3, 1239, 0.1 ) end end addEventHandler ( "onResourceStart", resourceRoot, createPickups ) You we're using a STRING instead of 3 values: X, Y, Z. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Wei Posted June 9, 2012 Author Posted June 9, 2012 And how can I add Text ? Diet with russian vodka, lose 3 days in one week !
Castillo Posted June 9, 2012 Posted June 9, 2012 local thePickups = { { 1236.14709, -1326.85632, 13.76983, "Hello World!" } } function createPickups ( ) for i, n in pairs ( thePickups ) do local infopointpickup = createPickup ( n [ 1 ], n [ 2 ], n [ 3 ], 3, 1239, 0.1 ) if ( infopointpickup ) then setElementData ( infopointpickup, "text", n [ 4 ] ) end end end addEventHandler ( "onResourceStart", resourceRoot, createPickups ) Then you can use getElementData to get the text of the pickup. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Wei Posted June 9, 2012 Author Posted June 9, 2012 Thank you ! Diet with russian vodka, lose 3 days in one week !
Castillo Posted June 9, 2012 Posted June 9, 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.
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