GameBro123 Posted February 19 Share Posted February 19 Whats wrong with this code.can someone fix it for me. I tried to get players current clothes to an ini file ( or a txt file ) when we press the 5 on keyboard. ( GTA San Andreas game )  {$CLEO .cs} // Script to store player's clothing state in 'items.ini' when pressing "5" 0000: NOP :START wait 0 // Infinite loop if   0AB0: key_pressed 0x35 // "5" key then   0793: store_clothes_state_to 0@ 1@ 2@     // Open items.ini file to write clothing data   0A8C: write_string_to_ini_file "items.ini" section "Clothes" key "Hat" value 0@   0A8C: write_string_to_ini_file "items.ini" section "Clothes" key "Shirt" value 1@   0A8C: write_string_to_ini_file "items.ini" section "Clothes" key "Pants" value 2@   0AD1: show_formatted_text_lowpriority "Clothing saved to items.ini!" time 2000 // Display message end jump @START Link to comment https://gtaforums.com/topic/1000752-whats-wrong-with-this-codeplease-can-someone-fix-it-for-me-%F0%9F%A5%BA/ Share on other sites More sharing options...
ZAZ Posted February 19 Share Posted February 19 (edited) If you can compile the script (without copy to cleo folder.) And then decompile it, then you'll get this {$CLEO .cs} 0000: NOP :Noname_2 0001: wait 0 ms 00D6: if 0AB0: is_key_pressed 53 004D: jump_if_false @Noname_153 0793: save_player_clothes 0A8C: write_memory "items.ini" size "Clothes" value "Hat" virtual_protect 0@ 0A8C: write_memory "items.ini" size "Clothes" value "Shirt" virtual_protect 1@ 0A8C: write_memory "items.ini" size "Clothes" value "Pants" virtual_protect 2@ 0AD1: show_formatted_text_highpriority "Clothing saved to items.ini!" time 2000 :Noname_153 0002: jump @Noname_2  Can you see now what's wrong?   1.) opcode 0793: doesn't return any information for the script  it just store the current clothes to game memory  a valid opcode 0793: 0793: save_player_clothes   2.) opcode 0A8C: write values to specific game memory address, but not to an ini file  a valid opcode 0A8C: 0A8C: write_memory 0xC0BC15 size 1 value 1 virtual_protect 0  a valid opcode to write int to ini file  0AF1: write_int 0 to_ini_file "CLEO\debug.ini" section "clear" key "reset"   a valid opcode to write STRING to ini file  0AF5: write_string "player_torso" to_ini_file "cleo\clothes.ini" section "TXD" key "torso"     Edited February 19 by ZAZ Link to comment https://gtaforums.com/topic/1000752-whats-wrong-with-this-codeplease-can-someone-fix-it-for-me-%F0%9F%A5%BA/#findComment-1072507837 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