Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
ampcard committed Apr 23, 2022
1 parent 118b944 commit 7cdd43d
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 0 deletions.
43 changes: 43 additions & 0 deletions Source/EN/source.sc
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
<title>
Infinite Health Fix
</title>
<author>
Miotto
</author>
<summary>
Fixes the Infinite Health/BAGUVIX cheat so it resets player's health back to max whenever they lose health. This isn't an elegant solution at all.
For some reason, the player's current health is an integer and their max health is a float.
</summary>
<changelog>
23/04/22: 1.0 released.
</changelog>
*/


SCRIPT_START
{
LVAR_INT bIsCheatOn scplayer iPlayerCurrentHealth iPlayerMaxHealth
LVAR_FLOAT fPlayerMaxHealth

GET_PLAYER_CHAR 0 scplayer

WHILE TRUE
WAIT 0
GET_CHAR_MAX_HEALTH scplayer fPlayerMaxHealth // Gets player's max health.
GET_CHAR_HEALTH scplayer iPlayerCurrentHealth // Gets player's current health.
iPlayerMaxHealth =# fPlayerMaxHealth // Converts the player's max health to an integer.

READ_MEMORY 0x96916D 1 FALSE bIsCheatOn // Checks if the Infinite Health cheat is on.
IF bIsCheatOn = 1 // If the cheat is on...
IF (iPlayerCurrentHealth < iPlayerMaxHealth) // And if the player's current health is less than their max health...
SET_CHAR_HEALTH scplayer iPlayerMaxHealth // Resets the player's health back to its max value.
ENDIF
ENDIF
ENDWHILE

}
SCRIPT_END
43 changes: 43 additions & 0 deletions Source/PT/source.sc
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
<title>
Infinite Health Fix
</title>
<author>
Miotto
</author>
<summary>
Corrige o cheat de vida infinita/BAGUVIX para que ele restaure a vida do player ao máximo sempre que ele toma dano. Não é uma solução elegante.
Por algum motivo, a vida máxima é um float e a vida atual é um integer.
</summary>
<changelog>
23/04/22: 1.0 lançado.
</changelog>
*/


SCRIPT_START
{
LVAR_INT bIsCheatOn scplayer iPlayerCurrentHealth iPlayerMaxHealth
LVAR_FLOAT fPlayerMaxHealth

GET_PLAYER_CHAR 0 scplayer

WHILE TRUE
WAIT 0
GET_CHAR_MAX_HEALTH scplayer fPlayerMaxHealth // Pega a vida máxima do player.
GET_CHAR_HEALTH scplayer iPlayerCurrentHealth // Pega a vida atual do player.
iPlayerMaxHealth =# fPlayerMaxHealth // Converte a vida máxima a um integer.

READ_MEMORY 0x96916D 1 FALSE bIsCheatOn // Checa se o cheat de Vida Infinita tá on.
IF bIsCheatOn = 1 // Caso estiver...
IF (iPlayerCurrentHealth < iPlayerMaxHealth) // E a vida atual do player for menor que a vida máxima dele...
SET_CHAR_HEALTH scplayer iPlayerMaxHealth // Restaura a vida atual do player à vida máxima do mesmo.
ENDIF
ENDIF
ENDWHILE

}
SCRIPT_END

0 comments on commit 7cdd43d

Please sign in to comment.