Vice City Multiplayer

VC:MP 0.3 => mIRC/pawn Scripting => Topic started by: ReVilo on March 30, 2008, 08:15:30 pm

Title: readini variable
Post by: ReVilo on March 30, 2008, 08:15:30 pm
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 >_<)
Title: Re: readini variable
Post by: Juppi on March 30, 2008, 10:40:19 pm
Yes, by using readini and writeini:

Code: [Select]
!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:

Code: [Select]
[LABEL]
value_name=x
Title: Re: readini variable
Post by: ReVilo on March 31, 2008, 05:35:20 am
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.
Title: Re: readini variable
Post by: Mex on March 31, 2008, 07:15:22 pm
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:

Code: [Select]
[section]
bob=hacking

And your script was this:

Code: [Select]
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.