Likesner Posted June 18, 2011 Share Posted June 18, 2011 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 More sharing options...
ZAZ Posted June 18, 2011 Share Posted June 18, 2011 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 CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
Likesner Posted June 20, 2011 Author Share Posted June 20, 2011 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 More sharing options...
UNRATED69 Posted June 21, 2011 Share Posted June 21, 2011 // 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 Link to comment Share on other sites More sharing options...
Likesner Posted June 21, 2011 Author Share Posted June 21, 2011 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now