Problem: mysql command that causes crash.
#3

Well, I had to modify some code that contained some errors.

Follow out the crash when using command when there are 4 people online works well, but when more than 8 people jump so to speak crash.

Код:
CMD:vermiembrosfacc(playerid, params[])
{
	if(pInfo[playerid][jAdminXLEP] <= 4) return SCM(playerid, COLOR_GRAD, "Necesitas ser administrador nivel 5 para usar este comando.");
    if(sscanf(params, "i", params[0])) return SCM(playerid, COLOR_LABELS, "Modo de uso: /vermiembrosfacc [ID facciуn]"), SCM(playerid, -1, "{FFFF00}[ID Facciones] {A6F06F}1: {FFFFFF}ASR {A6F06F}2: {FFFFFF}CMA {A6F06F}3: {FFFFFF}CIH {A6F06F}4: {FFFFFF}SAEM");
    if(params[0] < 1 || params[0] > 4) return SCM(playerid, COLOR_GRAD, "Sуlo es vбlida la ID 1 y 4, colocar sуlo /vermiembrosfacc para saber las IDґs.");
    mysql_tquery(mysql, "SELECT * FROM `usuarios`", "MiembrosFaccion", "ii", params[0], playerid);
	PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
	DesmantelarCMD(playerid, "/vermiembrosfacc");
	return 1;
}

funcion:MiembrosFaccion(id, playerid)
{
	new rows = cache_num_rows();
	if(rows != 0)
	{
		new i, rango, faccionid, cadena[64], username[MAX_PLAYER_NAME];
		for(i = 0; i < rows; i++)
		{
			faccionid = cache_get_field_content_int(i, "Faccion");
			rango = cache_get_field_content_int(i, "Rango");
			if(faccionid == ASR && id == 1) {
				cache_get_field_content(i, "Nombre", username, mysql, MAX_PLAYER_NAME);
				format(cadena, sizeof(cadena), "{FFFF00}[Facciуn ASR] {FFFFFF}%s Rango: [%i/8]", username, rango);
				SCM(playerid, -1, cadena);
			}
			if(faccionid == CMA && id == 2) {
				cache_get_field_content(i, "Nombre", username, mysql, MAX_PLAYER_NAME);
				format(cadena, sizeof(cadena), "{FFFF00}[Facciуn CMA] {FFFFFF}%s Rango: [%i/8]", username, rango);
				SCM(playerid, -1, cadena);
			}
			if(faccionid == CIH && id == 3) {
			    cache_get_field_content(i, "Nombre", username, mysql, MAX_PLAYER_NAME);
				format(cadena, sizeof(cadena), "{FFFF00}[Facciуn CIH] {FFFFFF}%s Rango: [%i/8]", username, rango);
				SCM(playerid, -1, cadena);
			}
			if(faccionid == SAEM && id == 4) {
			    cache_get_field_content(i, "Nombre", username, mysql, MAX_PLAYER_NAME);
				format(cadena, sizeof(cadena), "{FFFF00}[Facciуn SAEM] {FFFFFF}%s Rango: [%i/8]", username, rango);
				SCM(playerid, -1, cadena);
			}
		}
		if(i == 0) SCM(playerid, COLOR_GRAD, "No hay miembros en la facciуn.");
	}
	return 1;
}
Crash:

Код:
[02:15:20] [debug] Server crashed due to an unknown error
[02:15:20] [debug] Native backtrace:
[02:15:20] [debug] #0 f74d6e8b in _ZN10StackTraceC1EPv () from plugins/crashdetect.so
[02:15:20] [debug] #1 f74cfbcf in _ZN11CrashDetect20PrintNativeBacktraceERSoPv () from plugins/crashdetect.so
[02:15:20] [debug] #2 f74d0dbc in _ZN11CrashDetect20PrintNativeBacktraceEPv () from plugins/crashdetect.so
[02:15:20] [debug] #3 f74d1226 in _ZN11CrashDetect11OnExceptionEPv () from plugins/crashdetect.so
[02:15:20] [debug] #4 f74d6adc in ?? () from plugins/crashdetect.so
[02:15:20] [debug] #5 f77b9410 in ?? ()
[02:15:20] [debug] #6 f7613bf9 in ?? () from /lib/i386-linux-gnu/i686/cmov/libc.so.6
[02:15:20] [debug] #7 f7178ed2 in _ZN11CMySQLQuery11StoreResultEP8st_mysqlP12st_mysql_res () from plugins/mysql_static.so
[02:15:20] [debug] #8 f7179363 in _ZN11CMySQLQuery7ExecuteEP8st_mysql () from plugins/mysql_static.so
[02:15:20] [debug] #9 f71719c6 in _ZN16CMySQLConnection14ProcessQueriesEv () from plugins/mysql_static.so
[02:15:20] [debug] #10 f71724ba in _ZN5boost6detail11thread_dataINS_3_bi6bind_tIvNS_4_mfi3mf0Iv16CMySQLConnectionEENS2_5list1INS2_5valueIPS6_EEEEEEE3runEv () from plugins/mysql_static.so
[02:15:20] [debug] #11 f721d71d in ?? () from plugins/mysql_static.so
[02:15:20] [debug] #12 f7793c39 in ?? () from /lib/i386-linux-gnu/i686/cmov/libpthread.so.0
[02:15:20] [debug] #13 f75d078e in clone () from /lib/i386-linux-gnu/i686/cmov/libc.so.6
R39-3 use the 64-bit version (mysql_static.so)
Help
Reply


Messages In This Thread
Problem: mysql command that causes crash. - by Unrea1 - 28.11.2015, 00:03
Re: Problem: mysql command that causes crash. - by Jefff - 28.11.2015, 00:34
Re: Problem: mysql command that causes crash. - by Unrea1 - 29.11.2015, 01:06
Re: Problem: mysql command that causes crash. - by Unrea1 - 30.11.2015, 12:13
Re: Problem: mysql command that causes crash. - by maddinat0r - 07.12.2015, 09:58

Forum Jump:


Users browsing this thread: 2 Guest(s)