Salem Posted December 31, 2017 Posted December 31, 2017 Hi. I have something like this: addCommandHandler( 'wrem', function( player, command, radius ) if radius then radius = tonumber( radius ) else radius = 10 end local t = false; local x,y,z = getElementPosition( player ) for i=500,20000 do t = removeWorldModel( i,radius, x, y, z ) if t == true then outputChatBox( "[WREM] First object found: model "..i..", radius "..radius, player ) break end end outputChatBox( "[WREM] Done.", player ) end ) This function should return first met object but it returns true for every iteration. I want to ask someone who really knows what's up - who knows how to find and call, for example, function used in editor which returns world object on click. I didn't study that code yet, so if someone can give some hint will be appreciated. My race maps available here: http://chomikuj.pl/salemander/mta+maps
Tails Posted December 31, 2017 Posted December 31, 2017 You can't really get any information from world models as they're not elements. However you can use process line, I think that's how the editor does it. Check: https://wiki.multitheftauto.com/wiki/ProcessLineOfSight and look at the examples. Process line returns information about what it hits, including ids. Discord: its.tails
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