Chanka Posted December 19, 2019 Share Posted December 19, 2019 I'm trying to delete an object, but it requires the object pointer. Using the following does not work OBJECT::DELETE_OBJECT(item); OBJECT::DELETE_OBJECT(&item); Object* x = *obj; OBJECT::DELETE_OBJECT(x); They either crash the game or don't delete the object. Snippet of how the code is used. bool toggle = false; if (SwitchPressed()) { toggle = !toggle; Player player = PLAYER::PLAYER_PED_ID(); Vector3 coords = ENTITY::GET_ENTITY_COORDS(player, true, 0); if (draw) { Object eh = OBJECT::CREATE_OBJECT(0x07BEEC42, coords.x, coords.y, coords.z + 2, false, false, true, false, false); ENTITY::ATTACH_ENTITY_TO_ENTITY(eh, player, 92, 0, 0, 0, 0, 0, 0, false, true, false, false, 0, true, false, false); } else { OBJECT::DELETE_OBJECT(eh); } ResetSwitch(); } 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