kevincn 0 Posted September 13, 2015 Share Posted September 13, 2015 Hello! Can you tell me how to write additional cancel it? { Hash hash = GAMEPLAY::GET_HASH_KEY("p_cablecar_s"); STREAMING::REQUEST_MODEL(hash); while (!STREAMING::HAS_MODEL_LOADED(hash)) //Put a ; if this doesnt work WAIT(0); Object object = OBJECT::CREATE_OBJECT(hash, 0, 0, 0, true, true, false); ENTITY::ATTACH_ENTITY_TO_ENTITY(object, playerPed, 0x49d9, 0.0, 0.0, -0.07, 0.0, 0.0, 0.0, false, false, false, false, 2, true); } Link to post Share on other sites
TuckerW2001 2 Posted September 13, 2015 Share Posted September 13, 2015 void cableCar(Player selectedPlayer) { Hash hash = GAMEPLAY::GET_HASH_KEY("p_cablecar_s"); Vector3 playerPosition = ENTITY::GET_ENTITY_COORDS(selectedPlayer, 0); Object obj = OBJECT::GET_CLOSEST_OBJECT_OF_TYPE(playerPosition.x, playerPosition.y, playerPosition.z, 3.0f, hash, TRUE, 0, 0); if (ENTITY::DOES_ENTITY_EXIST(obj)) { ENTITY::DELETE_ENTITY(&obj); } else { STREAMING::REQUEST_MODEL(hash); while (!STREAMING::HAS_MODEL_LOADED(hash)) WAIT(0); { Object object = OBJECT::CREATE_OBJECT(hash, 0, 0, 0, true, true, false); ENTITY::ATTACH_ENTITY_TO_ENTITY(object, selectedPlayer, PED::GET_PED_BONE_INDEX(selectedPlayer, 0x49d9), 0.0, 0.0, -0.07, 0.0, 0.0, 0.0, false, false, false, false, 2, true); } } } // This should work just call it on a button or however you want also make sure the selectedPlayer is you and you have to use the bone index or it wont attach right it will be static Link to post Share on other sites
kevincn 0 Posted September 13, 2015 Author Share Posted September 13, 2015 void cableCar(Player selectedPlayer) { Hash hash = GAMEPLAY::GET_HASH_KEY("p_cablecar_s"); Vector3 playerPosition = ENTITY::GET_ENTITY_COORDS(selectedPlayer, 0); Object obj = OBJECT::GET_CLOSEST_OBJECT_OF_TYPE(playerPosition.x, playerPosition.y, playerPosition.z, 3.0f, hash, TRUE, 0, 0); if (ENTITY::DOES_ENTITY_EXIST(obj)) { ENTITY::DELETE_ENTITY(&obj); } else { STREAMING::REQUEST_MODEL(hash); while (!STREAMING::HAS_MODEL_LOADED(hash)) WAIT(0); { Object object = OBJECT::CREATE_OBJECT(hash, 0, 0, 0, true, true, false); ENTITY::ATTACH_ENTITY_TO_ENTITY(object, selectedPlayer, PED::GET_PED_BONE_INDEX(selectedPlayer, 0x49d9), 0.0, 0.0, -0.07, 0.0, 0.0, 0.0, false, false, false, false, 2, true); } } } // This should work just call it on a button or however you want also make sure the selectedPlayer is you and you have to use the bone index or it wont attach right it will be static Thanks,谢谢 Link to post Share on other sites