stock CarregarCasas()
{
new DBResult:Consulta = db_query(Users, "SELECT * FROM `CASA`");
new rows = db_num_rows(Consulta);
if(!rows) return print("Nгo tem casas para serem carregadas");
for(new i; i < rows; i++);
{
db_get_field_assoc(Consulta, "NOME", CasaInfo[i][NOME], 100);
db_get_field_assoc(Consulta, "PRECO", str, 15);
CasaInfo[i][PRECO] = strval(str);
db_get_field_assoc(Consulta, "LEVEL", str, 4);
CasaInfo[i][LEVEL] = strval(str);
printf("Level: %d",CasaInfo[i][LEVEL]);
db_get_field_assoc(Consulta, "DONO", CasaInfo[i][DONO], 24);
printf("Dono: %s", CasaInfo[i][DONO]);
db_get_field_assoc(Consulta, "ENTRADAX", str, 15);
CasaInfo[i][POSICAO][0] = floatstr(str);
printf("X: %f", floatstr(str));
db_get_field_assoc(Consulta, "ENTRADAY", str, 15);
CasaInfo[i][POSICAO][1] = floatstr(str);
printf("Y: %f", floatstr(str));
db_get_field_assoc(Consulta, "ENTRADAZ", str, 15);
CasaInfo[i][POSICAO][2] = floatstr(str);
printf("Z: %f", floatstr(str));
CasaInfo[i][CHECK][0] = CreateDynamicCP(CasaInfo[i][POSICAO][0], CasaInfo[i][POSICAO][1], CasaInfo[i][POSICAO][2], 1.0);
if(CasaInfo[i][LEVEL] == 1)
{
CasaInfo[i][SAIDA][0] = 223.1482;
CasaInfo[i][SAIDA][1] = 1287.8635;
CasaInfo[i][SAIDA][2] = 1082.1406;
CasaInfo[i][INTERIOR] = 1;
CasaInfo[i][CHECK][1] = CreateDynamicCP(CasaInfo[i][SAIDA][0], CasaInfo[i][SAIDA][1], CasaInfo[i][SAIDA][2], 1.0, 15500000+casaid, CasaInfo[i][INTERIOR]);
}
if(!CasaInfo[i][DONO][0]) format(str, sizeof(str), "Propiedade: %s \n Preзo:$%d \n Nivel: %d", CasaInfo[i][NOME], CasaInfo[i][PRECO], CasaInfo[casaid][LEVEL]);
else if(CasaInfo[i][DONO][0] != 0) format(str, sizeof(str), "Propiedade: %s \n Dono: %s", CasaInfo[i][NOME], CasaInfo[i][DONO]);
CasaInfo[i][LABEL] = CreateDynamic3DTextLabel(str, -1, CasaInfo[i][POSICAO][0], CasaInfo[i][POSICAO][0], CasaInfo[i][POSICAO][0] + 0.5, 10.0);
//SetarDono(CasaInfo[i][NOME], CasaInfo[i][DONO], i);
casaid++;
db_next_row(Consulta);
}
db_free_result(Consulta);
printf("Fields: %d", db_num_fields(Consulta));
printf("%d Casas Carregadas!", rows);
return true;
}
b) Install the crashdetect plugin and compile with debug options
|
[10:51:29] Level: 1 [10:51:29] Dono: Game_Developer [10:51:29] X: 2385.333496 [10:51:29] Y: -1712.134643 [10:51:29] Z: 14.242186 [10:51:29] Level: 1 [10:51:29] [debug] Server crashed while executing sqlite.amx [10:51:29] [debug] AMX backtrace: [10:51:29] [debug] #0 native db_get_field_assoc () [0044de30] from samp-server.exe [10:51:29] [debug] #1 000122c8 in ?? () from sqlite.amx [10:51:29] [debug] #2 000067e8 in public SSCANF_OnGameModeInit () from sqlite.amx [10:51:29] [debug] #3 00000740 in public zcmd_OnGameModeInit () from sqlite.amx [10:51:29] [debug] #4 native CallLocalFunction () [00471e90] from samp-server.exe [10:51:29] [debug] #5 00000210 in public OnGameModeInit () from sqlite.amx [10:51:29] [debug] Native backtrace: [10:51:29] [debug] #0 0044dad1 in ?? () from C:\Users\Mateus Roberto\Documents\Servidor\Servidor Pasta\samp-server.exe [10:51:29] [debug] #1 004010b6 in ?? () from C:\Users\Mateus Roberto\Documents\Servidor\Servidor Pasta\samp-server.exe [10:51:29] [debug] #2 6f3c60ba in ?? () from C:\Users\Mateus Roberto\Documents\Servidor\Servidor Pasta\plugins\crashdetect.DLL [10:51:29] [debug] #3 6f3c7fee in ?? () from C:\Users\Mateus Roberto\Documents\Servidor\Servidor Pasta\plugins\crashdetect.DLL [10:51:29] [debug] #4 6f3c0091 in ?? () from C:\Users\Mateus Roberto\Documents\Servidor\Servidor Pasta\plugins\crashdetect.DLL [10:51:29] [debug] #5 6f3c610a in ?? () from C:\Users\Mateus Roberto\Documents\Servidor\Servidor Pasta\plugins\crashdetect.DLL [10:51:29] [debug] #6 0047219e in ?? () from C:\Users\Mateus Roberto\Documents\Servidor\Servidor Pasta\samp-server.exe [10:51:29] [debug] #7 004010b6 in ?? () from C:\Users\Mateus Roberto\Documents\Servidor\Servidor Pasta\samp-server.exe [10:51:29] [debug] #8 6f3c60ba in ?? () from C:\Users\Mateus Roberto\Documents\Servidor\Servidor Pasta\plugins\crashdetect.DLL [10:51:29] [debug] #9 6f3c7fee in ?? () from C:\Users\Mateus Roberto\Documents\Servidor\Servidor Pasta\plugins\crashdetect.DLL [10:51:29] [debug] #10 6f3c0091 in ?? () from C:\Users\Mateus Roberto\Documents\Servidor\Servidor Pasta\plugins\crashdetect.DLL [10:51:29] [debug] #11 6f3c610a in ?? () from C:\Users\Mateus Roberto\Documents\Servidor\Servidor Pasta\plugins\crashdetect.DLL [10:51:29] [debug] #12 0046e194 in ?? () from C:\Users\Mateus Roberto\Documents\Servidor\Servidor Pasta\samp-server.exe [10:51:29] [debug] #13 65646f6d in ?? () from C:\Users\Mateus Roberto\Documents\Servidor\Servidor Pasta\samp-server.exe [10:51:29] [debug] #14 71732f73 in ?? () from C:\Users\Mateus Roberto\Documents\Servidor\Servidor Pasta\samp-server.exe [10:51:29] [debug] #15 6574696c in ?? () from C:\Users\Mateus Roberto\Documents\Servidor\Servidor Pasta\samp-server.exe [10:51:29] [debug] #16 786d612e in ?? () from C:\Users\Mateus Roberto\Documents\Servidor\Servidor Pasta\samp-server.exe
[10:51:29] [debug] #0 native db_get_field_assoc () [0044de30] from samp-server.exe