SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 24/01/2015, 09:06 PM   #1
dominik523
Gangsta
 
dominik523's Avatar
 
Join Date: Feb 2013
Location: Croatia
Posts: 843
Reputation: 115
Default MySQL fetching a boolean value

Hey all! I tried to find a function for fetching a boolean value from a cache and I haven't found a solution yet.
I'm using the latest MySQL plugin from BlueG and I've only found functions for getting an integer and float values and strings. (cache_get_field_content and other functions)
Can someone tell a proper way to do this? Thank you!
dominik523 is offline   Reply With Quote
Old 24/01/2015, 09:39 PM   #2
Sime30
Huge Clucker
 
Join Date: Oct 2012
Location: Should I stay or should I go
Posts: 348
Reputation: 31
Default Re: MySQL fetching a boolean value

Probaj ovo...(Try this...)

pawn Code:
new bool:test;
test =!!cache_get_field_content_int(0, "test");

OR

pawn Code:
new bool:test;

if(cache_get_field_content_int(0, "test")) test = true;
else test = false;
Sime30 is offline   Reply With Quote
Old 25/01/2015, 09:48 AM   #3
dominik523
Gangsta
 
dominik523's Avatar
 
Join Date: Feb 2013
Location: Croatia
Posts: 843
Reputation: 115
Default Re: MySQL fetching a boolean value

Alright, thanks for the answer!
I should read other posts where people asked the same question, and Vince told the answer on one of the threads so here's the solution:
pawn Code:
PlayerInfo[playerid][pShoot] = bool:cache_get_field_content_int(0, "ShootInd", mysql);
dominik523 is offline   Reply With Quote
Old 25/01/2015, 10:05 AM   #4
Sime30
Huge Clucker
 
Join Date: Oct 2012
Location: Should I stay or should I go
Posts: 348
Reputation: 31
Default Re: MySQL fetching a boolean value

No problem, glad you fixed your issue
Sime30 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL not fetching. EliteApple Scripting Help 2 22/09/2013 01:02 AM
[MySQL] Not fetching all groups [TC]XxJuggaloxX Scripting Help 2 25/02/2013 11:52 PM
mySQL fetching PDChaseOfficial Scripting Help 0 04/01/2013 03:53 PM
MySQL fetching row problem! [URGENT HELP] fiki574 Scripting Help 6 16/04/2012 06:51 PM
MySQL fetch boolean Killer#Mummy Help Archive 0 21/07/2011 09:08 PM


All times are GMT. The time now is 04:07 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.