2023-03-04 11:23:45 +00:00
|
|
|
#include "backend/player_command.hpp"
|
|
|
|
#include "natives.hpp"
|
|
|
|
#include "pointers.hpp"
|
|
|
|
#include "util/teleport.hpp"
|
|
|
|
|
|
|
|
namespace big
|
|
|
|
{
|
|
|
|
class smash_windows : player_command
|
|
|
|
{
|
|
|
|
using player_command::player_command;
|
|
|
|
|
2023-08-01 11:10:14 +02:00
|
|
|
virtual void execute(player_ptr player, const command_arguments& _args, const std::shared_ptr<command_context> ctx) override
|
2023-03-04 11:23:45 +00:00
|
|
|
{
|
|
|
|
Ped ped = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(player->id());
|
|
|
|
if (PED::IS_PED_IN_ANY_VEHICLE(ped, false))
|
|
|
|
{
|
2023-06-06 07:40:40 +00:00
|
|
|
Vehicle vehicle = PED::GET_VEHICLE_PED_IS_IN(ped, false);
|
|
|
|
|
|
|
|
if (entity::take_control_of(vehicle))
|
2023-03-04 11:23:45 +00:00
|
|
|
{
|
2023-06-06 07:40:40 +00:00
|
|
|
int window = 0;
|
|
|
|
|
|
|
|
for (window = 0; window < 8; window++)
|
|
|
|
{
|
|
|
|
VEHICLE::SMASH_VEHICLE_WINDOW(vehicle, window);
|
|
|
|
}
|
2023-03-04 11:23:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2023-10-20 12:24:44 -04:00
|
|
|
smash_windows g_smash_windows("smashwindows", "BACKEND_SMASH_VEHICLE_WINDOWS", "BACKEND_SMASH_VEHICLE_WINDOWS_DESC", 0);
|
2023-03-04 11:23:45 +00:00
|
|
|
}
|