feat(HornBoost): Don't boost unless driver

This commit is contained in:
Yimura 2021-09-21 13:40:23 +02:00
parent ceb7a03f06
commit bf8816a116

View File

@ -1,7 +1,7 @@
#include "backend/looped/looped.hpp"
#include "gta/enums.hpp"
#include "natives.hpp"
#include "util/math.hpp"
#include "util/entity.hpp"
namespace big
{
@ -11,12 +11,13 @@ namespace big
if (PAD::IS_CONTROL_PRESSED(0, (int)ControllerInputs::INPUT_VEH_HORN))
{
Vehicle veh = PED::GET_VEHICLE_PED_IS_IN(PLAYER::PLAYER_PED_ID(), false);
Ped ped = PLAYER::PLAYER_PED_ID();
Vehicle veh = PED::GET_VEHICLE_PED_IS_IN(ped, false);
if (veh == 0) return;
if (VEHICLE::GET_PED_IN_VEHICLE_SEAT(veh, -1, 0) != ped) return;
Vector3 velocity = ENTITY::GET_ENTITY_VELOCITY(veh) * 1.05f;
ENTITY::SET_ENTITY_VELOCITY(veh, velocity.x, velocity.y, velocity.z - 0.5f);
}
}