TmpMenu/src/backend/looped/vehicle/keep_on_ground.cpp
maybegreat48 ac508dfd61 Bug fixes and improvements (#984)
* feat(KickFromInterior): improve kick from interior

Fixes #968
Fixes #953
Fixes #901
Fixes #899
Fixes #813
Fixes #726
Fixes #723

Co-authored-by: Yimura <24669514+Yimura@users.noreply.github.com>
2023-02-13 20:38:30 +00:00

22 lines
623 B
C++

#include "natives.hpp"
#include "backend/looped_command.hpp"
namespace big
{
class keep_on_ground : looped_command
{
using looped_command::looped_command;
virtual void on_tick() override
{
auto model = ENTITY::GET_ENTITY_MODEL(self::veh);
if (ENTITY::IS_ENTITY_IN_AIR(self::veh) &&
(VEHICLE::IS_THIS_MODEL_A_CAR(model) ||
VEHICLE::IS_THIS_MODEL_A_BIKE(model)))
VEHICLE::SET_VEHICLE_ON_GROUND_PROPERLY(self::veh, 5.0);
}
};
keep_on_ground g_keep_on_ground("keeponground", "Keep On Ground", "Makes it so your vehicle is always on the ground on all four wheels", g.vehicle.keep_on_ground);
}