Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. The Criminal Enterprises
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Support

    3. Suggestions

*DO NOT* SHARE MEDIA OR LINKS TO LEAKED COPYRIGHTED MATERIAL. Discussion is allowed.

HELP, please! with CLEO script


Likesner
 Share

Recommended Posts

This is my health/god mode script. The health part works fine but the godmode doesnt work! I want it to turn godmode on only if it's off and vice versa but my $GOD1 variable does not work somehow! It pisses me off, please help.

 

here's the script:

 

 

 

// 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---------------thread 'HAG':HAG_1wait 10if   Player.Defined($PLAYER_CHAR)jf @HAG_1$GOD1 = 0:HAG_11wait 10if   Player.Defined($PLAYER_CHAR)jf @HAG_11gosub @HAG_52gosub @HAG_118gosub @HAG_216jump @HAG_11 :HAG_52if and8AB0:   not key_pressed 9 0AB0:   key_pressed 192 jf @HAG_316 [email protected] = Actor.Health($PLAYER_ACTOR)[email protected] += 150 Actor.Health($PLAYER_ACTOR) = [email protected]: [email protected] = actor $PLAYER_ACTOR [email protected] = 150Actor.Armour($PLAYER_ACTOR) = [email protected]   Actor.Driving($PLAYER_ACTOR)jf @HAG_200 03C0: [email protected] = actor $PLAYER_ACTOR car 0A30: repair_car [email protected]([email protected]):HAG_200018C: play_sound 1058 at 0.0 0.0 0.0 jump @HAG_316:HAG_118wait 100 if and0AB0:   key_pressed 9 0AB0:   key_pressed 192 $GOD1 == 0jf @HAG_316if   Actor.Driving($PLAYER_ACTOR)jf @HAG_186 03C0: [email protected] = actor $PLAYER_ACTOR car Car.SetImmunities([email protected], 1, 1, 1, 1, 1)053F: set_car [email protected] tires_vulnerability 0Car.RemoveReferences([email protected]):HAG_186Actor.SetImmunities($PLAYER_ACTOR, 1, 1, 1, 1, 1)03E5: show_text_box 'GODON' $GOD1 = 1jump @HAG_316:HAG_216wait 100 if and0AB0:   key_pressed 9 0AB0:   key_pressed 192 $GOD1 == 1jf @HAG_316if   Actor.Driving($PLAYER_ACTOR)jf @HAG_284 03C0: [email protected] = actor $PLAYER_ACTOR car Car.SetImmunities([email protected], 0, 0, 0, 0, 0)053F: set_car [email protected] tires_vulnerability 1Car.RemoveReferences([email protected]):HAG_284Actor.SetImmunities($PLAYER_ACTOR, 0, 0, 0, 0, 0)03E5: show_text_box 'GODOFF'$GOD1 = 0jump @HAG_316:HAG_316wait 10returnreturnreturn0A93: end_custom_thread 

 

Link to comment
Share on other sites

 

This is my health/god mode script. The health part works fine but the godmode doesnt work! I want it to turn godmode on only if it's off and vice versa but my $GOD1 variable does not work somehow! It pisses me off, please help.

 

 

 

 

Don't use global variables like $GOD1 in cleo scripts. it can cause bugs and crashes.

Especially if it is any global created by yourself. The game won't allocate it correct.

If you need it to store in savegames, then use a global

which is listed in Sanny Builder install dir\data\sa\CustomVariables.ini

But i recommand to never use globals in cleo unless $PLAYER_CHAR, $PLAYER_ACTOR and $ONMISSION

 

It's possible to store values in savegames by using special cleo opcodes

Opcode 0AB3: and 0AB4:

 

The expression var together with a number, <var><space><number> builds the Special Global Cleo Variable

 

 

0AB3: var 16 = 10or0006: [email protected] =  10  // integer values0AB3: var 16 = [email protected]: [email protected]= var 16

 

 

var 0 up to var 999 will be stored, in exemble var 16 is stored with 10

 

to get then stored value into your script needs to submit into a local:

 

 

0AB4: [email protected] = var 16if0039:   [email protected] ==  1  // integer values004D: jump_if_false @nextlabel

 

 

 

 

 

remove the waits in the subscripts

you only need wait in the first 2 Loops

and therefor wait 0 is enough

 

:HAG_1wait 0if Player.Defined($PLAYER_CHAR)jf @HAG_1//$GOD1 = 0:HAG_11wait 0if Player.Defined($PLAYER_CHAR)jf @HAG_11gosub @HAG_52gosub @HAG_118gosub @HAG_216jump @HAG_11

 

 

 

 

consider following fact:

The immunity of the player will be removed if $PLAYER_CHAR was set frozen and then unfrozen

 

frozen and unfrozen are done with these codes

by writing with opcodes:

 

01B4: set_player $PLAYER_CHAR frozen_state  0 (frozen)01B4: set_player $PLAYER_CHAR frozen_state  1 (unfrozen)

 

by writing as classes:

 

Player.CanMove($PLAYER_CHAR) = falsePlayer.CanMove($PLAYER_CHAR) = True

 

 

 

 

Link to comment
Share on other sites

I edited it to this:

 

 

// 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---------------thread 'HAG' :HAG_11wait 0if   Player.Defined($PLAYER_CHAR)else_jump @HAG_11 0AB3: var 16 = 00AB4: [email protected] = var 16 :HAG_38wait 0 if   Player.Defined($PLAYER_CHAR)else_jump @HAG_38 gosub @HAG_86 gosub @HAG_215 gosub @HAG_337 jump @HAG_38 :HAG_86if and8AB0:   not key_pressed 9 0AB0:   key_pressed 192 else_jump @HAG_459 [email protected] = Actor.Health($PLAYER_ACTOR)[email protected] += 150 Actor.Health($PLAYER_ACTOR) = [email protected]: [email protected] = actor $PLAYER_ACTOR armour [email protected] = 150 Actor.Armour($PLAYER_ACTOR) = [email protected]   Actor.Driving($PLAYER_ACTOR)else_jump @HAG_188 03C0: [email protected] = actor $PLAYER_ACTOR car 0A30: repair_car [email protected] Car.RemoveReferences([email protected]):HAG_188018C: play_sound 1058 at 0.0 0.0 0.0 jump @HAG_459 :HAG_215if and0AB0:   key_pressed 9 0AB0:   key_pressed 192 0039:   [email protected] ==  0 else_jump @HAG_459 if   Actor.Driving($PLAYER_ACTOR)else_jump @HAG_297 03C0: [email protected] = actor $PLAYER_ACTOR car Car.SetImmunities([email protected], 1, 1, 1, 1, 1)053F: set_car [email protected] tires_vulnerability 0 Car.RemoveReferences([email protected]):HAG_297Actor.SetImmunities($PLAYER_ACTOR, 1, 1, 1, 1, 1)03E5: show_text_box 'GODON' 0AB3: var 16 = 10AB4: [email protected] = var 16 jump @HAG_459 :HAG_337if and0AB0:   key_pressed 9 0AB0:   key_pressed 192 0039:   [email protected] ==  1 else_jump @HAG_459 if   Actor.Driving($PLAYER_ACTOR)else_jump @HAG_419 03C0: [email protected] = actor $PLAYER_ACTOR car Car.SetImmunities([email protected], 0, 0, 0, 0, 0)053F: set_car [email protected] tires_vulnerability 1 Car.RemoveReferences([email protected]):HAG_419Actor.SetImmunities($PLAYER_ACTOR, 0, 0, 0, 0, 0)03E5: show_text_box 'GODOFF' 0AB3: var 16 = 00AB4: [email protected] = var 16 jump @HAG_459 :HAG_459wait 10 return return return 0A93: end_custom_thread 

 

 

but it still doesnt work. The godmode turns off only all the time. What am i doing wrong?

Link to comment
Share on other sites

// 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---------------thread 'HAG' 0A95: enable_thread_saving :HAG_13wait 0 if   Player.Defined($PLAYER_CHAR)else_jump @HAG_13 0AB3: var 16 = 0 0AB4: [email protected] = var 16 :HAG_46wait 0 if   Player.Defined($PLAYER_CHAR)else_jump @HAG_46 if and8AB0:   not key_pressed 9 0AB0:   key_pressed 192 else_jump @HAG_195 [email protected] = Actor.Health($PLAYER_ACTOR)[email protected] += 150 Actor.Health($PLAYER_ACTOR) = [email protected]: [email protected] = actor $PLAYER_ACTOR armour [email protected] = 150 Actor.Armour($PLAYER_ACTOR) = [email protected]   Actor.Driving($PLAYER_ACTOR)else_jump @HAG_168 03C0: [email protected] = actor $PLAYER_ACTOR car 0A30: repair_car [email protected] Car.RemoveReferences([email protected]):HAG_168018C: play_sound 1058 at 0.0 0.0 0.0 jump @HAG_46 :HAG_195if and0AB0:   key_pressed 9 0AB0:   key_pressed 192  [email protected] == 0 else_jump @HAG_318 if   Actor.Driving($PLAYER_ACTOR)else_jump @HAG_273 03C0: [email protected] = actor $PLAYER_ACTOR car Car.SetImmunities([email protected], 1, 1, 1, 1, 1)053F: set_car [email protected] tires_vulnerability 0 Car.RemoveReferences([email protected]):HAG_273Actor.SetImmunities($PLAYER_ACTOR, 1, 1, 1, 1, 1)0ACA: show_text_box "GOD ON" 0AB3: var 16 = 1 0AB4: [email protected] = var 16 jump @HAG_46 :HAG_318if and0AB0:   key_pressed 9 0AB0:   key_pressed 192  [email protected] == 1 else_jump @HAG_46 if   Actor.Driving($PLAYER_ACTOR)else_jump @HAG_396 03C0: [email protected] = actor $PLAYER_ACTOR car Car.SetImmunities([email protected], 0, 0, 0, 0, 0)053F: set_car [email protected] tires_vulnerability 1 Car.RemoveReferences([email protected]):HAG_396Actor.SetImmunities($PLAYER_ACTOR, 0, 0, 0, 0, 0)0ACA: show_text_box "GOD OFF" 0AB3: var 16 = 0 0AB4: [email protected] = var 16 jump @HAG_46 

 

user posted image
Link to comment
Share on other sites

So, what was the problem? Was it wrong that i used subscripts? Anyways, thank you, I had to edit it more but it works fine now.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.