feat(GravityGun): Made gravity gun a selectable
This commit is contained in:
parent
7aec3ebb7c
commit
d8e57aec83
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace big
|
namespace big
|
||||||
{
|
{
|
||||||
static Entity entity = -1;
|
static Entity entity = 0;
|
||||||
static Vector3 location;
|
static Vector3 location;
|
||||||
static Vector3 other;
|
static Vector3 other;
|
||||||
static double dist;
|
static double dist;
|
||||||
@ -12,14 +12,16 @@ namespace big
|
|||||||
|
|
||||||
void features::gravity_gun()
|
void features::gravity_gun()
|
||||||
{
|
{
|
||||||
bool bGravityGun = g_settings.options["gravity_gun"]["enabled"];
|
bool bGravityGun = g_settings.options["custom_gun"]["type"] == 2;
|
||||||
double multiplier = g_settings.options["gravity_gun"]["multiplier"];
|
double multiplier = g_settings.options["custom_gun"]["gravity_velocity_multiplier"];
|
||||||
|
|
||||||
|
if (bGravityGun)
|
||||||
|
{
|
||||||
Hash currWeapon;
|
Hash currWeapon;
|
||||||
WEAPON::GET_CURRENT_PED_WEAPON(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_playerId), &currWeapon, 1);
|
WEAPON::GET_CURRENT_PED_WEAPON(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_playerId), &currWeapon, 1);
|
||||||
|
|
||||||
if (bGravityGun && currWeapon == RAGE_JOAAT("weapon_pistol"))
|
if (currWeapon != RAGE_JOAAT("weapon_pistol") && currWeapon != RAGE_JOAAT("weapon_pistol_mk2")) return;
|
||||||
{
|
|
||||||
// ZOOMED IN
|
// ZOOMED IN
|
||||||
if (PAD::IS_DISABLED_CONTROL_PRESSED(0, 25))
|
if (PAD::IS_DISABLED_CONTROL_PRESSED(0, 25))
|
||||||
{
|
{
|
||||||
@ -30,9 +32,17 @@ namespace big
|
|||||||
location = ENTITY::GET_ENTITY_COORDS(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_playerId), true);
|
location = ENTITY::GET_ENTITY_COORDS(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_playerId), true);
|
||||||
|
|
||||||
// Attack RELEASED
|
// Attack RELEASED
|
||||||
if (PAD::IS_DISABLED_CONTROL_JUST_PRESSED(0, 24))
|
if (PAD::IS_DISABLED_CONTROL_PRESSED(0, 24) && entity == 0)
|
||||||
{
|
{
|
||||||
if (functions::raycast_entity(&entity))
|
if (functions::raycast_entity(&entity))
|
||||||
|
{
|
||||||
|
if (ENTITY::IS_ENTITY_A_PED(entity) && PED::IS_PED_A_PLAYER(entity))
|
||||||
|
{
|
||||||
|
entity = 0;
|
||||||
|
|
||||||
|
notify::above_map("You can't move player entities!");
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
other = ENTITY::GET_ENTITY_COORDS(entity, true);
|
other = ENTITY::GET_ENTITY_COORDS(entity, true);
|
||||||
dist = functions::distance_between_vectors(location, other);
|
dist = functions::distance_between_vectors(location, other);
|
||||||
@ -50,6 +60,7 @@ namespace big
|
|||||||
features::notify::above_map("Selected entity at crosshair.");
|
features::notify::above_map("Selected entity at crosshair.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
entity = 0;
|
entity = 0;
|
||||||
@ -85,11 +96,11 @@ namespace big
|
|||||||
ENTITY::SET_ENTITY_VELOCITY(entity, (zRot.x - other.x) * multiplier, (zRot.y - other.y) * multiplier, (zRot.z - other.z) * multiplier);
|
ENTITY::SET_ENTITY_VELOCITY(entity, (zRot.x - other.x) * multiplier, (zRot.y - other.y) * multiplier, (zRot.z - other.z) * multiplier);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (entity != -1)
|
else if (entity != 0)
|
||||||
{
|
{
|
||||||
ENTITY::SET_ENTITY_COLLISION(entity, true, true);
|
ENTITY::SET_ENTITY_COLLISION(entity, true, true);
|
||||||
|
|
||||||
entity = -1;
|
entity = 0;
|
||||||
|
|
||||||
features::notify::above_map("Released entity.");
|
features::notify::above_map("Released entity.");
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user