SA-MP Forums Archive
Mysql Bool - 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: Mysql Bool (/showthread.php?tid=424069)



Mysql Bool - ancezas - 20.03.2013

Hello, sorry for bad english but i whant some help, how to load bool veriables?

hear is mine script, its allways set it in true

pawn Код:
if( mysql_fetch_field_row( fetch, "Telas" ) )       playerDB[ playerid ][ turitel ] = true;



Re: Mysql Bool - Misiur - 20.03.2013

Bool is stored as tinyint in database (0/1, not false/true)

pawn Код:
mysql_fetch_field_row( fetch, "Telas");
playerDB[ playerid ][ turitel ] = !!strval(fetch);
!! is neat trick to change any variable into boolean

#e: pardon


Re: Mysql Bool - ancezas - 20.03.2013

Thx, it's working