Quantcast

Jump to content

» «
Photo

Activate a cheatcode through script. Possible?

6 replies to this topic
pjratekjng
  • pjratekjng

    Player Hater

  • Members
  • Joined: 27 Jan 2010

#1

Posted 24 October 2013 - 06:26 PM

Hello.

 

This one hopefully is basic enough for an intelligent  yes or no response. I'm trying to find a way to activate specific cheatcodes through a cleo script. I've searched for specific op-codes, yet all I could find is 

 

0445:   improved_handling_cheat_used 
 
which isn't much use at all. I want the flying car cheat RIPAZHA to be activated as I enter certain cars, and deactivated as I exit. Possible? :monocle:  Thank you in advance for your response.
 
]|[
PjrateKjng

Silent
  • Silent

    Moderating Cookie Monster

  • Feroci
  • Joined: 01 Feb 2010
  • Poland
  • Contribution Award [Mods]
    Best Script/Plugin 2014 [SilentPatch]
    Most Respected 2014
    Most Helpful [Mods] 2014
    Most Helpful [GTA] 2013
    Most Helpful [Mods] 2013
    Most Talented [Modding] 2013
    Best Map 2013 [ViceCityStories PC Edition]
    Best Vehicle 2013 [III Aircraft]
    Most Helpful [Mods] 2012
    Modder of the Year 2012

#2

Posted 24 October 2013 - 07:05 PM

You may find this list helpful:

http://gtag.gtagamin...andreas/cheats/

xNCx
  • xNCx

    Street Cat

  • Members
  • Joined: 15 May 2008
  • None

#3

Posted 24 October 2013 - 07:45 PM

Just to explain a little bit. In some memory addresses there are switches like 0 = off, 1 = on. Get the memory address of the cheat you want, check how it works, and then you can overwrite a memory address using CLEO.


pjratekjng
  • pjratekjng

    Player Hater

  • Members
  • Joined: 27 Jan 2010

#4

Posted 24 October 2013 - 08:08 PM

You may find this list helpful:

http://gtag.gtagamin...andreas/cheats/

 

Thanks a lot bro

 

 

Just to explain a little bit. In some memory addresses there are switches like 0 = off, 1 = on. Get the memory address of the cheat you want, check how it works, and then you can overwrite a memory address using CLEO.

 

So what would a typical string for the RIPAZHA cheat look like? This is the hash:

 

0xFA8DD45B

 

I'm trying to find a way to turn it on and off at different times


Wesser
  • Wesser

    The complexity simplifier, the efficiency optimizer.

  • Feroci
  • Joined: 19 Aug 2006
  • Unknown
  • Contribution Award [Mods]

#5

Posted 24 October 2013 - 10:14 PM Edited by Wesser, 25 October 2013 - 09:19 AM.

This is the original R* implementation adapted to a CLEO script:
{$CLEO}

0000: NOP

const
    CHEAT_ID            = 48 // Cars fly
end
const
    DEFAULT_TIME        = 250
end
const
    PAD1                = 0
end
const
    LEFTSHOULDER1       = 4 // Secondary Fire
end
const
    STAT_TIMES_CHEATED  = 137 // Times cheated
end
const
    _isCheatEnabled     = 0x00407400
    _toggleCheat        = 0x00438370
    _increasePlayerStat = 0x0055C180
end
const
    _bCheatsUsed        = 0x0096918C
end
while true
    if and
        32@ > DEFAULT_TIME
    00E1:  is_button_pressed PAD1 button LEFTSHOULDER1
    then
        0AA7: call_function _isCheatEnabled num_params 1 pop 1 iCheatId CHEAT_ID bEnabled 1@
        if
            1@ == false
        then
            03E5: show_text_box 'CHEAT1' // Cheat activated
        else
            03E5: show_text_box 'CHEAT8' // Cheat deactivated
        end
        0AA5: call _toggleCheat num_params 1 pop 1 iCheatId CHEAT_ID
        0AA5: call _increasePlayerStat num_params 2 pop 2 tValue 1.0 sStatId STAT_TIMES_CHEATED // A float?
        0A8C: write_memory _bCheatsUsed size 1 value true virtual_protect 0
        32@ = 0
    end
    wait 0
end
You can modify the whole trigger as you like and set the proper cheat identifier by following the list SilentPL linked you.

pjratekjng
  • pjratekjng

    Player Hater

  • Members
  • Joined: 27 Jan 2010

#6

Posted 25 October 2013 - 06:37 PM

This is the original R* implementation adapted to a CLEO script:

{$CLEO}

0000: NOP

const
    CHEAT_ID            = 48 // Cars fly
end
const
    DEFAULT_TIME        = 250
end
const
    PAD1                = 0
end
const
    LEFTSHOULDER1       = 4 // Secondary Fire
end
const
    STAT_TIMES_CHEATED  = 137 // Times cheated
end
const
    _isCheatEnabled     = 0x00407400
    _toggleCheat        = 0x00438370
    _increasePlayerStat = 0x0055C180
end
const
    _bCheatsUsed        = 0x0096918C
end
while true
    if and
        32@ > DEFAULT_TIME
    00E1:  is_button_pressed PAD1 button LEFTSHOULDER1
    then
        0AA7: call_function _isCheatEnabled num_params 1 pop 1 iCheatId CHEAT_ID bEnabled 1@
        if
            1@ == false
        then
            03E5: show_text_box 'CHEAT1' // Cheat activated
        else
            03E5: show_text_box 'CHEAT8' // Cheat deactivated
        end
        0AA5: call _toggleCheat num_params 1 pop 1 iCheatId CHEAT_ID
        0AA5: call _increasePlayerStat num_params 2 pop 2 tValue 1.0 sStatId STAT_TIMES_CHEATED // A float?
        0A8C: write_memory _bCheatsUsed size 1 value true virtual_protect 0
        32@ = 0
    end
    wait 0
end
You can modify the whole trigger as you like and set the proper cheat identifier by following the list SilentPL linked you.

 

 

Well this is definitely helpful, but I'm not too sure how this code should be broken down. I've gotten to the point where it is compatible for compilation, but have no idea if its done right. All I know is that with this code:

 

//-------------MAIN---------------
thread '2192_FLIGHT' 
wait 0 
 
:2192_FLIGHT_17
if 
   Player.Defined($PLAYER_CHAR)
   Actor.DrivingVehicleType($PLAYER_ACTOR, #PRIMO)
else_jump @2192_FLIGHT_17 
  32@ > 250 
if 
00E1:   player 0 pressed_key 15 
else_jump @2192_FLIGHT_17 
0AA7: call_function 4224000 1 pop 1 48 1@  
if 
  1@ == 1 
jump @2192_FLIGHT_17 
0AA5: call 4424560 1 pop 1 48 
0AA5: call 5620096 2 pop 2 1.0 137 
0A8C: write_memory 9867616 size 1 value 1 virtual_protect 0 
32@ = 0 
wait 0 
 
 
the game will not start and freezes after loading completely. It could be a basic error, but again, I'm just unsure of how it should be done correctly

ZAZ
  • ZAZ

    Kernlochbohrer

  • Feroci
  • Joined: 10 Jan 2005
  • European-Union

#7

Posted 26 October 2013 - 12:00 PM

the game will not start and freezes after loading completely. It could be a basic error, but again, I'm just unsure of how it should be done correctly

 

 

cleo directive is missing, script will be compiled as main.scm, cause crash

Restore your main.scm!!!!





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users