feat(Weapons): Added money gun

This commit is contained in:
Yimura 2021-01-15 01:24:42 +01:00
parent e389c3c21c
commit 73d378a7e6
No known key found for this signature in database
GPG Key ID: 3D8FF4397E768682
6 changed files with 68 additions and 7 deletions

View File

@ -16,6 +16,7 @@ namespace big
disable_phone();
god_mode();
gravity_gun();
money_gun();
never_wanted();
noclip();
no_bike_fall();

View File

@ -30,9 +30,12 @@ namespace big
void script_func();
void delete_gun();
void gravity_gun();
void money_gun();
void vehicle_gun();
void disable_phone();
void god_mode();
void gravity_gun();
void never_wanted();
void noclip();
void no_bike_fall();
@ -46,7 +49,6 @@ namespace big
void spoof_rank();
void sticky_tyres();
void super_sprint();
void vehicle_gun();
void update_screen_sizes();
void update_player_structs();

View File

@ -0,0 +1,57 @@
#include "features.hpp"
namespace big
{
static const int controls[] = { 14, 15, 24 };
static bool busy = false;
static Entity entity = 0;
void features::money_gun()
{
bool bMoneyGun = g_settings.options["custom_gun"]["type"] == 3;
if (bMoneyGun)
{
Ped player = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_playerId);
Hash currWeapon;
WEAPON::GET_CURRENT_PED_WEAPON(player, &currWeapon, 1);
if (currWeapon != RAGE_JOAAT("weapon_pistol") && currWeapon != RAGE_JOAAT("weapon_pistol_mk2")) return;
if (PAD::IS_DISABLED_CONTROL_PRESSED(0, 25))
{
PLAYER::DISABLE_PLAYER_FIRING(g_playerId, true);
for (int control : controls)
PAD::DISABLE_CONTROL_ACTION(0, control, true);
if (PAD::IS_DISABLED_CONTROL_PRESSED(0, 24) && !busy)
{
busy = true;
QUEUE_JOB_BEGIN_CLAUSE(&)
{
if (functions::raycast_entity(&entity))
{
if (!ENTITY::IS_ENTITY_A_PED(entity) || !PED::IS_PED_A_PLAYER(entity))
{
busy = false;
return;
}
Vector3 location = ENTITY::GET_ENTITY_COORDS(entity, true);
features::functions::create_ambient_money(location, rand() % 500 + 2000);
script::get_current()->yield(33ms);
busy = false;
}
}QUEUE_JOB_END_CLAUSE
}
}
}
}
}

View File

@ -6,7 +6,7 @@ namespace big
void features::vehicle_gun()
{
bool bVehicleGun = g_settings.options["custom_gun"]["type"] == 3;
bool bVehicleGun = g_settings.options["custom_gun"]["type"] == 4;
if (bVehicleGun)
{
@ -25,7 +25,7 @@ namespace big
if (PAD::IS_DISABLED_CONTROL_JUST_RELEASED(0, 24))
{
Vector3 location = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(player, 0.f, 10.f, 0.f);
Vector3 location = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(player, 0.f, 15.f, 0.f);
Vehicle veh = functions::spawn_vehicle(
"bus",
location,

View File

@ -42,7 +42,7 @@ namespace big
g_settings.save();
break;
case 3:
case 4:
ImGui::Text("Set the vehicle model to spawn.");

View File

@ -7,9 +7,10 @@ namespace big
{
inline custom_gun custom_guns[] = {
0, "None",
1, "Delete Gun",
1, "Delete From Existence",
2, "Gravity Gun",
3, "Vehicle Gun"
3, "Money Printer",
4, "Vehicle Yeeter"
};
inline const int64_t kick_hashes[]{ 1317868303,-1243454584,-1212832151,-1252906024,-1890951223,-442306200,-966559987,1977655521,1998625272,1070934291,764638896,-345371965,-1559754940,1347850743,495824472,1240585650,1129105265,1192658057,3042061272,2735212356, 3852661096,123310597000,122994296644, -1549630786, -1990292823, 1352706024, 12442595688, 11325146948, 11631995864, 96893296585, 98341941608, 97224492868, 97540793224, 1317868303,-1243454584,-1212832151,-1252906024,-1890951223,-442306200,-966559987,1977655521,1998625272,1070934291,764638896,-345371965,-1559754940,1347850743,495824472,1240585650,1129105265,1192658057,3042061272,2735212356, 3852661096,123310597000,122994296644, -1549630786, -1990292823, 1352706024,