[code] divergent numbers - 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: [code] divergent numbers (
/showthread.php?tid=492429)
[code] divergent numbers -
vannesenn - 03.02.2014
How I can numbers 123456 Divergent on 1 2 3 4 5 6?
Re: [code] divergent numbers -
vannesenn - 05.02.2014
Bumb
Re: [code] divergent numbers -
RajatPawar - 05.02.2014
I don't know what you want, but something like this?
pawn Код:
new givenNumber = 1256711125;
new placeHolder[12];
valstr(placeHolder, givenNumber);
for(new i = 0; i < sizeof(placeHolder); i++)
{
printf("The digits are - %d, \n", strval(placeHolder[i]));
}
Prints stuff in reverse order, make it a decrementing loop to get stuff in the right order ( i = strlen(placeHolder); i > 0; i-- and stuff)
But make sure you read this, for valstr - "Important Note: High values passed to this function can cause the server to freeze for no apparent reason. If this happens, then use format instead."
Re: [code] divergent numbers -
vannesenn - 05.02.2014
I think that is what I need, I'll try code when I come home.