SA-MP Forums Archive
[Help] Help with split - 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: [Help] Help with split (/showthread.php?tid=492993)



[Help] Help with split - ranslsad - 06.02.2014

Hello, i need help on how to split one variable.
I tried with scanf but i dont know how to use as well and i got stuck...
here is my code:

Код:
sscanf(cache_get_row_float(i, 9),"ffffffffffffffffffff",
		JCheckPoint[TmpID][1][CPX], JCheckPoint[TmpID][2][CPX], JCheckPoint[TmpID][3][CPX], JCheckPoint[TmpID][4][CPX],
		JCheckPoint[TmpID][5][CPX], JCheckPoint[TmpID][6][CPX], JCheckPoint[TmpID][7][CPX], JCheckPoint[TmpID][8][CPX],
		JCheckPoint[TmpID][9][CPX], JCheckPoint[TmpID][10][CPX], JCheckPoint[TmpID][11][CPX], JCheckPoint[TmpID][12][CPX],
		JCheckPoint[TmpID][13][CPX], JCheckPoint[TmpID][14][CPX], JCheckPoint[TmpID][15][CPX], JCheckPoint[TmpID][16][CPX],
		JCheckPoint[TmpID][17][CPX], JCheckPoint[TmpID][18][CPX], JCheckPoint[TmpID][19][CPX], JCheckPoint[TmpID][20][CPX]);
tried too with sscanf(cache_get_row_float(i, 9),"f f ...",
and
sscanf(cache_get_row_float(i, 9),"%f%f...",

but it gives me error in first argument, idk why.
Its float and it must be another?
I need to split CheckPoints positions (float).

Thanks for all and sry for bad english.

Greetings

Ranslsad


Re: [Help] Help with split - Konstantinos - 06.02.2014

cache_get_row_float function returns float and sscanf's first parameter must be array (string).

Have you saved each one separated or in a string (as data type) in the table? You can only use sscanf with the second one otherwise (if they're separated saved) use cache_get_row_float for each one of them.


Respuesta: [Help] Help with split - ranslsad - 06.02.2014

save separated are more easy, but alot of rows, must be 30 coords for X, 30 for Y and 30 for Z.
Total 90 rows.
I want to save 30 X coords in the same row and split them, i dont create the save system yet then im flexible to change the system.

Thanks for all.

Greetings