SA-MP Forums Archive
[Include] PlayerTextDrawStreamer - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] PlayerTextDrawStreamer (/showthread.php?tid=647392)



PlayerTextDrawStreamer - kristo - 04.01.2018

PlayerTextDrawStreamer


Introduction

By default, SA-MP allows servers to create just 256 player textdraws per player. Many scripters, including myself have run into the issue of hitting that limit. While attempting to solve the issue, I found an old include created by theYiin that he had created for the same reason. Due to the include being abandoned and having many issues, I had to make many changes to it and now I've decided to release it give something back to the community.


Dependencies
Installation

Simply install to your project:

Код:
sampctl package install kristoisberg/PlayerTextDrawStreamer
Include in your code and begin using the library:

PHP код:
#include <PlayerTextDrawStreamer> 
Usage

The include is completely plug & play. Simply follow the installation steps and your player textdraw limit has magically* been doubled.

The new limit of player textdraws has been set to 512 by default. If you wanna change it, simply define MAX_PLAYER_TEXTDRAWS with your own value before including PlayerTextDrawStreamer.

* - The player textdraws are only created when they are visible on the player's screen.


Functions

The following functions are added by the include and are completely compatible with YSF when it's also being used.

PHP код:
native IsValidPlayerTextDraw(playeridPlayerText:text);
native IsPlayerTextDrawVisible(playeridPlayerText:text);
native PlayerTextDrawGetString(playeridPlayerText:textstring[], len sizeof(string));
native PlayerTextDrawGetLetterSize(playeridPlayerText:text, &Float:x, &Float:y);
native PlayerTextDrawGetTextSize(playeridPlayerText:text, &Float:x, &Float:y);
native PlayerTextDrawSetPos(playeridPlayerText:textFloat:xFloat:y);
native PlayerTextDrawGetPos(playeridPlayerText:text, &Float:x, &Float:y);
native PlayerTextDrawGetColor(playeridPlayerText:text);
native PlayerTextDrawGetBoxColor(playeridPlayerText:text);
native PlayerTextDrawGetBackgroundCol(playeridPlayerText:text);
native PlayerTextDrawGetShadow(playeridPlayerText:text);
native PlayerTextDrawGetOutline(playeridPlayerText:text);
native PlayerTextDrawGetFont(playeridPlayerText:text);
native PlayerTextDrawIsBox(playeridPlayerText:text);
native PlayerTextDrawIsProportional(playeridPlayerText:text);
native PlayerTextDrawIsSelectable(playeridPlayerText:text);
native PlayerTextDrawGetAlignment(playeridPlayerText:text);
native PlayerTextDrawGetPreviewModel(playeridPlayerText:text);
native PlayerTextDrawGetPreviewRot(playeridPlayerText:text, &Float:fRotX, &Float:fRotY, &Float:fRotZ, &Float:fZoom);
native PlayerTextDrawGetPreviewVehCol(playeridPlayerText:text, &color1, &color2); 
Notes

Credits

Download

https://github.com/kristoisberg/PlayerTextDrawStreamer


Re: PlayerTextDrawStreamer - Florin48 - 04.01.2018

Work good? No crash game or lag server?


Re: PlayerTextDrawStreamer - RogueDrifter - 04.01.2018

Quote:
Originally Posted by Florin48
Посмотреть сообщение
Work good? No crash game or lag server?
Quote:

Only 256 player textdraws can be displayed at once per player.

i'd say yeah.