[Include] PlayerTextDraw Streamer
#1

SA-MP TextDraws limit per player is 256. It means, that you can create only 256 texdraws per player (doh).
Because I exceed that limit, you get this include ^^
pawn Код:
#define LIMIT_OF_PLAYER_TEXT_DRAWS 1000 // The new limit of PlayerTextDraw's
You can only show maximum 256 of playertextdraws at once on player screen!

Usage:

1. Download: http://pastebin.com/iHFgG6Ai
2. Save code to PlayerTextDrawStreamer.inc file
3. Put this file to pawno/includes folder.
4. On the top of gamemode put #include <PlayerTextDrawStreamer>
5. OnPlayerClickPlayerTextDraw callback located in your GM file rename to OnPlayerClickPTextdraw
6. Compile GM. That's all.

Update log:
v1.1 - Fixed OnPlayerClickPlayerTextDraw hook.
v1.0 - Added OnPlayerDisconnect hook to destroy any created player textdraws
v0.9 - initial release

Write your questions and found bugs (shouldn't be any) in this thread.
Reply
#2

good job!
Reply
#3

Seems like a of extra overhead to me, if you have more than 256 player textdraws your probably ignoring the fact of using global textdraws for any static textdraws. It could be useful in certain circumstances but you would actually have to have over 256 player textdraws before that happens and again with proper textdraw management that isn't easy to reach.
Reply
#4

Quote:
Originally Posted by Pottus
Посмотреть сообщение
Seems like a of extra overhead to me, if you have more than 256 player textdraws your probably ignoring the fact of using global textdraws for any static textdraws. It could be useful in certain circumstances but you would actually have to have over 256 player textdraws before that happens and again with proper textdraw management that isn't easy to reach.
It totally depends on what you are drawing.

Inventory:
new Text:TD.Inventory[14];
new PlayerText: pTD.Inventory[MAX_PLAYERS][53];
pic: http://i.imgur.com/HY0DMUn.jpg

Container:
new Text:TD.Container[21];
new PlayerText:pTD.Container.Left[MAX_PLAYERS][46];
new PlayerText:pTD.Container.Right[MAX_PLAYERS][45];
pic: http://i.imgur.com/8sPndjP.jpg

Garage:
new Text:TD.Garage[44];
new PlayerText:pTD.Garage[23][MAX_PLAYERS];
pic: http://i.imgur.com/SkK13HF.jpg

not counting other things.

Stuff like this requires a lot of textdraws.
Reply
#5

good work
Reply
#6

That is why I said it could be useful in certain circumstances lol.
Reply
#7

Nice include!
Reply
#8

Updated: http://pastebin.com/iHFgG6Ai
Reply
#9

Good jo my friend.
Reply
#10

Why did you use ALS to hook OnPlayerDisconnect but y_hooks to hook OnPlayerClickPlayerTextDraw?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)