View Single Post
  #2  
Old 04-15-2008, 12:56 AM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Updated version?

nice

And for people wondering about joining it to a TStaticVar
First you put the code Inverness posted in a class and name it something like, "file_ini" or something.

Then you do something like this serverside, for example in a dbnpc or a wnpc.

PHP Code:
function onCreated() {
  
this.ini = new TStaticVar("TIniFile");
  
this.ini.join("file_ini");

Then you can do from anywhere serverside something like
PHP Code:
function onCreated() {
  
temp.ini = new TIniFile();
  
temp.ini.load("path/to/filename.ext");

  echo(
temp.ini.section.var);


This makes it so you don't have to join "file_ini" everytime you need to load a ini file, as you can use TIniFile, as that object will have "file_ini" pre-joined.

I think Inverness can explain it better though, but I tried
__________________
Reply With Quote