Boolian variables
#2

if you convert true to a number it will be 1
if you convert false to a number it will be 0

if you convert an integer to boolean everything not 0 will be true and 0 will be false

If you save an boolean it will save it was 1 or 0
And than if you load the number you will get 1 or 0
Just put a bool: before it to convert it back again

pawn Код:
LocInfo[id][AvailableTeleport] = bool: strval(Argument[7]);
or the better methode, we know that argument[7] is only 1 or 0, we could do

pawn Код:
LocInfo[id][AvailableTeleport] = (Argument[7][0] == '1');
or like that, I think thats the easiest check from all

pawn Код:
LocInfo[id][AvailableTeleport] = bool: Argument[7][0];
Reply


Messages In This Thread
Boolian variables - by nuriel8833 - 02.06.2011, 12:10
AW: Boolian variables - by Nero_3D - 02.06.2011, 12:39
Re: Boolian variables - by Sergei - 02.06.2011, 13:05
Re: Boolian variables - by Raimis_R - 02.06.2011, 13:30
Re: Boolian variables - by nuriel8833 - 02.06.2011, 13:36
Re: Boolian variables - by nuriel8833 - 03.06.2011, 09:12
Re: Boolian variables - by nuriel8833 - 04.06.2011, 12:18
AW: Boolian variables - by Nero_3D - 04.06.2011, 13:49
Re: Boolian variables - by Sergei - 04.06.2011, 16:49

Forum Jump:


Users browsing this thread: 2 Guest(s)