03.03.2013, 20:02
I don't know much myself, but I'll tell what I know (or guess)
char calculates number of cells required to hold this much chars of packed string. Untaged values are 1 cell wide. 5 char equals 2, and you are trying to hold 5 cells in 2 cells - ain't gonna work. If you change 5 char in your current code to 20 char - it will work just fine, becuase it will equal 5 cells.
This will work, because now we have packed hello string inside this char-array. Anyway: char has 8 bits of length, so it can hold values from 0 to 255 (no negative vaules) - in your case the 500 is too big for single byte, and it would fail anyway.
I don't know if there is conversion from untagged value to char, but I you can assign values like this:
Related thingies:
https://sampforum.blast.hk/showthread.php?tid=216730
There is char operator section in pawn_language_guide.pdf
https://sampwiki.blast.hk/wiki/Keywords:Operators#char - ain't too helpful
char calculates number of cells required to hold this much chars of packed string. Untaged values are 1 cell wide. 5 char equals 2, and you are trying to hold 5 cells in 2 cells - ain't gonna work. If you change 5 char in your current code to 20 char - it will work just fine, becuase it will equal 5 cells.
pawn Код:
new Detail[5 char] = !"Hello";
I don't know if there is conversion from untagged value to char, but I you can assign values like this:
pawn Код:
new Detail[ 5 char ];
Detail{0} = 255;
Detail{1} = 1;
Detail{2} = 100;
Detail{3} = 40;
Detail{4} = 50;
GivePlayerMoney(playerid, Detail{0});
https://sampforum.blast.hk/showthread.php?tid=216730
There is char operator section in pawn_language_guide.pdf
https://sampwiki.blast.hk/wiki/Keywords:Operators#char - ain't too helpful

