SA-MP Forums Archive
Help with cache_get_data - 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 with cache_get_data (/showthread.php?tid=580655)



Help with cache_get_data - FplayerGR - 07.07.2015

hey guys i have one problem with cache_get_data my code here:

Код:
public CheckAccout(playerid){
	new pName[MAX_PLAYER_NAME],str[180],query[128];
	GetPlayerName(playerid,pName,sizeof(pName));
	mysql_format(connect,query,sizeof(query),"SELECT * FROM `users` WHERE `username` = '%e'",pName);
	mysql_tquery(connect,query,"","");
	if(cache_num_rows()){
		format(str,sizeof(str),"{FFFFFF}Welcome\nPlease type one password for register an accout!\n");
		ShowPlayerDialog(playerid,DIALOG_LOG,DIALOG_STYLE_INPUT,"{00FF00}Login",str,"Login","Quit");
	}else{
	    format(str,sizeof(str),"{FFFFFF}Welcome\nPlease type your password!\n");
	    ShowPlayerDialog(playerid,DIALOG_REG,DIALOG_STYLE_INPUT,"{00FF00}Register",str,"Register","Quit");
	}
	return 1;
}
and get me [WARNING] cache_get_data - no active cache
who is problem?
thanks!

edit:LOL i fixed but now i have this problem

[WARNING] cache_get_row_count - no active cache

with code look up :P


Re: Help with cache_get_data - !damo!spiderman - 07.07.2015

This is because you're using a threaded query (mysql_tquery) which generally calls a callback once it is done. You have not specified any callback and there won't be any cached results yet because it gets sent straight to a thread to be executed. You either need to run you next lot of code in a callback or use a non threaded query.


Re: Help with cache_get_data - FplayerGR - 07.07.2015

Quote:
Originally Posted by !damo!spiderman
Посмотреть сообщение
This is because you're using a threaded query (mysql_tquery) which generally calls a callback once it is done. You have not specified any callback and there won't be any cached results yet because it gets sent straight to a thread to be executed. You either need to run you next lot of code in a callback or use a non threaded query.
ohh yes! thanks you i use new Cache:r and mysql_query and cache_delete and fixed thanks you very much