Clothes pickup

From GTAMods Wiki
Revision as of 13:04, 18 April 2010 by Spaceeinstein (talk | contribs) (added alternate format)
Jump to navigation Jump to search

This is a code snippet for a clothes pickup in Sanny Builder's format for Vice City. This code is based on the clothes pickups in Vice City. Even the "no fall off bike" glitch works.

:CLOTHES
03A4: name_thread 'CLOTHES' 
055B: 0@ = create_clothes_pickup 13 at 0.0 0.0 0.0 // set your pickup location

:CLOTHES_34
0001: wait 0 ms 
00D6: if 
0038:   $1180 == 0
004D: jump_if_false @CLOTHES_34
00D6: if 
0214:   pickup 0@ picked_up 
004D: jump_if_false @CLOTHES_115 
0050: gosub @CLOTHES_122 
00D6: if 
0256:   player $PLAYER_CHAR defined 
004D: jump_if_false @CLOTHES_108 
0352: set_actor $PLAYER_ACTOR skin_to 'PLAYER' // set your character, see list of special actors (023C)

:CLOTHES_108
0050: gosub @CLOTHES_244 

:CLOTHES_115
{
//add more pickups by copying and pasting this section, remember to make adjustments and corrections
00D6: if 
0214:   pickup 1@ picked_up // change pickup handle
004D: jump_if_false @Second_Pickup_End // change jump-to-skip
0050: gosub @CLOTHES_122 
00D6: if 
0256:   player $PLAYER_CHAR defined 
004D: jump_if_false @Second_Pickup_Gosub // change jump-to-gosub
0352: set_actor $PLAYER_ACTOR skin_to 'PLAYER' // set your character, see list of special actors (023C)

:Second_Pickup_Gosub // change jump-to-gosub label
0050: gosub @CLOTHES_244 

:Second_Pickup_End // change jump-to-skip label
}
0002: jump @CLOTHES_34 

:CLOTHES_122
0004: $1180 = 1
00D6: if 
0256:   player $PLAYER_CHAR defined 
004D: jump_if_false @CLOTHES_191 
0169: set_fade_color 0 0 1 
016A: fade 0 500 ms 

:CLOTHES_160
00D6: if 
016B:   fading 
004D: jump_if_false @CLOTHES_184 
0001: wait 0 ms 
0002: jump @CLOTHES_160 

:CLOTHES_184
0002: jump @CLOTHES_198 

:CLOTHES_191
0004: $1180 = 0

:CLOTHES_198
00D6: if 
0256:   player $PLAYER_CHAR defined 
004D: jump_if_false @CLOTHES_235 
03BF: set_player $PLAYER_CHAR ignored_by_everyone_to 1 
01B4: set_player $PLAYER_CHAR frozen_state 0 
0002: jump @CLOTHES_242 

:CLOTHES_235
0004: $1180 = 0

:CLOTHES_242
0051: return 

:CLOTHES_244
00D6: if 
0256:   player $PLAYER_CHAR defined 
004D: jump_if_false @CLOTHES_351 
038B: load_requested_models 
00D6: if 
0256:   player $PLAYER_CHAR defined 
004D: jump_if_false @CLOTHES_283 
0353: refresh_actor $PLAYER_ACTOR 

:CLOTHES_283
03BF: set_player $PLAYER_CHAR ignored_by_everyone_to 0 
00D6: if 
810F:   not player $PLAYER_CHAR wanted_level > 2 
004D: jump_if_false @CLOTHES_313 
0110: clear_player $PLAYER_CHAR wanted_level 

:CLOTHES_313
01B4: set_player $PLAYER_CHAR frozen_state 1 
0004: $1180 = 0
016A: fade 1 500 ms 
03E5: text_box 'CLOHELP'  // Clean Clothes!!
0002: jump @CLOTHES_358 

:CLOTHES_351
0004: $1180 = 0

:CLOTHES_358
0051: return

Look here for a list of available characters. Open the GXT file and search for OUTFT13 to edit the name of the clothing pickup.

Alternate format

The following code is exactly the same as the code above. It is just formatted differently.

:CLOTHES
03A4: name_thread 'CLOTHES'
055B: 0@ = create_clothes_pickup 13 at -1444.0 160.7 64.0 // set your pickup location

while true
    wait 0 ms
    if
        $1180 == 0
    then
        if
            0214:   pickup 0@ picked_up
        then
            gosub @CLOTHES_122
            if
                0256:   player $PLAYER_CHAR defined
            then
                0352: set_actor $PLAYER_ACTOR skin_to 'PLAYER' // set your character, see list of special actors (023C)
            end
        gosub @CLOTHES_244
        end
{
//add more pickups by copying and pasting this section, remember to make adjustments and corrections
        if
            0214:   pickup 1@ picked_up
        then
            gosub @CLOTHES_122
            if
                0256:   player $PLAYER_CHAR defined
            then
                0352: set_actor $PLAYER_ACTOR skin_to 'PLAYER' // set your character, see list of special actors (023C)
            end
        gosub @CLOTHES_244
        end
}
    end
end

:CLOTHES_122
$1180 = 1
if
    0256:   player $PLAYER_CHAR defined
then
    0169: set_fade_color 0 0 1
    fade 0 500 ms
    while if 016B:   fading
        wait 0 ms
    end
else
    $1180 = 0
end
if
    0256:   player $PLAYER_CHAR defined
then
    03BF: set_player $PLAYER_CHAR ignored_by_everyone_to 1
    01B4: set_player $PLAYER_CHAR frozen_state 0 
else
    $1180 = 0
end
return

:CLOTHES_244
if
    0256:   player $PLAYER_CHAR defined
then
    038B: load_requested_models
    if
        0256:   player $PLAYER_CHAR defined
    then
        0353: refresh_actor $PLAYER_ACTOR
    end
    03BF: set_player $PLAYER_CHAR ignored_by_everyone_to 0
    if
        810F:   not player $PLAYER_CHAR wanted_level > 2
    then
        0110: clear_player $PLAYER_CHAR wanted_level
    end
    01B4: set_player $PLAYER_CHAR frozen_state 1 
    $1180 = 0
    fade 1 500 ms          
    03E5: text_box 'CLOHELP'  // Clean Clothes!!
else
    $1180 = 0
end
return