Y_INI read from ini, set variable
#1

So, I have an "/OOC" chat, and I a "settings.ini" file in my scriptfiles. I have a line in the "settings.ini" that says "ooc = 0" stating that OOC is disabled. (I am using Y_INI). How can I set the value of "ooc" to a string in SA:MP so I can do the following?
pawn Code:
new ooc[2];
ooc = ?????; // <----- The value of "ooc" in "scriptfiles/settings.ini"

if(ooc == 1){

    //continue with sending message

} else {
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "/OOC chat has been disabled by admins.");
}
bumpppp, anyone know how to load info from INI and use it as a string? Like for example, could someone write a small script checks what "money" is equal to in a file "scriptfiles/users/user.ini", and update their amount of money? Then, I can just refrence that every time I need to get something from an ini file

I find it hard to believe that no one knows how to retrive values from INI files, when almost all the gamemodes and filterscripts out there do it.
Reply


Messages In This Thread
[No subject] - by Nathan_Taylor - 28.02.2013, 19:44
Re: Y_INI read from ini, set variable - by LarzI - 28.02.2013, 22:23
Re: Y_INI read from ini, set variable - by Nathan_Taylor - 28.02.2013, 22:30
Re: Y_INI read from ini, set variable - by 2KY - 01.03.2013, 00:00
Re: Y_INI read from ini, set variable - by Nathan_Taylor - 01.03.2013, 00:32
Re: Y_INI read from ini, set variable - by 2KY - 01.03.2013, 00:33
Re: Y_INI read from ini, set variable - by Nathan_Taylor - 01.03.2013, 00:35
Re: Y_INI read from ini, set variable - by 2KY - 01.03.2013, 00:48
Re: Y_INI read from ini, set variable - by Nathan_Taylor - 01.03.2013, 01:08
Re: Y_INI read from ini, set variable - by 2KY - 01.03.2013, 01:09

Forum Jump:


Users browsing this thread: 1 Guest(s)