This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
maybegreat48 9ccb77e8eb
Add more spoofing options and added clang-format (#1020)
* feat(Spoofing): add spoofing
* feat(Spoofing): prepare code for player attach
* remove(PlayerAttach): isn't going to work due to netsync architecture
* fix(GUI): fix scaling
* feat(Project): add clang-format file
* feat(Classes): update classes
* fix(BlackHole): remove unnecessary cleanup
* fix(Formatting): fix formatting for initializer lists
* feat(clang-format): Set tab width and 1 space before comment

Co-authored-by: Yimura <24669514+Yimura@users.noreply.github.com>
2023-03-01 21:27:15 +00:00

71 lines
1.9 KiB
C++

#include "backend/looped_command.hpp"
#include "core/data/ptfx_effects.hpp"
#include "gta/enums.hpp"
#include "natives.hpp"
namespace big
{
class ptfx_looped : looped_command
{
using looped_command::looped_command;
PedBones ptfx_ped_bones[5] = {PedBones::SKEL_Head, PedBones::SKEL_L_Hand, PedBones::SKEL_R_Hand, PedBones::SKEL_L_Foot, PedBones::SKEL_R_Foot};
const char* ptfx_vehicle_pos[4] = {"wheel_lf", "wheel_lr", "wheel_rf", "wheel_rr"};
void show_player_ptfx_effect(const char* fx_name, const char* name)
{
STREAMING::REQUEST_NAMED_PTFX_ASSET(fx_name);
for (const auto& ptfx_bone : ptfx_ped_bones)
{
GRAPHICS::USE_PARTICLE_FX_ASSET(fx_name);
GRAPHICS::START_NETWORKED_PARTICLE_FX_NON_LOOPED_ON_PED_BONE(name,
self::ped,
0.f,
0.f,
0.f,
0.f,
0.f,
0.f,
(int)ptfx_bone,
g.self.ptfx_effects.size,
1,
1,
1);
STREAMING::REMOVE_PTFX_ASSET();
}
}
void show_vehicle_ptfx_effect(const char* fx_name, const char* name)
{
for (const auto& ptfx_bone : ptfx_vehicle_pos)
{
GRAPHICS::USE_PARTICLE_FX_ASSET(fx_name);
Vector3 bone_pos = ENTITY::GET_WORLD_POSITION_OF_ENTITY_BONE(self::veh, ENTITY::GET_ENTITY_BONE_INDEX_BY_NAME(self::veh, ptfx_bone));
GRAPHICS::START_NETWORKED_PARTICLE_FX_NON_LOOPED_AT_COORD(name,
bone_pos.x,
bone_pos.y,
bone_pos.z,
0.f,
0.f,
0.f,
g.self.ptfx_effects.size,
0.f,
0.f,
0.f,
0);
}
}
virtual void on_tick() override
{
if (self::veh == 0)
show_player_ptfx_effect(g.self.ptfx_effects.asset, g.self.ptfx_effects.effect);
else
show_vehicle_ptfx_effect(g.self.ptfx_effects.asset, g.self.ptfx_effects.effect);
}
};
ptfx_looped g_ptfx_looped("ptfx", "Enable PTFX", "Show nice PTFX Effects on your character", g.self.ptfx_effects.show);
}