ALERT!
Click here to register with a few steps and explore all our cool stuff we have to offer!
Home
Upgrade
Credits
Help
Search
Awards
Achievements
 1376

fix delete object

by carlos_20 - 03-17-2020 - 01:08 PM
#1
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++;
}
Reply
#2
(03-17-2020 - 01:08 PM)carlos_20 Wrote: 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++;
}
this is nothing new just saying!
Reply
#3
if not said to be new just said that it does not take away the objects that the players put on me
Reply

Users browsing: 3 Guest(s)