Raised This Month: $ Target: $400
 0% 

SQL_FetchInt on bool values?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
honorcode23
BANNED
Join Date: Mar 2010
Location: Chile
Old 08-24-2010 , 19:06   SQL_FetchInt on bool values?
Reply With Quote #1

Hi everyone. I've been trying to make an small settings plugin (Adverts, sounds, notifications and etc) for my server, but im getting some tag mismatches using the 'SQL_FetchInt' function with bools. I didnt fint SQL_FetchBool or anything realted so i jsut used the Int.

The plugin works fine but i really hate having tag mismatches on my plugins, so i wonder if anybody have an idea of how to avoid them.

Thanks in advance
honorcode23 is offline
DarkEnergy
SourceMod Donor
Join Date: Apr 2008
Location: Georgia Tech, MSECE
Old 08-24-2010 , 19:12   Re: SQL_FetchInt on bool values?
Reply With Quote #2

there is no real bool in sql is there? TINYINT(1).

if u want fetch a number 0 or 1 and make it a bool, u can try force tagging that makes the complaint stfu
new bool:var=bool:SQL_FetchInt(...)

if ur fetched int may be more than 1 id use a tertiary operator
__________________
War3:Source Developer
"Your CPU is just a bunch of Muxes"
DarkEnergy is offline
Monkeys
Veteran Member
Join Date: Jan 2010
Old 08-24-2010 , 20:09   Re: SQL_FetchInt on bool values?
Reply With Quote #3

new bool:Boolean = (SQL_FetchInt(...) != 0)
__________________
Get a lid on that zombie,
he's never gonna be alri-i-ight.
Oooh get a lid on that zombie,
or he's gonna feed all night.
Monkeys is offline
honorcode23
BANNED
Join Date: Mar 2010
Location: Chile
Old 08-24-2010 , 21:03   Re: SQL_FetchInt on bool values?
Reply With Quote #4

Thank you guys, why didn't i think on that before?! xD. Yay, tag mismatches gone
honorcode23 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:47.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode