wip(SuperSprint): Added sky diving to super sprint

This commit is contained in:
Yimura 2021-01-03 22:14:06 +01:00
parent b5b495b558
commit 35bff8dae9
No known key found for this signature in database
GPG Key ID: 54EFAD29393A6E78

View File

@ -3,6 +3,7 @@
namespace big namespace big
{ {
static bool bLastSuperSprint = false; static bool bLastSuperSprint = false;
static bool bSkyDiving = false;
void features::super_sprint() void features::super_sprint()
{ {
@ -12,12 +13,25 @@ namespace big
{ {
QUEUE_JOB_BEGIN_CLAUSE(= ) QUEUE_JOB_BEGIN_CLAUSE(= )
{ {
if (TASK::IS_PED_SPRINTING(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_playerId))) Ped player = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_playerId);
{ Vector3 location = ENTITY::GET_ENTITY_COORDS(player, true);
Ped player = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_playerId); float ground;
MISC::GET_GROUND_Z_FOR_3D_COORD(location.x, location.y, location.z, &ground, 0, 0);
bool flying = location.z - ground > 3;
if (flying && !bSkyDiving)
{
TASK::TASK_SKY_DIVE(player, true);
bSkyDiving = true;
}
else if (!flying && bSkyDiving)
bSkyDiving = false;
if (TASK::IS_PED_SPRINTING(player) || flying)
{
Vector3 offset = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(player, 0, 0.6, 0); Vector3 offset = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(player, 0, 0.6, 0);
ENTITY::APPLY_FORCE_TO_ENTITY(player, 1, 0.0f, 1.3, 0, 0.0f, 0.0f, 0.0f, 0, 1, 1, 1, 0, 1); ENTITY::APPLY_FORCE_TO_ENTITY(player, 1, 0.0f, 1.3, bSkyDiving ? 1.f : 0.f, 0.0f, 0.0f, 0.0f, 0, 1, 1, 1, 0, 1);
PLAYER::SET_PLAYER_SPRINT(g_playerId, 1); PLAYER::SET_PLAYER_SPRINT(g_playerId, 1);
PLAYER::SET_RUN_SPRINT_MULTIPLIER_FOR_PLAYER(g_playerId, 1.49); PLAYER::SET_RUN_SPRINT_MULTIPLIER_FOR_PLAYER(g_playerId, 1.49);