SA-MP Forums Archive
How to get a bool using dini. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How to get a bool using dini. (/showthread.php?tid=422746)



How to get a bool using dini. - Denying - 15.03.2013

First of all, thank you for reading this.

As the title says/asks.. how may I get a bool's value ( true/false ) using dini? I used dini_Bool( filename, boolname)
but when I compile I get "Tag mismatch" warning.. Here's the line I am using.

pawn Код:
PlayerInfo[playerid][Helper] = dini_Bool(file, "Helper");
Here's the enumeration:

pawn Код:
enum pInfo
{
AdminLevel,
SkinID,
PlayerLevel,
Cash,
Banned,
Tier,
Faction,
Rank [256],
Invited,
Bank,
Float:RentX,
Float:RentY,
Float:RentZ,
Rented,
RentedHouseID,
bool:Helper,
}

new PlayerInfo[MAX_PLAYERS][pInfo];
Here's the format of the player's file:
pawn Код:
GetPlayerName(playerid, aname, sizeof(aname));
format(file, sizeof(file), "Users/%s.ini", aname);
This is under OnPlayerConnect.

What am I doing wrong?


Re: How to get a bool using dini. - Glad2BeHere - 15.03.2013

https://sampforum.blast.hk/showthread.php?tid=179206
https://sampforum.blast.hk/showthread.php?tid=173783


Re: How to get a bool using dini. - Denying - 15.03.2013

Thank you very much, reputation point given.

EDIT: Can't give you at the moment. Will give as soon as possible.


Respuesta: How to get a bool using dini. - Parka - 15.03.2013

pawn Код:
stock bool:dini_Bool(filename[],key[]) {
   return bool:strval(dini_Get(filename,key));
}



Re: Respuesta: How to get a bool using dini. - Denying - 15.03.2013

Quote:
Originally Posted by cesar_******
Посмотреть сообщение
pawn Код:
stock bool:dini_Bool(filename[],key[]) {
   return bool:strval(dini_Get(filename,key));
}
Ye, well but you need to use "? true : false; after the dini_Bool(filename, key);

Which will look like this:
pawn Код:
dini_Bool(filename, key) ? true : false;
Thank you anyway!