Skip to content

Make textdraw pool limits runtime configurable - #1250

Open
itsneufox wants to merge 4 commits into
openmultiplayer:masterfrom
itsneufox:textdraw-limits
Open

Make textdraw pool limits runtime configurable#1250
itsneufox wants to merge 4 commits into
openmultiplayer:masterfrom
itsneufox:textdraw-limits

Conversation

@itsneufox

Copy link
Copy Markdown
Contributor

Kept the SDK defaults unchanged. Nothing changes unless the user explicitly sets:

      "textdraw": {
          "global_limit": 256,
          "player_limit": 2048
      }

Legacy server.cfg options are also supported:

max_global_textdraws 256
max_player_textdraws 2048

Custom limits are reported during startup. If an invalid value is provided, the default is used instead.

@itsneufox
itsneufox marked this pull request as draft August 2, 2026 18:37
@itsneufox
itsneufox marked this pull request as ready for review August 2, 2026 18:57
@Pato-Pastor

Copy link
Copy Markdown

rare neufox W

const int globalLimit = configuredGlobalLimit ? *configuredGlobalLimit : GLOBAL_TEXTDRAW_POOL_SIZE;
const int playerLimit = configuredPlayerLimit ? *configuredPlayerLimit : PLAYER_TEXTDRAW_POOL_SIZE;
const long long totalLimit = static_cast<long long>(globalLimit) + static_cast<long long>(playerLimit);
if (globalLimit < 0 || playerLimit < 0 || totalLimit > INVALID_TEXTDRAW)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

INVALID_TEXTDRAW is 0xFFFF (65535), max textdraws should be 2304 (global + player). You should fix the totalLimit > INVALID_TEXTDRAW check.

@itsneufox itsneufox Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about custom launchers that allow more?

I tested a patched samp.dll and the game can go above the 2304 limit just fine

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about custom launchers that allow more?

I tested a patched samp.dll and the game can go above the 2304 limit just fine

That's a fair point, but IIRC the maintainers still don't support configuration for custom launchers.

I think there were PRs/suggestions to allow customizing max vehicle models, weapons, or something similar... Maybe @AmyrAhmady can confirm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants