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.
YimMenu/src/backend/commands/player/vehicle/remote_control_vehicle.cpp

30 lines
1001 B
C++

#include "backend/player_command.hpp"
#include "natives.hpp"
#include "pointers.hpp"
#include "util/vehicle.hpp"
namespace big
{
class remote_control_vehicle : player_command
{
using player_command::player_command;
virtual void execute(player_ptr player, const std::vector<uint64_t>& _args, const std::shared_ptr<command_context> ctx)
{
Vehicle veh = PED::GET_VEHICLE_PED_IS_IN(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(player->id()), FALSE);
if (veh == 0)
{
if (g.player.spectating)
g_notification_service->push_warning("Remote Control", "Player not in a vehicle");
else
g_notification_service->push_warning("Remote Control", "Player not in a vehicle, try spectating the player");
return;
}
vehicle::remote_control_vehicle(veh);
g.player.spectating = false;
}
};
remote_control_vehicle g_remote_control_vehicle("rcplayer", "Remote Control Vehicle", "Take control of the player's vehicle. Spectate the player beforehand for best results", 0, false);
}