Jump to content

removing mask


indraCG

Recommended Posts

I'm making a script that can make the player wearing mask when i i type "mask"

 

 

thread 'CHANGE' :CHANGE_11wait 0 if   Player.Defined($PLAYER_CHAR)else_jump @CHANGE_11 if 0AB0:   key_pressed 77 0AB0:   key_pressed 65 0AB0:   key_pressed 83 0AB0:   key_pressed 75 else_jump @CHANGE_11 Player.SetClothes($PLAYER_CHAR, "HOCKEY", "HOCKEYMASK", 16)Player.Build($PLAYER_CHAR)wait 1000 jump @CHANGE_11 

 

 

 

this script is work but now my question is how to make the mask removed when i type the same keys?

Link to comment
Share on other sites

If you really want a hotkey (you need to press them in the same time), then it should work like that:

 

 

0000: CHANGE                            // Thread name is useless in CLEOconst   IS_HOCKEY_MASK_PUT_ON   = 0@endwhile true   0001: wait 250 ms     // I think you REALLY don't need to check it every frame, just press it for 1/4s longer.   if       0256:   player 0 defined        // 0 == $PLAYER_CHAR; smaller CLEO == better   then       if and                          // You've forgot about and here            0AB0:   key_pressed 77            0AB0:   key_pressed 65            0AB0:   key_pressed 83            0AB0:   key_pressed 75        then           if               IS_HOCKEY_MASK_PUT_ON == false           then               0793: save_player_clothes   // Makes it possible to restore old clothing, may screw up if you change your clothing before removing mask though               087B: set_player 0 clothes_texture "HOCKEY" model "HOCKEYMASK" body_part 16               070D: rebuild_player 0               IS_HOCKEY_MASK_PUT_ON = true           else               0794: restore_player_clothes               070D: rebuild_player 0               IS_HOCKEY_MASK_PUT_ON = false           end                      while true               if or                   0AB0:   key_pressed 77  // Script won't loop when you'll keep keys pressed - pretty useful, I think.                    0AB0:   key_pressed 65                    0AB0:   key_pressed 83                    0AB0:   key_pressed 75                jf break               0001: wait 0 ms           end       end   endend

 

 

 

If you meant a cheat, it should work like that:

 

 

0000: CHANGEconst   IS_HOCKEY_MASK_PUT_ON   = 0@endwhile true   0001: wait 250 ms   if       0256:   player 0 defined   then       if           0ADC:   test_cheat "MASK"       then           if               IS_HOCKEY_MASK_PUT_ON == false           then               0793: save_player_clothes               087B: set_player 0 clothes_texture "HOCKEY" model "HOCKEYMASK" body_part 16               070D: rebuild_player 0               IS_HOCKEY_MASK_PUT_ON = true           else               0794: restore_player_clothes               070D: rebuild_player 0               IS_HOCKEY_MASK_PUT_ON = false           end       end   endend

 

 

 

I've used constants and everything to make code as clear as possible. You obviously don't need it and you can replace it with raw variable (Sanny replaces it anyway). True equals to 1 when compiled and false equals to 0.

 

Note second script requires CLEO4 due to 0ADC opcode. It's possible to make the same result using CLEO3 though, just tell me if you need it.

 

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
  • 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.