IMG

 
IMG
IMG   IMG
  Welcome to GTAForums! Be sure to check out the Grand Theft Auto V Forum.

You are not registered! (If you are, click here to login) Registering is fast, free and easy and allows you to instantly reply to any topic on GTAForums.
Why wait? Click here to register your own unique username and become part of the ever-growing community!


( Log In | Register | Revalidate Validation E-mail )
Quick Log-In:
  IMG
       
>
Forum Rules GTA Modification Forums

Please post mod releases in the Mod Showroom

GTAGarage.com
free mod hosting from GTANet, simply login with your GTAForums account details

GTAModding.com
GTANet's modding wiki

GTA Modding Chatroom
provided by irc.gtanet.com (Don't have an IRC client? Click here)


Pages: (2) [1] 2   ( Go to first unread post ) Reply to this topicStart new topicStart Poll

 [NEED HELP] Scripting an Infinite Health mod

 Problem with toggleable
 
SamJohnson98  
Posted: Tuesday, Jun 19 2012, 08:22
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Jan 13, 2012

XXXXX



I'm having a hard time trying to make a script for Infinite Health script can be toggled on/off. I've examined some mods but it have some problem. The mod will make infinite health disable if it had to load things while playing like when using teleport to marker mod, it will disable the infinite health mod. I hate this. Please, I need someone's help. Thanks.
PM
  Top
 

 
oksa8  
Posted: Tuesday, Jun 19 2012, 09:45
Quote Post


Just call me Oksu
Group Icon
Group: Members
Joined: Sep 30, 2010

sf.gif

Member Award




Maybe you should try this:

When you press a key, it would toggle a variable from 0 to 1, and when pressed again, from 1 to 0. When the variable is 0, then the script only waits for keypress-command, and when it's 1, it'll wait for keypress AND run "infinite health"-code at same time.

By the way, you should always tell for what game you are scripting, and if it's not a huge secret, also post the script.

This post has been edited by oksa8 on Tuesday, Jun 19 2012, 09:48
Users WebsitePM
  Top
 

 
1998gtasa  
Posted: Wednesday, Jun 20 2012, 00:20
Quote Post


Rat
Group Icon
Group: Members
Joined: Jun 14, 2012

XXXXX



If u r playing on pc, then just type in BAGUVIX so that u dont die if ur shot or burnt but if the car hits u or u fall down a building, nothing can help u other than a parachute. smile.gif biggrin.gif sigh.gif colgate.gif icon14.gif
PM
  Top
 

 
SamJohnson98  
Posted: Wednesday, Jun 20 2012, 14:53
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Jan 13, 2012

XXXXX



@oksa8

I'm trying to make this for GTA-SA. I don't quite get what are you trying to say.

@1998gtasa

I know about the cheats 'cause I used to always use cheat when playin' the game. Thanks anyways.
PM
  Top
 

 
arijitsen  
Posted: Wednesday, Jun 20 2012, 15:10
Quote Post


Modder,Gamer & GFX Artist
Group Icon
Group: Members
Joined: Jun 19, 2012

ia.gif

XXXXX



QUOTE (SamJohnson98 @ Tuesday, Jun 19 2012, 08:22)
I'm having a hard time trying to make a script for Infinite Health script can be toggled on/off. I've examined some mods but it have some problem. The mod will make infinite health disable if it had to load things while playing like when using teleport to marker mod, it will disable the infinite health mod. I hate this. Please, I need someone's help. Thanks.

Try to use two key presses ,one for making infinite health mod on & other for making infinite health mod off.
I hope this will solve your problem if it does not then provide the complete script then only it is possible to help you .
icon14.gif sarcasm.gif notify.gif cool.gif
Users WebsitePM
  Top
 

 
JACK JONES  
Posted: Wednesday, Jun 20 2012, 15:28
Quote Post


Booom!!!
Group Icon
Group: Members
Joined: Dec 6, 2011

sr.gif

XXXXX



If I understand correctly you want to manipulate with a players immortality by using keys right? Maybe this could help:
CODE
{$CLEO .cs}
thread 'JACK'

:1
wait 500  (keys are sensitive so it's better to put number higher then 0)
if and (if and for more then 1 conditions - if the 2 keys are pressed at the same time)
00E1:   player 0 pressed_key 13  (camera key)
00E1:   player 0 pressed_key 18  (crouch key)
jf @1
02AB: set_actor $PLAYER_ACTOR immunities  1  1  1  1  1    (PLAYER is now immortal)

:2
wait 500
if and
00E1:   player 0 pressed_key 6   (aim key)
00E1:   player 0 pressed_key 18  (crouch key)
jf @2
02AB: set_actor $PLAYER_ACTOR immunities  0  0  0  0  0   (PLAYER is NOT immortal)
jump @1  (repeat operation)
PM
  Top
 

 
SamJohnson98  
Posted: Wednesday, Jun 20 2012, 15:39
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Jan 13, 2012

XXXXX



CODE
// This file was decompiled using sascm.ini published by Seemann (http://sannybuilder.com/files/SASCM.rar) on 13.10.2007

{$VERSION 3.1.0027}
{$CLEO .cs}

//-------------MAIN---------------
0000: NOP

:NONAME_2
0001: wait 0 ms
00D6: if
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @NONAME_2
0AB0:  key_pressed 17
0AB0:  key_pressed 89
004D: jump_if_false @NONAME_2
02AB: set_actor $PLAYER_ACTOR immunities BP 1 FP 1 EP 1 CP 1 MP 1
00BC: show_text_highpriority GXT 'GMOD' time 3000 flag 1

:NONAME_4
0001: wait 0 ms
00D6: if
0AB0:  key_pressed 17
0AB0:  key_pressed 85
004D: jump_if_false @NONAME_4
02AB: set_actor $PLAYER_ACTOR immunities BP 0 FP 0 EP 0 CP 0 MP 0
00BC: show_text_highpriority GXT 'GMODD' time 3000 flag 1
0002: jump @NONAME_2


If I use this, it can't be disabled. It's disabled but my health won't go down.

CODE
:NONAME_59
wait 0
if
0256:   player $PLAYER_CHAR defined
else_jump @NONAME_59
if and
0AB0:   key_pressed 9
0AB0:   key_pressed 71
else_jump @NONAME_59
Actor.Health($PLAYER_ACTOR) = 250
Actor.Armour($PLAYER_ACTOR) = 250
Actor.SetImmunities($PLAYER_ACTOR, 1, 1, 1, 1, 1)
03E5: show_text_box 'GMOD'
jump @NONAME_147

:NONAME_147
wait 0
if and
0AB0:   key_pressed 9
0AB0:   key_pressed 72
else_jump @NONAME_147
Actor.SetImmunities($PLAYER_ACTOR, 0, 0, 0, 0, 0)
03E5: show_text_box 'GMODD'
jump @NONAME_59


On the other hand, if use this it will disable the infinite health by itself if you load the game like enter any safe house.

PM
  Top
 

 
arijitsen  
Posted: Wednesday, Jun 20 2012, 15:49
Quote Post


Modder,Gamer & GFX Artist
Group Icon
Group: Members
Joined: Jun 19, 2012

ia.gif

XXXXX



QUOTE (SamJohnson98 @ Wednesday, Jun 20 2012, 15:39)
CODE
// This file was decompiled using sascm.ini published by Seemann (http://sannybuilder.com/files/SASCM.rar) on 13.10.2007

{$VERSION 3.1.0027}
{$CLEO .cs}

//-------------MAIN---------------
0000: NOP

:NONAME_2
0001: wait 0 ms
00D6: if
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @NONAME_2
0AB0:  key_pressed 17
0AB0:  key_pressed 89
004D: jump_if_false @NONAME_2
02AB: set_actor $PLAYER_ACTOR immunities BP 1 FP 1 EP 1 CP 1 MP 1
00BC: show_text_highpriority GXT 'GMOD' time 3000 flag 1

:NONAME_4
0001: wait 0 ms
00D6: if
0AB0:  key_pressed 17
0AB0:  key_pressed 85
004D: jump_if_false @NONAME_4
02AB: set_actor $PLAYER_ACTOR immunities BP 0 FP 0 EP 0 CP 0 MP 0
00BC: show_text_highpriority GXT 'GMODD' time 3000 flag 1
0002: jump @NONAME_2


If I use this, it can't be disabled. It's disabled but my health won't go down.

CODE
:NONAME_59
wait 0
if
0256:   player $PLAYER_CHAR defined
else_jump @NONAME_59
if and
0AB0:   key_pressed 9
0AB0:   key_pressed 71
else_jump @NONAME_59
Actor.Health($PLAYER_ACTOR) = 250
Actor.Armour($PLAYER_ACTOR) = 250
Actor.SetImmunities($PLAYER_ACTOR, 1, 1, 1, 1, 1)
03E5: show_text_box 'GMOD'
jump @NONAME_147

:NONAME_147
wait 0
if and
0AB0:   key_pressed 9
0AB0:   key_pressed 72
else_jump @NONAME_147
Actor.SetImmunities($PLAYER_ACTOR, 0, 0, 0, 0, 0)
03E5: show_text_box 'GMODD'
jump @NONAME_59


On the other hand, if use this it will disable the infinite health by itself if you load the game like enter any safe house.

Try this code :
0A95: enable_thread_saving
If any doubt reply .Hope that this will work i haven't tried it.If it works reply me
Users WebsitePM
  Top
 

 
SamJohnson98  
Posted: Wednesday, Jun 20 2012, 15:51
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Jan 13, 2012

XXXXX



Where am I suppose to add that? And I think that is for something else.
PM
  Top
 

 
SamJohnson98  
Posted: Wednesday, Jun 20 2012, 15:54
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Jan 13, 2012

XXXXX



QUOTE (JACK JONES @ Wednesday, Jun 20 2012, 15:28)
If I understand correctly you want to manipulate with a players immortality by using keys right? Maybe this could help:
CODE
{$CLEO .cs}
thread 'JACK'

:1
wait 500  (keys are sensitive so it's better to put number higher then 0)
if and (if and for more then 1 conditions - if the 2 keys are pressed at the same time)
00E1:   player 0 pressed_key 13  (camera key)
00E1:   player 0 pressed_key 18  (crouch key)
jf @1
02AB: set_actor $PLAYER_ACTOR immunities  1  1  1  1  1    (PLAYER is now immortal)

:2
wait 500
if and
00E1:   player 0 pressed_key 6   (aim key)
00E1:   player 0 pressed_key 18  (crouch key)
jf @2
02AB: set_actor $PLAYER_ACTOR immunities  0  0  0  0  0   (PLAYER is NOT immortal)
jump @1  (repeat operation)

Thanks, but I tried this and didn't work for some reason.
PM
  Top
 

 
arijitsen  
Posted: Wednesday, Jun 20 2012, 15:56
Quote Post


Modder,Gamer & GFX Artist
Group Icon
Group: Members
Joined: Jun 19, 2012

ia.gif

XXXXX



QUOTE (SamJohnson98 @ Wednesday, Jun 20 2012, 15:51)
Where am I suppose to add that? And I think that is for something else.

:NONAME_1
0A95: enable_thread_saving
:NONAME_59
wait 0
if
0256: player $PLAYER_CHAR defined
else_jump @NONAME_59
if and
0AB0: key_pressed 9
0AB0: key_pressed 71
else_jump @NONAME_59
Actor.Health($PLAYER_ACTOR) = 250
Actor.Armour($PLAYER_ACTOR) = 250
Actor.SetImmunities($PLAYER_ACTOR, 1, 1, 1, 1, 1)
03E5: show_text_box 'GMOD'
jump @NONAME_147

:NONAME_147
wait 0
if and
0AB0: key_pressed 9
0AB0: key_pressed 72
else_jump @NONAME_147
Actor.SetImmunities($PLAYER_ACTOR, 0, 0, 0, 0, 0)
03E5: show_text_box 'GMODD'
jump @NONAME_59









Hope this will solve your problem .I have not tried it .If it works then reply me if any doubts still reply me . icon14.gif monocle.gif
Users WebsitePM
  Top
 

 
SamJohnson98  
Posted: Thursday, Jun 21 2012, 06:51
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Jan 13, 2012

XXXXX



Still not working. sad.gif Thanks though. smile.gif
PM
  Top
 

 
JACK JONES  
Posted: Thursday, Jun 21 2012, 09:33
Quote Post


Booom!!!
Group Icon
Group: Members
Joined: Dec 6, 2011

sr.gif

XXXXX



CODE
{$CLEO .cs}
03A4: name_thread 'Jack'

:GSB
wait 0
gosub @1
gosub @2
jump @GSB

:1
wait 0
if and
00E1:   player 0 pressed_key 13
00E1:   player 0 pressed_key 18  
jf @R1
02AB: set_actor $PLAYER_ACTOR immunities 1 1 1 1 1

:R1
wait 0
return

:2
wait 0
if and
00E1:   player 0 pressed_key 6  
00E1:   player 0 pressed_key 18  
jf @R2
02AB: set_actor $PLAYER_ACTOR immunities 0 0 0 0 0

:R2
wait 0
return
It's not perfect but it's nearly as you want. Now after saving and loading if you press these keys they will activate (or deactivate) GOD mod - it's tested. However if you don't press them after saving or loading the player will be mortal. I can't explain why 0A95 opcode doesn't fix saving problem and that's really killing me. If anyone knows I would appreciate if he tells me.
PM
  Top
 

 
msKEN  
Posted: Thursday, Jun 21 2012, 10:13
Quote Post


Player Hater
Group Icon
Group: BUSTED!
Joined: Jun 20, 2012

us.gif

XXXXX



Using This . is work and pleasse learn tutorial sneaky2.gif

CODE

{$CLEO .cs}

03A4: name_thread 'KEN'

:ENABLE
0001: wait 0 ms
if
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @ENABLE
if and
00E1:   player 0 pressed_key 13
00E1:   player 0 pressed_key 18  
004D: jump_if_false @ENABLE
0A8C: write_memory 0x96916D size 1 value 1 virtual_protect 0  // >>---  Infinite Health [ USE 1 TO ENABLE ]

:DISABLE
0001: wait 0 ms
if
0256:   player $PLAYER_CHAR defined
004D: jump_if_false @DISABLE
if and
00E1:   player 0 pressed_key 13
00E1:   player 0 pressed_key 18  
004D: jump_if_false @DISABLE
0A8C: write_memory 0x96916D size 1 value 0 virtual_protect 0  // >>---  Infinite Health [ USE 0 TO DISABLE ]
0002: jump @ENABLE
Users WebsitePM
  Top
 

 
JACK JONES  
Posted: Thursday, Jun 21 2012, 10:25
Quote Post


Booom!!!
Group Icon
Group: Members
Joined: Dec 6, 2011

sr.gif

XXXXX



The fact that your code isn't working on my PC tells me that you either don't know how to find the mem add OR you are using illegal copy of the game.
QUOTE
pleasse learn tutorial
Bwahahahahahahahahahaha!!! Great sense of humor!
PM
  Top
 

 
msKEN  
Posted: Thursday, Jun 21 2012, 10:31
Quote Post


Player Hater
Group Icon
Group: BUSTED!
Joined: Jun 20, 2012

us.gif

XXXXX



QUOTE (JACK JONES @ Thursday, Jun 21 2012, 10:25)
The fact that your code isn't working on my PC tells me that you either don't know how to find the mem add OR you are using illegal copy of the game.
QUOTE
pleasse learn tutorial
Bwahahahahahahahahahaha!!! Great sense of humor!

I didn't say you learn tut hhhhhhhhhhhhhhhh .

To : SamJohnson98
Users WebsitePM
  Top
 

 
CK-1999  
Posted: Thursday, Jun 21 2012, 10:36
Quote Post


Rat
Group Icon
Group: Members
Joined: Feb 13, 2011

nl.gif

XXXXX



I would download a decent trainer like crazytrainer pfff... cheats tounge2.gif
PM
  Top
 

 
JACK JONES  
Posted: Thursday, Jun 21 2012, 11:14
Quote Post


Booom!!!
Group Icon
Group: Members
Joined: Dec 6, 2011

sr.gif

XXXXX



To : msKEN
I just find out that your address is working - I didn't notice before because enemies were able to punch the player and push him - sorry about that mate. BUT the player isn't explosion protected with that address - for example if a player is exposed to some stronger explosion he'll be dead - I tested it. My code prevents explosion damage as well (if the keys were pressed).



This post has been edited by JACK JONES on Thursday, Jun 21 2012, 11:40
PM
  Top
 

 
SamJohnson98  
Posted: Friday, Jun 22 2012, 15:17
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Jan 13, 2012

XXXXX



Both script from msKEN and JACK JONES didn't work the way I want it to work. As for CK-1999, I'm using CLEO not trainer 'cause I'm trying to mod the game. Not for fun. If it's done, then I'll play the game.
PM
  Top
 

 
TaBz3  
Posted: Tuesday, Jun 26 2012, 20:00
Quote Post


Player Hater
Group Icon
Group: Members
Joined: May 9, 2012

XXXXX



Set AE5ADA8 (float) to "999999999" (999,999,999) and just loop it each 500ms... or leave it, your choice.
PM
  Top
 

 

0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)

0 Members:

Pages: (2) [1] 2 

Topic Options Reply to this topicStart new topicStart Poll
Search topic for posted by (exact match)



 
IMG IMG