How to get a bool using dini.
#1

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?
Reply
#2

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

Thank you very much, reputation point given.

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

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

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!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)