Hello, I would like to know how I can obtain the information of an object (that has not been created by mp.objects.new) from the world or game by default that is close to me, that is:
If I am near an ATM and I want to get the position, the model and hash of that object, how do I do?
I managed to print an information in the chat when I am near some object that I want to scan using mp.game.object.getClosestObjectOfType(); but it failed to print the detailed information of the object as it tells me unknown and / or [object Object]
mp.events.add('get_scan', () => {
let foundTicketATM = mp.game.object.getClosestObjectOfType(localPlayer.position.x, localPlayer.position.y, localPlayer.position.z, 1.9, 506770882, false, true, true);
if(foundTicketATM)
{
chatGlobal.execute(`chatAPI.push('object info: ${foundTicketATM}'); show2();`);
}
});