From b061a41809954272157fe4b68ea8d3a017dc2b15 Mon Sep 17 00:00:00 2001 From: Yimura Date: Sun, 17 Jan 2021 00:44:00 +0100 Subject: [PATCH] feat(Fuctions): Added delete_entity func --- BigBaseV2/src/features/functions.cpp | 10 ++++++++++ BigBaseV2/src/features/functions.hpp | 2 ++ 2 files changed, 12 insertions(+) diff --git a/BigBaseV2/src/features/functions.cpp b/BigBaseV2/src/features/functions.cpp index 4e7291a9..07ed7eff 100644 --- a/BigBaseV2/src/features/functions.cpp +++ b/BigBaseV2/src/features/functions.cpp @@ -119,6 +119,16 @@ namespace big::features::functions g_settings.save(); } + void delete_entity(Entity ent) + { + take_control_of_entity(ent); + + ENTITY::DETACH_ENTITY(ent, 1, 1); + ENTITY::SET_ENTITY_COORDS_NO_OFFSET(ent, 0, 0, 0, 0, 0, 0); + ENTITY::SET_ENTITY_AS_MISSION_ENTITY(ent, 0, 1); + ENTITY::DELETE_ENTITY(&ent); + } + bool take_control_of_entity(Entity ent) { if (NETWORK::NETWORK_HAS_CONTROL_OF_ENTITY(ent)) return true; diff --git a/BigBaseV2/src/features/functions.hpp b/BigBaseV2/src/features/functions.hpp index 3934d7c8..1b5f7cb2 100644 --- a/BigBaseV2/src/features/functions.hpp +++ b/BigBaseV2/src/features/functions.hpp @@ -13,6 +13,8 @@ namespace big::features::functions void spoof_rank(int rank); void toggle_protections(bool toggle); + void delete_entity(Entity ent); + Entity spawn_vehicle(const char* model, Vector3 location, float heading); void create_ambient_money(Vector3 location, int amount);