Last active
December 30, 2021 17:07
-
-
Save SunShineSilver-mdA/9797eedfa06a8ef9456003a0bc0a2565 to your computer and use it in GitHub Desktop.
GTA5 freemode.c suicide
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void func_8333() | |
{ | |
int iVar0; | |
if (Global_1312416.f_6 == 1) | |
{ | |
if (func_12095(PLAYER::PLAYER_ID(), 1, 1)) | |
{ | |
if ((func_504() || func_8350()) || STREAMING::IS_PLAYER_SWITCH_IN_PROGRESS()) | |
{ | |
func_8346(); | |
return; | |
} | |
func_8345(); | |
func_8343(); | |
if (!MISC::IS_BIT_SET(Global_2436641.f_1194.f_4, 0) || PED::IS_PED_RAGDOLL(PLAYER::PLAYER_PED_ID())) | |
{ | |
if ((((PED::IS_PED_IN_ANY_VEHICLE(PLAYER::PLAYER_PED_ID(), 0) || func_3300(PLAYER::PLAYER_PED_ID(), 0)) || PED::IS_PED_RAGDOLL(PLAYER::PLAYER_PED_ID())) || ENTITY::IS_ENTITY_IN_AIR(PLAYER::PLAYER_PED_ID())) || !PLAYER::IS_PLAYER_FREE_FOR_AMBIENT_TASK(PLAYER::PLAYER_ID())) | |
{ | |
ENTITY::CLEAR_ENTITY_LAST_DAMAGE_ENTITY(PLAYER::PLAYER_PED_ID()); | |
func_8341(); | |
func_8338(); | |
func_8337(); | |
func_8336(); | |
MISC::SET_BIT(&(Global_2436641.f_1194.f_4), 5); | |
return; | |
} | |
} | |
if (func_8335()) | |
{ | |
if (!MISC::IS_BIT_SET(Global_2436641.f_1194.f_4, 0)) | |
{ | |
if (((((((((WEAPON::HAS_PED_GOT_WEAPON(PLAYER::PLAYER_PED_ID(), joaat("weapon_pistol"), 0) || WEAPON::HAS_PED_GOT_WEAPON(PLAYER::PLAYER_PED_ID(), joaat("weapon_pistol_mk2"), 0)) && (WEAPON::GET_AMMO_IN_PED_WEAPON(PLAYER::PLAYER_PED_ID(), joaat("weapon_pistol")) > 0 || WEAPON::GET_AMMO_IN_PED_WEAPON(PLAYER::PLAYER_PED_ID(), joaat("weapon_pistol_mk2")) > 0)) && !WEAPON::HAS_PED_GOT_WEAPON_COMPONENT(PLAYER::PLAYER_PED_ID(), joaat("weapon_pistol"), joaat("component_at_pi_supp_02"))) && !func_1852(PLAYER::PLAYER_ID(), 1, 0)) && !func_2009()) && !func_7956(PLAYER::PLAYER_PED_ID())) && !func_1493()) && INTERIOR::GET_ROOM_KEY_FROM_ENTITY(PLAYER::PLAYER_PED_ID()) != MISC::GET_HASH_KEY("YachtRm_Bridge")) && !func_8334()) | |
{ | |
if (WEAPON::HAS_PED_GOT_WEAPON(PLAYER::PLAYER_PED_ID(), joaat("weapon_pistol"), 0)) | |
{ | |
WEAPON::SET_CURRENT_PED_WEAPON(PLAYER::PLAYER_PED_ID(), joaat("weapon_pistol"), true); | |
} | |
else if (WEAPON::HAS_PED_GOT_WEAPON(PLAYER::PLAYER_PED_ID(), joaat("weapon_pistol_mk2"), 0)) | |
{ | |
WEAPON::SET_CURRENT_PED_WEAPON(PLAYER::PLAYER_PED_ID(), joaat("weapon_pistol_mk2"), true); | |
} | |
StringCopy(&(Global_2436641.f_1194), "PISTOL", 16); | |
MISC::SET_BIT(&(Global_2436641.f_1194.f_4), 1); | |
Global_2436641.f_1194.f_5 = 0.365f; | |
} | |
else | |
{ | |
WEAPON::SET_CURRENT_PED_WEAPON(PLAYER::PLAYER_PED_ID(), joaat("weapon_unarmed"), true); | |
StringCopy(&(Global_2436641.f_1194), "PILL", 16); | |
Global_2436641.f_1194.f_5 = 0.536f; | |
} | |
BRAIN::TASK_PLAY_ANIM(PLAYER::PLAYER_PED_ID(), "MP_SUICIDE", &(Global_2436641.f_1194), 8f, -8f, -1, 270540800, 0, 0, 0, 0); | |
MISC::SET_BIT(&(Global_2436641.f_1194.f_4), 0); | |
} | |
else if (ENTITY::IS_ENTITY_PLAYING_ANIM(PLAYER::PLAYER_PED_ID(), "MP_SUICIDE", &(Global_2436641.f_1194), 3)) | |
{ | |
if (!MISC::IS_BIT_SET(Global_2436641.f_1194.f_4, 2)) | |
{ | |
if (ENTITY::HAS_ANIM_EVENT_FIRED(PLAYER::PLAYER_PED_ID(), MISC::GET_HASH_KEY("Fire"))) | |
{ | |
ENTITY::CLEAR_ENTITY_LAST_DAMAGE_ENTITY(PLAYER::PLAYER_PED_ID()); | |
iVar0 = func_1870(PLAYER::PLAYER_PED_ID()); | |
if (iVar0 == joaat("weapon_pistol") || iVar0 == joaat("weapon_pistol_mk2")) | |
{ | |
PED::SET_PED_SHOOTS_AT_COORD(PLAYER::PLAYER_PED_ID(), 0f, 0f, 0f, 0); | |
} | |
MISC::SET_BIT(&(Global_2436641.f_1194.f_4), 2); | |
} | |
} | |
if (ENTITY::GET_ENTITY_ANIM_CURRENT_TIME(PLAYER::PLAYER_PED_ID(), "MP_SUICIDE", &(Global_2436641.f_1194)) > Global_2436641.f_1194.f_5) | |
{ | |
PED::SET_PED_TO_RAGDOLL(PLAYER::PLAYER_PED_ID(), 0, 250, 0, 0, 0, 0); | |
ENTITY::CLEAR_ENTITY_LAST_DAMAGE_ENTITY(PLAYER::PLAYER_PED_ID()); | |
func_8341(); | |
func_8338(); | |
func_8337(); | |
func_8336(); | |
MISC::SET_BIT(&(Global_2436641.f_1194.f_4), 5); | |
func_8346(); | |
} | |
} | |
else | |
{ | |
PED::SET_PED_TO_RAGDOLL(PLAYER::PLAYER_PED_ID(), 0, 250, 0, 0, 0, 0); | |
ENTITY::CLEAR_ENTITY_LAST_DAMAGE_ENTITY(PLAYER::PLAYER_PED_ID()); | |
func_8341(); | |
func_8338(); | |
func_8337(); | |
func_8336(); | |
MISC::SET_BIT(&(Global_2436641.f_1194.f_4), 5); | |
func_8346(); | |
} | |
} | |
} | |
else | |
{ | |
func_8346(); | |
} | |
} | |
} | |
int func_8334() | |
{ | |
return 0; | |
} | |
int func_8335() | |
{ | |
STREAMING::REQUEST_ANIM_DICT("MP_SUICIDE"); | |
if (STREAMING::HAS_ANIM_DICT_LOADED("MP_SUICIDE")) | |
{ | |
return 1; | |
} | |
return 0; | |
} | |
void func_8336() | |
{ | |
if (func_4777(PLAYER::PLAYER_ID(), 1)) | |
{ | |
MISC::SET_BIT(&(Global_2436641.f_1194.f_4), 4); | |
} | |
} | |
void func_8337() | |
{ | |
struct<14> Var0; | |
Var0.f_2 = -1679861191; | |
Var0.f_10 = PLAYER::PLAYER_ID(); | |
func_4440(Var0, func_52(0, 1)); | |
} | |
void func_8338() | |
{ | |
int iVar0; | |
int iVar1; | |
vector3 vVar2; | |
var uVar3; | |
iVar0 = (MISC::GET_GAME_TIMER() - Global_262145.f_22848); | |
iVar1 = 0; | |
if (Global_1622537 != -1) | |
{ | |
if (func_12095(PLAYER::INT_TO_PLAYERINDEX(Global_1622537), 1, 1)) | |
{ | |
vVar2 = {ENTITY::GET_ENTITY_COORDS(PLAYER::GET_PLAYER_PED(PLAYER::INT_TO_PLAYERINDEX(Global_1622537)), true)}; | |
} | |
} | |
if (Global_1622537 != -1) | |
{ | |
if (Global_1622538 != -1) | |
{ | |
if (Global_1622538 > iVar0) | |
{ | |
if (!func_42(vVar2)) | |
{ | |
if (MISC::GET_DISTANCE_BETWEEN_COORDS(ENTITY::GET_ENTITY_COORDS(PLAYER::PLAYER_PED_ID(), true), vVar2, true) <= Global_262145.f_22849) | |
{ | |
iVar1 = PLAYER::GET_PLAYER_PED(PLAYER::INT_TO_PLAYERINDEX(Global_1622537)); | |
} | |
} | |
} | |
} | |
} | |
ENTITY::SET_ENTITY_HEALTH(PLAYER::PLAYER_PED_ID(), 0, iVar1); | |
uVar3 = func_8340(); | |
if (iVar1 != 0) | |
{ | |
Global_2436641.f_1888.f_804 = 1; | |
uVar3 = func_8339(); | |
func_13754(-1236291856); | |
} | |
else | |
{ | |
Global_2436641.f_1888.f_804 = 1; | |
} | |
STATS::_0x428EAF89E24F6C36(uVar3, 1f); | |
} | |
int func_8339() | |
{ | |
if (func_520() == 1) | |
{ | |
return joaat("mp1_deaths_player"); | |
} | |
return joaat("mp0_deaths_player"); | |
} | |
int func_8340() | |
{ | |
if (func_520() == 1) | |
{ | |
return joaat("mp1_deaths"); | |
} | |
return joaat("mp0_deaths"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment