Buying property
This is a code snippet of a property for sale in Sanny Builder's format and should work in Vice City and San Andreas. This gives you the basic code to create a working script without creating a mission for it. Remember to read the tutorial on how to create a thread before proceeding to implement this code.
:BUY
0006: 1@ = 100 // set price
0007: 2@ = 308.7745 // x-coordinate of pickup
0007: 3@ = -1298.623 // y-coordinate of pickup
0007: 4@ = 11.07 // z-coordinate of pickup
0518: 0@ = create_available_asset_pickup 'PROP_3' at 2@ 3@ 4@ price 1@ // Press ~k~~PED_ANSWER_PHONE~ to buy this property for $~1~.
03A4: name_thread 'BUY'
:BUY_10
0001: wait 250 ms
00D6: if
0256: player $PLAYER_CHAR defined
004D: jump_if_false @BUY_10
00D6: if
0038: $ONMISSION == 0
004D: jump_if_false @BUY_10
00D6: if
0214: pickup 0@ picked_up
004D: jump_if_false @BUY_10
01B4: set_player $PLAYER_CHAR frozen_state 0
03BF: set_player $PLAYER_CHAR ignored_by_everyone_to 1
02A3: toggle_widescreen 1
015F: set_camera_position 468.3571 1259.458 21.8848 0.0 0.0 0.0
0160: point_camera 469.2978 1259.797 21.8834 2
00BA: text_styled 'BUYPRO' 5000 ms 2 // Property bought!
0394: play_music 1
0001: wait 5000 ms
00D6: if
8256: not player $PLAYER_CHAR defined
004D: jump_if_false @BUY_176
004E: end_thread
:BUY_176
00BE: text_clear_all
0373: set_camera_directly_behind_player
02EB: restore_camera_with_jumpcut
01B4: set_player $PLAYER_CHAR frozen_state 1
03BF: set_player $PLAYER_CHAR ignored_by_everyone_to 0
02A3: toggle_widescreen 0
004E: end_thread
Due to an error in the wiki, line 25 should be
00BA: text_styled 'BUYPRO' 5000 ms 2