Jump to content

segmentationfault

Membru
  • Posts

    286
  • Joined

  • Last visited

  • Days Won

    83

segmentationfault last won the day on April 10

segmentationfault had the most liked content!

2 Followers

Recent Profile Visitors

5.758 profile views

segmentationfault's Achievements

Community Regular

Community Regular (8/14)

  • Very Popular Rare
  • Reacting Well Rare
  • Dedicated Rare
  • First Post
  • Collaborator

Recent Badges

177

Reputation

  1. faci mai multi bani daca-ti iei o bicicleta si faci glovo/bolt food.
  2. mai degraba jucatorii vechi de sa-mp ar juca, dar majoritatea au o varsta la care muncesc, au familie.
  3. Mai degrabă învață prompt engineering înainte să vorbești despre AI. Sunt inginer software de meserie, cu studii de licență, pentru context. Dacă un proiect are contextul setat, modelul potrivit, prompturi clare și instrucțiuni tehnice, în 60-70% din cazuri face o treabă bună. Nu va fi perfect de fiecare dată, are nevoie de îndrumări constante. Majoritatea îl folosesc ca pe un junior sau mid, ca pe un sclav pe plantație, iar prin iterații de feedback ajunge la un rezultat ok. Dar da, dacă nu știi meserie și folosești AI, probabil îți va oferi rezultate proaste sau mediocre. În momentul în care știi cum trebuie să arate outputul, tu doar îl ghidezi spre acel rezultat cu experiența ta. Astfel ajungi să livrezi mult mai repede.
  4. The reason your members aren't showing up is likely due to how MySQL caches and String Concatenation behave in PAWN when buffers are mismanaged. The "Ghost" Logic Bugs The szDialog Confusion: In your original code, you used szDialog inside the loop but declared szDialog2 outside. If szDialog wasn't properly initialized or was too small, strcat(szDialog2, szDialog) would append empty or garbage data. The Members Variable: You declared new Members; but never initialized it to 0. In some compiler versions, uninitialized locals can contain random "garbage" values from the stack. If Members started at a huge number, Selected[playerid][Members] would cause a memory out-of-bounds error, potentially crashing the script before it reached the dialog. Buffer Overflow: With 50 members, your szDialog2[1024] was likely hitting its limit. When a string in PAWN exceeds its size during a format or strcat, it can null-terminate prematurely or cause the script to bail out. The Fixed Logic Here is the corrected logic. I have also moved the variables to be more memory-efficient and added an explicit initialization for the counter. Code snippet case 1: { // Use a static buffer to prevent stack exhaustion static szBigDialog[3000]; new query[128], rows; format(query, sizeof(query), "SELECT `Username`, `ClanRank`, `ClanWarns`, `ClanDays` FROM `users` WHERE `Clan` = '%d' ORDER BY `ClanRank` DESC LIMIT 50", PlayerInfo[playerid][pClan]); new Cache:result = mysql_query(SQL, query); cache_get_row_count(rows); // Reset the buffer and the member counter szBigDialog[0] = EOS; strcat(szBigDialog, "#. Name\tRank\tClan Warns\tClan Days\n"); if(rows == 0) { strcat(szBigDialog, " \tNo members found\t \t "); } else { new tempName[MAX_PLAYER_NAME], tempRank, tempWarns, tempDays; new rowEntry[128]; for(new i = 0; i < rows; i++) { // Extracting data correctly cache_get_value_name(i, "Username", tempName, sizeof(tempName)); cache_get_value_name_int(i, "ClanRank", tempRank); cache_get_value_name_int(i, "ClanWarns", tempWarns); cache_get_value_name_int(i, "ClanDays", tempDays); // Store name for the OnDialogResponse selection format(Selected[playerid][i], MAX_PLAYER_NAME, tempName); // Build the row format(rowEntry, sizeof(rowEntry), "%d. %s\t%d\t%d/3\t%d\n", i + 1, tempName, tempRank, tempWarns, tempDays); // Append to the big string strcat(szBigDialog, rowEntry); } } cache_delete(result); ShowPlayerDialog(playerid, DIALOG_CLAN_MEMBERS, DIALOG_STYLE_TABLIST_HEADERS, "Clan members", szBigDialog, "Select", "Back"); } Why this version works: Initialization: szBigDialog[0] = EOS ensures you aren't appending to old data left in memory. Safety: Using rows directly from cache_get_row_count ensures the loop only runs exactly as many times as there are results. Proper Indices: Using i as the index for Selected[playerid][i] ensures that the row number in the dialog matches the ID in your array perfectly. Column Names: Ensure your SQL column names (Username, ClanRank, etc.) match your database exactly. MySQL is case-sensitive on some Linux distributions. A Note on Selected[playerid] Make sure your Selected array is large enough to hold the names! It should be defined globally like this: new Selected[MAX_PLAYERS][50][MAX_PLAYER_NAME]; If it’s defined as [MAX_PLAYERS][MAX_PLAYER_NAME], you are trying to store 50 names into a single string slot, which will overwrite the previous name every time. Would you like me to check how you've defined the Selected variable to make sure it can handle 50 members?
  5. https://claude.com/solutions/coding
  6. cea mai proasta investitie in 2026 e sa scrii cod de mana. incercati Claude varianta platita, va face ce vreti voi daca stiti cum trebuie sa arate rezultatul (tehnic).
  7. de ce ai vrea sa inveti PAWN :))?
  8. uneori stau si ma gandesc ce este in capul oamenilor care isi doresc "o comunitate stabila si bine organizata" intr-un joc scos de mai bine de 20 de ani. singurii care isi mai aduc aminte de jocul asta sunt persoanele nascute din 1995-2005, iar astia ori sunt la facultate, ori lucreaza. cine dracu' la +20 de ani are timp sa se joace SA-MP?
  9. de ce trebuie sa puneti pe TikTok o prezentare si sa puneti manele?
  10. pune un env sau variabila cu `PRODUCTION`, daca e 0 faci auto-login, daca e 1 trebuie sa bage parola.
  11. kappa.
  12. Ninja a inchiriat domeniul, iar FarSe/Marijuana au finantat. Nici voi nu ati avut cu adevarat domeniul pana cand nu l-a cumparat Woops. "Faceam parte din staff", dar eram singurul care se ocupa administrativ si singurul care aducea modificari la website, plus access la tot ce insemna VPS. And let's be honest, Farse in afara sa se flexeze cu banii facuti te miri cum pe forum, sa injure cum voia si sa mai bage niste security fixes ca-l ardea Federel undeva, nu mai facea nimic. Iar legat de ajutor, da. Nimeni nu neaga asta, problema era cand unii deveneau agresivi de parca erai sclavul lor si erai obligat sa ii ajuti gratuit. a'right mate.
  13. Am avut sa-mp.ro atunci. Ce sa zic cand lumea la "Ajutor" imi zicea ca sunt obligat sa le rezolv lor bug-urile gratis pe timpul meu liber
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.