AndyStyle Posted December 21, 2010 Share Posted December 21, 2010 Hey guys, I have made an dynamic housesystem with create / load / save functions. These works. Create the marker: house[current] = createMarker(....) Now I have a problem with the event 'onMarkerHit' because my marker does not have a fixed variable so I can not do this: addEventHandler("onMarkerHit",function enter(source) for i = 1, maxhouse do return i end end ,enter123) or this: addEventHandler("onMarkerHit", enter(source), enter123) function enter(theplayer) for i = 1, maxhouse do return i end end Have anyone a idea how to fix this. - AndyStyle Link to comment
Arran Posted December 21, 2010 Share Posted December 21, 2010 house[current] = createMarker(....) addEventHandler("onMarkerHit", house[current], someFunc) Link to comment
AndyStyle Posted December 21, 2010 Author Share Posted December 21, 2010 but when when i load the houses the current + 1 so: for i = 1, maxhouse do house[current] = createMarker(...) current = current + 1 end Link to comment
Arran Posted December 21, 2010 Share Posted December 21, 2010 Yes and the addEventHandler("onMarkerHit", house[current], someFunc) works, as I made a housing system yesterday. Link to comment
Aibo Posted December 21, 2010 Share Posted December 21, 2010 you can simply setElementData for the house marker with id or whatever. Link to comment
AndyStyle Posted December 21, 2010 Author Share Posted December 21, 2010 thanks I will test it when mta & gtasa works on ubuntu Link to comment
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