Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// by Junior_Djjr - MixMods.com.br
// You need: https://forum.mixmods.com.br/f16-utilidades/t179-gta3script-while-true-return_true-e-return_false
SCRIPT_START
{
LVAR_INT scplayer p damage useIngnoreAnim
LVAR_FLOAT playerFallSpeed iniDamageMult
LVAR_TEXT_LABEL16 iniIgnoreAnim
GET_PLAYER_CHAR 0 scplayer
READ_FLOAT_FROM_INI_FILE "Water Hurt.ini" "Settings" "DamageMult" iniDamageMult
iniDamageMult *= -1.0
IF READ_STRING_FROM_INI_FILE "Water Hurt.ini" "Settings" "IgnoreAnim" iniIgnoreAnim
useIngnoreAnim = TRUE
ENDIF
WHILE TRUE
WAIT 0
IF NOT IS_CHAR_DEAD scplayer
IF playerFallSpeed < -0.4
IF IS_CHAR_IN_WATER scplayer
playerFallSpeed *= iniDamageMult
damage =# playerFallSpeed
IF damage > 5
IF useIngnoreAnim = TRUE
IF NOT IS_CHAR_PLAYING_ANIM scplayer $iniIgnoreAnim
GOSUB DamageChar
ENDIF
ELSE
GOSUB DamageChar
ENDIF
ENDIF
ENDIF
ENDIF
playerFallSpeed = 0.0 // reset next fall speed
//IF IS_CHAR_IN_AIR scplayer // return false using parachute
GET_PED_POINTER scplayer p
p += 0x4C //m_vecMoveSpeed.z
READ_MEMORY p 4 FALSE (playerFallSpeed)
//ENDIF
ENDIF
ENDWHILE
DamageChar:
DAMAGE_CHAR scplayer damage FALSE
//PRINT_FORMATTED_NOW "damage %i" 2000 damage
WAIT 1000 // delay to avoid being damaged more than 1 frame
RETURN
}
SCRIPT_END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.