Because it only removes objects that I put on myself but if another player puts objects on me it does not erase me??
if (quitarobjetos) {
Vector3 coords = GET_ENTITY_COORDS(PLAYER_PED_ID(), 1);
if (obj_count > sizeof(Props) / sizeof(Props[0])) { obj_count = 0; }
Object obj = OBJECT::GET_CLOSEST_OBJECT_OF_TYPE(coords.x, coords.y, coords.z, 3.0f, Props[obj_count], 0, 1, 1);
char* playernamefromentity2 = PLAYER::GET_PLAYER_NAME(NETWORK::_0x40DBF464(NETWORK::NET_TO_PED(NETWORK::NETWORK_GET_NETWORK_ID_FROM_ENTITY(obj))));//Grabs Attackers Name From Entity(Ped) - NET_TO_PED
if (ENTITY::DOES_ENTITY_EXIST(obj) && ENTITY::IS_ENTITY_ATTACHED(obj))
{
if (NETWORK::NETWORK_REQUEST_CONTROL_OF_ENTITY(obj) && NETWORK::NETWORK_HAS_CONTROL_OF_ENTITY(obj))
{
if (ENTITY::IS_ENTITY_ATTACHED_TO_ENTITY(obj, PLAYER_PED_ID())) {
ENTITY::DETACH_ENTITY(obj, 1, 1);
ENTITY::SET_ENTITY_COORDS_NO_OFFSET(obj, 0, 0, 0, 0, 0, 0);
ENTITY::SET_ENTITY_AS_MISSION_ENTITY(obj, 0, 1);
ENTITY::DELETE_ENTITY(&obj);
}
}
}
obj_count++;
}
if (quitarobjetos) {
Vector3 coords = GET_ENTITY_COORDS(PLAYER_PED_ID(), 1);
if (obj_count > sizeof(Props) / sizeof(Props[0])) { obj_count = 0; }
Object obj = OBJECT::GET_CLOSEST_OBJECT_OF_TYPE(coords.x, coords.y, coords.z, 3.0f, Props[obj_count], 0, 1, 1);
char* playernamefromentity2 = PLAYER::GET_PLAYER_NAME(NETWORK::_0x40DBF464(NETWORK::NET_TO_PED(NETWORK::NETWORK_GET_NETWORK_ID_FROM_ENTITY(obj))));//Grabs Attackers Name From Entity(Ped) - NET_TO_PED
if (ENTITY::DOES_ENTITY_EXIST(obj) && ENTITY::IS_ENTITY_ATTACHED(obj))
{
if (NETWORK::NETWORK_REQUEST_CONTROL_OF_ENTITY(obj) && NETWORK::NETWORK_HAS_CONTROL_OF_ENTITY(obj))
{
if (ENTITY::IS_ENTITY_ATTACHED_TO_ENTITY(obj, PLAYER_PED_ID())) {
ENTITY::DETACH_ENTITY(obj, 1, 1);
ENTITY::SET_ENTITY_COORDS_NO_OFFSET(obj, 0, 0, 0, 0, 0, 0);
ENTITY::SET_ENTITY_AS_MISSION_ENTITY(obj, 0, 1);
ENTITY::DELETE_ENTITY(&obj);
}
}
}
obj_count++;
}