- Writes a formatted text to the file
- 0AD9: write_formatted_text "[string]" in_file [file] ( [any] ... )
This CLEO opcode writes a formatted text to the file. In Sanny Builder it is important that you disable case converting in order for the opcode to work as expected. In "Options..." under the "Formats" tab in the "Case converting" box, select "As is". For CLEO v184.108.40.206 and below for GTA III and Vice City, this opcode crashes the game.
The following example allows you to record your positions into a file every time you press button 17 (ATTACK key).
const FILE_HANDLE = [email protected] X_POS = [email protected] Y_POS = [email protected] Z_POS = [email protected] end 0A9A: FILE_HANDLE = openfile "output" mode 0x77 // w while true wait 10 if 00E1: player 0 pressed_button 17 // attack key then while 00E1: player 0 pressed_button 17 // attack key wait 0 end 0054: store_player $PLAYER_CHAR position_to X_POS Y_POS Z_POS 0AD9: write_formatted_text "%f %f %f%c" in_file FILE_HANDLE data X_POS Y_POS Z_POS 0xA end end
write, file, format, formatted, text