SA-MP Forums Archive
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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: bool (/showthread.php?tid=236861)



bool - Gh0sT_ - 08.03.2011

Is there any way to convert string to bool? Like string to int, string to float and ...


Re: bool - tuuker - 08.03.2011

What do you mean? These things are diffrent, bool can be true or false and strings are holding characters to make readable words.


Re: bool - Gh0sT_ - 08.03.2011

I have bool loading with y_ini:

if( ! strcmp( pavadinimas, "Parduodama", true ) ) MasinuDB[ masinosid ][ Parduodama ] = nustatymas;

Ofcourse I get an warning, because nustatymas is string.. And I need to convert it to bool ;S like strval, floatstr


Re: bool - Mauzen - 08.03.2011

pawn Код:
#define StringToBool(%1)        (strcmp(%1, "true", true) == 0)
Just one idea, there might be other ways to do it.