SA-MP Forums Archive
sscanf problem - 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: sscanf problem (/showthread.php?tid=648620)



sscanf problem - ReVson - 25.01.2018

Hi, i have a problem. My code is stopping at :
Код:
sscanf(data, "p<|>fiiiifffs[24]", pInfo[playerid][hp], pInfo[playerid][years],pInfo[playerid][rasa], pInfo[playerid][sex], pInfo[playerid][skin], pInfo[playerid][x], pInfo[playerid][y], pInfo[playerid][z], pInfo[playerid][Nick]);
all its
Код:
format(query, 500, "SELECT HP, years, rasa, sex, skin, X, Y, Z, Nick FROM postacie WHERE Global = '%s'", NazwaGracza(playerid));
						mysql_query(query); 
						mysql_store_result(); 
						while(mysql_fetch_row(data, "|")) { 
							sscanf(data, "p<|>fiiiifffs[24]", pInfo[playerid][hp], pInfo[playerid][years],pInfo[playerid][rasa], pInfo[playerid][sex], pInfo[playerid][skin], pInfo[playerid][x], pInfo[playerid][y], pInfo[playerid][z], pInfo[playerid][Nick]); 
							TogglePlayerSpectating(playerid, 0);
							SetPlayerName(playerid, pInfo[playerid][Nick]);
							SetPlayerPos(playerid, pInfo[playerid][x], pInfo[playerid][y], pInfo[playerid][z]);
							SetPlayerSkin(playerid, pInfo[playerid][skin]);
							pInfo[playerid][zalogowany] = true;
							format(string, 128, "{FF0000}>> {00FFFF}Witaj na serwerze {33cc33}%s(GLOBAL:%s, ID:%i, UID:%i)!", pInfo[playerid][Nick], uInfo[playerid][Nick], playerid, pInfo[playerid][ID]);
							SCM(playerid, -1, string);
						} 
						mysql_free_result();
I'm using strickenkidds mysql.


Re: sscanf problem - DobbysGamertag - 25.01.2018

Why are you using a plugin that hasn't been updated in 7 years? (fun fact, exactly 7 years 1/25/2011 - v2.1.1)


Re: sscanf problem - ReVson - 25.01.2018

i just like it


Re: sscanf problem - DobbysGamertag - 25.01.2018

Personally, i feel you'd be better off switching to BlueG/Maddinators plugin.

Does it even have threaded queries? IE: The server can't sync other players, or process anything since you're using an outdated plugin, and haven't threaded them.

Vince explains it better:

Quote:
Originally Posted by Vince
Посмотреть сообщение
The idea with a threaded query is that while the query is busy the sa-mp server can continue on and execute other things (sync!). When the query is done, the MySQL servers calls the function you specify and you can go on loading your data.

With an unthreaded query, the sa-mp server has to wait for the response from the MySQL server before it can continue. This is especially troublesome if the query takes more than a few milliseconds to execute. During this "timeout" nothing happens. No syncing, nothing.



Re: sscanf problem - ReVson - 25.01.2018

yes, but query is okay. The code is stuck when sscanf


Re: sscanf problem - ReVson - 26.01.2018

Solved, just updated sscanf to sscanf2