• Welcome to Vice City Multiplayer.
 

readini variable

Started by ReVilo, March 30, 2008, 07:15:30 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ReVilo

Is there a way to make a variable that is dependent on a readini? So that it has to readini to find out the value of that variable. Is this possible? (Sorry if it's not clear what I'm trying to say >_<)

Juppi

Yes, by using readini and writeini:


!writeini -n filename.ini LABEL value_name x    ;saves the value to filename.ini and rewrites the old one

$readini(filename.ini,LABEL,value_name)    ;returns x



The filename.ini file looks like this:

[LABEL]
value_name=x

ReVilo

Hmm, I meant (cause i'm trying to make a banlist command without a constantly refreshing web host) how could I make a variable like %banlist.

Mex

If you wish to use a variable instead of plain text inside the $readini identifier, you can.
For example if your ini layout was the following:

[section]
bob=hacking


And your script was this:

var %banslist = bob
var %test = $readini(filename.ini,section,%banslist)


Then the variable called %test will contain the word "hacking".

I hope thats what your after, if not then please explain exactly what your trying to do.