mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2025-06-18 07:07:32 +08:00

Fixed nearby features affecting players and local ped. Removed faulty vehicle kick protection from can_apply Fixes #1540
31 lines
980 B
C++
31 lines
980 B
C++
#include "backend/looped_command.hpp"
|
|
#include "natives.hpp"
|
|
#include "pointers.hpp"
|
|
#include "util/entity.hpp"
|
|
|
|
namespace big
|
|
{
|
|
class ped_rain : looped_command
|
|
{
|
|
using looped_command::looped_command;
|
|
|
|
virtual void on_tick() override
|
|
{
|
|
for (auto ped : entity::get_entities(false, true))
|
|
{
|
|
if (!ENTITY::IS_ENTITY_IN_AIR(ped) && entity::take_control_of(ped, 0) && !PED::IS_PED_A_PLAYER(ped) && ped != self::ped)
|
|
{
|
|
Vector3 my_location = ENTITY::GET_ENTITY_COORDS(self::ped, 1);
|
|
my_location.x = my_location.x + (rand() % 100 + (-50));
|
|
my_location.y = my_location.y + (rand() % 100 + (-50));
|
|
my_location.z = my_location.z + (rand() % 50 + 50);
|
|
ENTITY::SET_ENTITY_COORDS(ped, my_location.x, my_location.y, my_location.z, 0, 0, 0, 0);
|
|
ENTITY::SET_ENTITY_VELOCITY(ped, 0.0, 0.0, -1.0);
|
|
}
|
|
}
|
|
}
|
|
};
|
|
|
|
ped_rain g_ped_rain("pedrain", "Rain Peds", "Will pour down and rain nearby peds", g.world.nearby.ped_rain);
|
|
|
|
} |