GoroUnreal 1 Posted May 17, 2015 Just trying to work out the best way to get the entity or ped id the player is targeting whether it be targeting with a gun or hand. Essentially much like the gravity gun mod where you can target something and manipulate it. Tried using GET_PLAYER_TARGET_ENTITY but it doesn't seem to work or i'm not using it right. Quote Share this post Link to post Share on other sites
GoroUnreal 1 Posted May 18, 2015 (edited) Got it to work, here's an example for those wondering: Entity foundEntity; BOOL target1 = PLAYER::GET_PLAYER_TARGET_ENTITY(PLAYER::PLAYER_ID(), &foundEntity);BOOL target2 = PLAYER::_0x2975C866E6713290(PLAYER::PLAYER_ID(), &foundEntity); if (target1 != false || target2 != false && ENTITY::IS_ENTITY_A_PED(foundEntity) != false) { // Do something}else { foundEntity = NULL;} Edited May 18, 2015 by GoroUnreal Quote Share this post Link to post Share on other sites
thunder_ 1 Posted May 18, 2015 Got it to work, here's an example for those wondering: Entity foundEntity; BOOL target1 = PLAYER::GET_PLAYER_TARGET_ENTITY(PLAYER::PLAYER_ID(), &foundEntity);BOOL target2 = PLAYER::_0x2975C866E6713290(PLAYER::PLAYER_ID(), &foundEntity); if (target1 != false || target2 != false && ENTITY::IS_ENTITY_A_PED(foundEntity) != false) { // Do something}else { foundEntity = NULL;} What is with all of that "!= false"...? Quote Share this post Link to post Share on other sites