Question related to variables
#1

Im still confused about ' char ' usage, here are some few questions:

1- Is it used only with player variables (example IsHelping[MAX_PLAYER char ] ) or with all variables ( example ZoneUnderAttack[36 char ] ) ?
2- Is it used only with bools?
3- Someone has told me 'You can use char in arrays for values between 0 and 255' , so i can use it in this varible, right? bool:ZoneUnderAttack[260]

Any more explanation would be appreciated , thanks!
Reply
#2

It doesn't matter if the variable is for the player or something else. As long as its value will be between 0 and 255, you can use it. Booleans can get 0 and 1 only so you can use it there too.
Reply
#3

So i can use it even with this var ? ZoneUnderAttack[900 char ] (let's say its value is always between 255 and 0)
Reply
#4

Yes, but don't forget to use {} instead of [] when setting/getting a value. For more information/examples about it, check the Tips & Tricks thread > "Char-arrays"
Reply
#5

Thanks again If i could rep you again i would give you +50 rep :P
Reply
#6

actually with booleans you can only use "true" or "false",
if you use 0 or 1 you get warnings

not saying you're wrong or anything, Konst
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)