MySQL problem
#2

Quote:
Originally Posted by ******
Посмотреть сообщение
You need a callback to trigger when the query completes. They aren't instant.
Like this?
Код:
forward OnJobInfoLoad(playerid);

public OnJobInfoLoad(playerid)
{
	new name[MAX_PLAYER_NAME], ispejimai, rang, pradirbo, x, resultline[40], str[170], fstr[3500];
	while(mysql_fetch_row_format(resultline))
	{
		sscanf(resultline,"p<|>s[24]ddd",name, ispejimai, rang, pradirbo);
		x++;
		format(str, sizeof(str),"%d. {00A5FF}%s\t {FAFAFA}Įspėjimai {FF0019}%d/3\t {FAFAFA}Rangas {FFDC00}%d\t {FAFAFA}Љiandien pradirbo {00D7FF}%d minučių\n", x, name, ispejimai, rang, pradirbo);
		strcat(fstr, str);
	}
	ShowPlayerDialog(playerid,DIALOG_DARBUOTOJAI,DIALOG_STYLE_MSGBOX,"Darbuotojai",fstr,"Gerai","");
	mysql_free_result();
}



CMD:darbuotojai(playerid, params[])
{
	if(sInfo[playerid][TaxDirektorius] == 1 || sInfo[playerid][TaxPavaduotojas] == 1)
	{
	    new query[128];
	    format(query, sizeof(query), "SELECT vardas, dispejimai, TaxRangas, pradirbtas_laikas FROM `user` WHERE `TaxiDarbas` = '1'");
		mysql_function_query(manomysql, query, true, "OnJobInfoLoad", "i", playerid);
		mysql_store_result();
	}
	return 1;
}
Reply


Messages In This Thread
MySQL problem - by Heress - 02.01.2019, 16:25
Re: MySQL problem - by Heress - 02.01.2019, 16:55
Re: MySQL problem - by Heress - 02.01.2019, 17:49
Re: MySQL problem - by Heress - 03.01.2019, 16:09
Re: MySQL problem - by Calisthenics - 03.01.2019, 16:33
Re: MySQL problem - by Heress - 03.01.2019, 16:39
Re: MySQL problem - by Calisthenics - 03.01.2019, 16:44
Re: MySQL problem - by Heress - 03.01.2019, 16:50
Re: MySQL problem - by Calisthenics - 03.01.2019, 16:57
Re: MySQL problem - by Heress - 03.01.2019, 17:18

Forum Jump:


Users browsing this thread: 1 Guest(s)