Quantcast

Jump to content

» «
Photo

GTA SA - Cheat Code script crashes game

Best Answer spaceeinstein, A week ago

Will your game crash with this loop?

{$CLEO .cs}
0000:
while true
    wait 0
end
If not, you can build your code on top of that.
{$CLEO .cs}
0000:
while true
    wait 0
    if
        0ADC:   test_cheat "CHEAT"
    then
        03E5: text_box 'CHEAT1'
    end
end
If it does crash, you have a problem elsewhere. With CLEO, you shouldn't ever need to edit the GXT file. Go to the full post


10 replies to this topic
bananaking13
  • bananaking13

    Square Civilian

  • Members
  • Joined: 4 weeks ago
  • Seychelles

#1

Posted A week ago

I made my own CLEO script. I put the file (cheat.cs) in my "CLEO" folder. In GXT I put a category called GTASA++ with an entry CHEATACT. CHEATACT's code is Cheat Activated. (without a full stop)

 

Now whenever I load my game it crashes. Can I know what's wrong?

//-------------GTA: City of San Andreas++ (LUNG AFFINITY CHEAT)---------------
:KEYPRESS1
if or
0420:   key_pressed 66 // B
 wait 0 ms
jf @KEYPRESS1
jump @KEYPRESS2

:KEYPRESS2
while true
if or
0420:   key_pressed 79  // O
 wait 0 ms
jf @KEYPRESS2
jump @KEYPRESS3

:KEYPRESS3
while true
if or
0420:   key_pressed 65  // A
 wait 0 ms
jf @KEYPRESS3
jump @KEYPRESS4

:KEYPRESS4
while true
if or
0420:   key_pressed 84  // T
 wait 0 ms
jf @KEYPRESS4
jump @KEYPRESS5

:KEYPRESS5
while true
if or
0420:   key_pressed 77  // M
 wait 0 ms
jf @KEYPRESS5
jump @KEYPRESS6

:KEYPRESS6
while true
if or
0420:   key_pressed 65  // A
 wait 0 ms
jf @KEYPRESS6
jump @KEYPRESS7 

:KEYPRESS7
while true
if or
0420:   key_pressed 78  // N
 wait 0 ms
jf @KEYPRESS7
jump @LUNGAFFINITY3

:LUNGAFFINITY3       
0753: change_integer_stat 225 to 1000  // lung capacity 
0753: show_permanent_text_box 'CHEATACT'
0753: wait 1000ms
0753: remove_text_box 
jump @KEYPRESS1

boludoz
  • boludoz

    Square Civilian

  • Members
  • Joined: 10 Dec 2009
  • Argentina

#2

Posted A week ago Edited by boludoz, A week ago.

'While true' can be changed to 'wait 0', and the 'if or' is used when there are several possible options, in this case only 'if', because the option is only one, after each label must go A 'wait 0', the 'while true' is useless in this case.
-------------------
'While true' puede ser cambiado por 'wait 0', y el 'if or', se usa para cuando son varias opciones posibles, en este caso solamente 'if', porque la opcion es solo una, luego de cada etiqueta debe ir un 'wait 0', el 'while true' es inutil en este caso. 

boludoz
  • boludoz

    Square Civilian

  • Members
  • Joined: 10 Dec 2009
  • Argentina

#3

Posted A week ago Edited by boludoz, A week ago.

//-------------GTA: City of San Andreas++ (LUNG AFFINITY CHEAT)---------------
:KEYPRESS1
wait 0
if
0420:   key_pressed 66 // B
jf @KEYPRESS1
jump @KEYPRESS2

:KEYPRESS2
wait 0
if
0420:   key_pressed 79  // O
jf @KEYPRESS2
jump @KEYPRESS3

:KEYPRESS3
wait 0
if
0420:   key_pressed 65  // A
jf @KEYPRESS3
jump @KEYPRESS4

:KEYPRESS4
wait 0
if
0420:   key_pressed 84  // T
jf @KEYPRESS4
jump @KEYPRESS5

:KEYPRESS5
wait 0
if
0420:   key_pressed 77  // M
jf @KEYPRESS5
jump @KEYPRESS6

:KEYPRESS6
wait 0
if
0420:   key_pressed 65  // A
jf @KEYPRESS6
jump @KEYPRESS7 

:KEYPRESS7         
wait 0
if
0420:   key_pressed 78  // N
jf @KEYPRESS7
jump @LUNGAFFINITY3

:LUNGAFFINITY3       
0753: change_integer_stat 225 to 1000  // lung capacity 
0753: show_permanent_text_box 'CHEATACT'
0753: wait 1000 ms
0753: remove_text_box 
jump @KEYPRESS1

There was a small typing error in a wait. The waits also do not go with the 'ms' at the end.

The waits also do not go with the 'ms' at the end.
 

boludoz
  • boludoz

    Square Civilian

  • Members
  • Joined: 10 Dec 2009
  • Argentina

#4

Posted A week ago

:LUNGAFFINITY3
0753: change_integer_stat 225 to 1000 // lung capacity
0753: show_permanent_text_box 'CHEATACT'
0753: wait 1000ms

0753: remove_text_box
jump
@KEYPRESS1

 

and the opcoces? 0753???


boludoz
  • boludoz

    Square Civilian

  • Members
  • Joined: 10 Dec 2009
  • Argentina

#5

Posted A week ago

{$CLEO .cs}

//-------------GTA: City of San Andreas++ (LUNG AFFINITY CHEAT)---------------
0000: wait

:KEYPRESS1
wait 0
if
0ADC:   test_cheat "BOATMAN"
jf @KEYPRESS1
jump @LUNGAFFINITY3


:LUNGAFFINITY3       
0629: change_integer_stat 225 to 1000  // lung capacity 
0512: show_permanent_text_box 'CHEATACT'
0001: wait 1000 ms
03E6: remove_text_box 
jump @KEYPRESS1

bananaking13
  • bananaking13

    Square Civilian

  • Members
  • Joined: 4 weeks ago
  • Seychelles

#6

Posted A week ago Edited by bananaking13, A week ago.

{$CLEO .cs}

//-------------GTA: City of San Andreas++ (LUNG AFFINITY CHEAT)---------------
0000: wait

:KEYPRESS1
wait 0
if
0ADC:   test_cheat "BOATMAN"
jf @KEYPRESS1
jump @LUNGAFFINITY3


:LUNGAFFINITY3       
0629: change_integer_stat 225 to 1000  // lung capacity 
0512: show_permanent_text_box 'CHEATACT'
0001: wait 1000 ms
03E6: remove_text_box 
jump @KEYPRESS1

test_cheat is a thing? That's amazing!

 

I'll try this quickly then I'll say how this goes


bananaking13
  • bananaking13

    Square Civilian

  • Members
  • Joined: 4 weeks ago
  • Seychelles

#7

Posted A week ago

{$CLEO .cs}

//-------------GTA: City of San Andreas++ (LUNG AFFINITY CHEAT)---------------
0000: wait

:KEYPRESS1
wait 0
if
0ADC:   test_cheat "BOATMAN"
jf @KEYPRESS1
jump @LUNGAFFINITY3


:LUNGAFFINITY3       
0629: change_integer_stat 225 to 1000  // lung capacity 
0512: show_permanent_text_box 'CHEATACT'
0001: wait 1000 ms
03E6: remove_text_box 
jump @KEYPRESS1

EDIT: It crashed. I tried alternatively the older code (1st one u put) with {$ CLEO .cs} and tried to put the new LUNGAFFINITY3 code. Didn't work.


spaceeinstein
  • spaceeinstein

    Chocolate

  • GTA Mods Staff
  • Joined: 17 Jul 2003
  • Hong-Kong
  • Major Contribution Award [Mods]
    Helpfulness Awards [Mods]

#8

Posted A week ago   Best Answer Edited by spaceeinstein, A week ago.

Will your game crash with this loop?
{$CLEO .cs}
0000:
while true
    wait 0
end
If not, you can build your code on top of that.
{$CLEO .cs}
0000:
while true
    wait 0
    if
        0ADC:   test_cheat "CHEAT"
    then
        03E5: text_box 'CHEAT1'
    end
end
If it does crash, you have a problem elsewhere. With CLEO, you shouldn't ever need to edit the GXT file.

bananaking13
  • bananaking13

    Square Civilian

  • Members
  • Joined: 4 weeks ago
  • Seychelles

#9

Posted 6 days ago

Will your game crash with this loop?

{$CLEO .cs}
0000:
while true
    wait 0
end
If not, you can build your code on top of that.
{$CLEO .cs}
0000:
while true
    wait 0
    if
        0ADC:   test_cheat "CHEAT"
    then
        03E5: text_box 'CHEAT1'
    end
end
If it does crash, you have a problem elsewhere. With CLEO, you shouldn't ever need to edit the GXT file.

Yes! Thanks man, I thought you had to edit GXT (I'm new to CLEO but I've done some nice bits so far)


spaceeinstein
  • spaceeinstein

    Chocolate

  • GTA Mods Staff
  • Joined: 17 Jul 2003
  • Hong-Kong
  • Major Contribution Award [Mods]
    Helpfulness Awards [Mods]

#10

Posted 6 days ago

Some CLEO opcodes allow you to use text in the script file itself without the need to use GXT keys.
{$CLEO .cs}
0000:
while true
    wait 0
    if
        0ADC:   test_cheat "CHEAT"
    then
        0ACA: show_text_box "Cheat activated"
    end
end
  • bananaking13 likes this

boludoz
  • boludoz

    Square Civilian

  • Members
  • Joined: 10 Dec 2009
  • Argentina

#11

Posted 6 days ago Edited by boludoz, 6 days ago.

 

{$CLEO .cs}

//-------------GTA: City of San Andreas++ (LUNG AFFINITY CHEAT)---------------
0000: wait

:KEYPRESS1
wait 0
if
0ADC:   test_cheat "BOATMAN"
jf @KEYPRESS1
jump @LUNGAFFINITY3


:LUNGAFFINITY3       
0629: change_integer_stat 225 to 1000  // lung capacity 
0512: show_permanent_text_box 'CHEATACT'
0001: wait 1000 ms
03E6: remove_text_box 
jump @KEYPRESS1

EDIT: It crashed. I tried alternatively the older code (1st one u put) with {$ CLEO .cs} and tried to put the new LUNGAFFINITY3 code. Didn't work.

 

The script was tested, remember you need CLEO 4.  :facedesk:

EA3.png





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users