SA-MP Forums Archive
MySQL R38 - 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: MySQL R38 (/showthread.php?tid=585134)



MySQL R38 - Sjn - 11.08.2015

Is it possible to get all the data in a single string and split them up using sscanf with MySQL R38? If so, can someone show me an example please?


Re: MySQL R38 - Evocator - 11.08.2015

Код:
//12|31|444

new 
	string[128],
	value1, 
	value2, 
	value3
;

cache_get_field_content(0, "Field", string);
sscanf(string, "p<|>iii", value1, value2, value3);

//value1 = 12
//value2 = 31
//value3 = 444



Re: MySQL R38 - Vince - 11.08.2015

That would be stupid and counter productive.


Re: MySQL R38 - Sjn - 11.08.2015

Reason why i am asking this is, loading the data one by one using cache_get_field_content ... for player vehicles is causing a bit of lag. So i thought using this method wouldn't cause such problem? But still which method would be better to use? By splitting them up or loading them one by one?