Vice City Multiplayer

VC:MP => mIRC/pawn Scripting => Topic started by: ReVilo on March 30, 2008, 07:15:30 PM

Title: readini variable
Post by: ReVilo on March 30, 2008, 07: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, 09:40:19 PM
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
Title: Re: readini variable
Post by: ReVilo on March 31, 2008, 04: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, 06: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:

[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.