![]() |
|
[Pawn] problem dialog clan members - Printable Version + open.mp forum (https://forum.open.mp) -- Forum: SA-MP (https://forum.open.mp/forumdisplay.php?fid=3) --- Forum: Pawn Scripting (https://forum.open.mp/forumdisplay.php?fid=10) --- Thread: [Pawn] problem dialog clan members (/showthread.php?tid=3793) |
problem dialog clan members - rcst3phan - 2026-01-27 hello, i have a problem too it doesn't display the dialog for clan members, code: case 1: { new szDialog2[1024], Members, name[180], cwarn[180], cdays[180], szRank1[180]; format(query, sizeof(query), "SELECT * FROM `users` WHERE `users`.`Clan` = '%d' ORDER BY `users`.`ClanRank` DESC LIMIT 50", PlayerInfo[playerid][pClan]); new Cache: result = mysql_query(SQL, query); strcat(szDialog2, "#. Name\tRank\tClan Warns\tClan Days\n"); for(new i, j = cache_get_row_count (); i != j; ++i) { cache_get_field_content(i, "Username", name); cache_get_field_content(i, "ClanRank", szRank1); cache_get_field_content(i, "ClanWarns", cwarn); cache_get_field_content(i, "ClanDays", cdays); format(Selected[playerid][Members], MAX_PLAYER_NAME, name); format(szDialog, sizeof(szDialog), "%d. %s\t%d\t%s/3\t%s\n", Members+1, name, strval(szRank1), cwarn, cdays); strcat(szDialog2, szDialog); Members++; } cache_delete(result); ShowPlayerDialog(playerid, DIALOG_CLAN_MEMBERS, DIALOG_STYLE_TABLIST_HEADERS, "Clan members", szDialog2, "Ok", "Back"); } RE: problem dialog clan members - samuelmatheus0502 - 2026-02-05 Could the problem be before even entering that case? Have you tried debugging and validating it? RE: problem dialog clan members - selmir.beha - 2026-02-07 BUFFER OVERFLOW (most likely cause): - szDialog2 is declared with only 1024 bytes - For 50 members, each row can be ~80-100 characters (name, rank, warns, days + tabs) - 50 × ~100 = 5000+ bytes - When strcat() appends more than 1024 bytes, a buffer overflow occurs - This can corrupt memory and the dialog may not show or the server may crash.. Try with this: Code: case 1: {RE: problem dialog clan members - sanmartinjorquerapablo - 2026-02-12 #include <a_samp> #include <streamer> public OnFilterScriptInit() { print("MapIcons cargado correctamente."); // ===== 24/7 ===== CreateDynamicMapIcon(1315.5, -897.6, 39.6, 17, 0); CreateDynamicMapIcon(1352.3, -1759.1, 13.5, 17, 0); CreateDynamicMapIcon(1833.0, -1842.5, 13.5, 17, 0); // ===== Hospital ===== CreateDynamicMapIcon(1172.0, -1323.0, 15.4, 22, 0); CreateDynamicMapIcon(2034.2, -1404.6, 17.2, 22, 0); // ===== Ammu-Nation ===== CreateDynamicMapIcon(1366.2, -1279.8, 13.5, 6, 0); CreateDynamicMapIcon(2400.5, -1981.6, 13.5, 6, 0); // ===== Pay n Spray ===== CreateDynamicMapIcon(1024.0, -1023.0, 32.0, 63, 0); // ===== Banco ===== CreateDynamicMapIcon(1489.8, -1769.5, 18.8, 52, 0); // ===== Casino ===== CreateDynamicMapIcon(1833.0, -1682.4, 13.5, 41, 0); // ===== Bar ===== CreateDynamicMapIcon(2441.2, -1966.5, 13.5, 49, 0); // ===== Gym ===== CreateDynamicMapIcon(2229.7, -1721.0, 13.5, 54, 0); return 1; } |