TheDoctorWho Posted May 19, 2015 Share Posted May 19, 2015 I am fairly new to modding in general and have been working on a LUA mod, but I can not figure out how to teleport the player to a user set waypoint I looked at the source code for the Native Trainer and I'm completely confused as to how it is actually getting the coords to the waypoint. This is how Native Trainer is doing it. How can I achieve this same effect in LUA? bool blipFound = false;// search for marker blipint blipIterator = UI::_GET_BLIP_INFO_ID_ITERATOR();for (Blip i = UI::GET_FIRST_BLIP_INFO_ID(blipIterator); UI::DOES_BLIP_EXIST(i) != 0; i = UI::GET_NEXT_BLIP_INFO_ID(blipIterator)){ if (UI::GET_BLIP_INFO_ID_TYPE(i) == 4) { coords = UI::GET_BLIP_INFO_ID_COORD(i); blipFound = true; break; }} Link to comment Share on other sites More sharing options...
Fireboyd78 Posted May 20, 2015 Share Posted May 20, 2015 (edited) I've converted the C++ code to Lua for you. I cannot guarantee it will work right off the bat, but at least you'll know where to start. -- search for marker bliplocal blipIterator = UI._GET_BLIP_INFO_ID_ITERATOR()local blipFound = falselocal blip = UI.GET_FIRST_BLIP_INFO_ID(blipIterator)while UI.DOES_BLIP_EXIST(blip) do if UI.GET_BLIP_INFO_ID_TYPE(blip) == 4 then coords = UI.GET_BLIP_INFO_ID_COORD(blip) blipFound = true break end blip = UI.GET_NEXT_BLIP_INFO_ID(blipIterator)end Edited May 20, 2015 by CarLuver69 Deewarz 1 Link to comment Share on other sites More sharing options...
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