Jump to content

INI FILES


Michael.Knight1

Recommended Posts

Michael.Knight1

allways peace

ok friends i want to know how to use ini files with gta sa script biggrin.gif

 

G1T
Link to comment
Share on other sites

Did you use opcode search tool?

 

0AF0 ~ 0AF5 are opcodes that manages ini files, they are auto-explainable.

Edited by Link2012
Link to comment
Share on other sites

Michael.Knight1
Did you use opcode search tool?

 

0AF0 ~ 0AF5 are opcodes that manages ini files, they are auto-explainable.

yes i can but i want to know how to use ini files

G1T
Link to comment
Share on other sites

A ini file struct is

 

[section]

key1=value1

key2=value2

 

And you can do more sections

 

[section1]

key1=value1

key2=value2

[section2]

key1=value1

key2=value2

 

The values at SectionX->keyX are differents because the section.

 

Now that you know it you can use the opcodes, let's imagine this ini

 

[sectionName]

stringKey=MyStr

intKey=40

floatKey=4.7

 

 

To get the values I will use

 

0AF4: 0@v = read_string_from_ini_file "cleo\config.ini" section "SectionName" key "stringKey"   // 0@v = "MyStr"0AF0: 4@ = get_int_from_ini_file "cleo\config.ini" section "SectionName" key "intKey"                // 4@ = 400AF2: 5@ = get_float_from_ini_file "cleo\config.ini" section "SectionName" key "floatKey"           // 5@ = 4.7

 

 

To write is basically the same logic, using 0AF5, 0AF1, 0AF3.

 

Link to comment
Share on other sites

You are greatly resistant to the knowledge.

 

What's this? http://www.gtaforums.com/index.php?showtop...st&p=1061138651

Edited by fastman92
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.