Posts: 24
Threads: 19
Joined: Jan 2017
Reputation:
0
Hello,
I was wondering whhat is the difference between bool or int, as at final we can use equal to 1 for true and 0 for false
Posts: 579
Threads: 18
Joined: Apr 2017
Reputation:
0
You cant use bool for 3 options for example.
Posts: 219
Threads: 0
Joined: Oct 2012
Reputation:
0
If you're interested in use of memory, there's no difference in Pawn.
Both int and bool are stored on 32 bits.
If we're talking about values the int value 0 represents false and any other int value represents true.
Posts: 36
Threads: 4
Joined: Dec 2016
Reputation:
0
Bool usually works with if or else commands if you set bool="true" the given command will work for the player but if you set bool="false" the command may refuse to work for the player. Int refers to an integral value,setting int value to work as a bool maybe a very bad idea as it is not a good way of scripting nor it works in most of the cases and gives errors.
---------------
Hope it helps!
---------------
Posts: 10,066
Threads: 38
Joined: Sep 2007
Reputation:
0
Pawn only has one data type: the cell. The size of a cell is implementation specific. In SA-MP's case a cell is 32 bits. The tags (Float, Bool, etc.) are just there to define how the data in the cell should be represented. Therefore an int and a bool are exactly the same, safe for the way they are represented.