02.06.2011, 12:39
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
or the better methode, we know that argument[7] is only 1 or 0, we could do
or like that, I think thats the easiest check from all
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]);
pawn Код:
LocInfo[id][AvailableTeleport] = (Argument[7][0] == '1');
pawn Код:
LocInfo[id][AvailableTeleport] = bool: Argument[7][0];