Strval Bug - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Strval Bug (
/showthread.php?tid=562321)
Strval Bug -
Max_Andolini - 08.02.2015
Strval maximum 10 digit 32 bit cell (cellmax = 2147483647) but I want to be 11 digits.
How can I solve this?
Re: Strval Bug -
HazardouS - 08.02.2015
Divide your number into two or more variables, unless you want to make your own big numbers operations system, based on arrays. Each array slot will save one digit of your number. For example, 268 can be stored in a variable x = 268, but can also be stored in an array like this:
sizeof(array) = 3;
array[0] = 2;
array[1] = 6;
array[2] = 8;
Re: Strval Bug -
Max_Andolini - 08.02.2015
Solved.
Re: Strval Bug -
ikkentim - 08.02.2015
Quote:
Originally Posted by eco1999
cache_get_field_content(row, "TCNo", szReturn, g_MySQLConnections); PlayerInfo[extraid][pTCNo] = strval(szReturn);
This value is 12345678901 // 11 digit // How do I make it
|
that's more than a 32 bit signed integer(AKA one pawn cell) can hold.
Re: Strval Bug -
Max_Andolini - 08.02.2015
Solved.
Re: Strval Bug -
HazardouS - 08.02.2015
Dude, even if it is possible to find a workaround (and it is possible), find a way to lower that value.
AW: Strval Bug -
Nero_3D - 08.02.2015
Just leave it as a string as it was already said that you can't fit that number in one cell
pawn Код:
// enum blbalba
pTCNo[16]
// loading part
strcat((PlayerInfo[extraid][pTCNo][0] = EOS, PlayerInfo[extraid][pTCNo]), szReturn);
Re: AW: Strval Bug -
Max_Andolini - 08.02.2015
Solved.
Re: Strval Bug -
Max_Andolini - 08.02.2015
Thank you to everyone, I solved the problem.
Re: Strval Bug -
Schneider - 08.02.2015
Don't remove your posts, this could have helped others if they are having similar problem...