Textdraws Plugin?
#1

Just wondering, is there any plugin that lets you have over the limit of 2.048 textdraws in SA:MP? I'm making an RP server and I use a lot of textdraws, around 25 per each connected player, displayed at the same time. Any suggestions on how to reduce this number or increase the limit?
Reply
#2

Use dialog, i think it's good.
What do you mean "use around 25 per each connected player"?
I think it's only count when you create in your mode..
Reply
#3

Quote:
Originally Posted by dieuhanhphuc
Посмотреть сообщение
Use dialog, i think it's good.
What do you mean, "use around 25 per each connected player"
Every player that is online on the server will have at least 25 textdraws displayed on his screen.
Reply
#4

Quote:
Originally Posted by SmoW
Посмотреть сообщение
Every player that is online on the server will have at least 25 textdraws displayed on his screen.
U're using PlayerTextDraw, right?
i think maybe u should use global TextDraw for not-changed Textdraw
Reply
#5

Quote:
Originally Posted by dieuhanhphuc
Посмотреть сообщение
U're using PlayerTextDraw, right?
i think maybe u should use global TextDraw for not-changed Textdraw
Yes I use PlayerTextDraw, but I need to use it like this since they are based only for EACH player's stats such as Hunger bar, Thirst bar etc-.., if I use Global ones, it will be a real mess
Reply
#6

Quote:
Originally Posted by SmoW
Посмотреть сообщение
Yes I use PlayerTextDraw, but I need to use it like this since they are based only for EACH player's stats such as Hunger bar, Thirst bar etc-.., if I use Global ones, it will be a real mess
Textdraw is exactly like PlayerTextDraw, u can change the value of it too.
The difference is that textdraw is forced created in your mode, so it's used for all players, when u hide, it's still create.
About Playertextdraw, it can only create for one player, so only that player can use it, the other don't, so it help u save a little resources.
Depening on your purpose, u just choose 1 and use.
In your case, i think u should change your PlayerTextDraw to TextDraw
Reply
#7

Using Global textdraws for player-specific text is asking for trouble.
These are only good when you want to show something to all players at once, like an announcement.
TextDrawSetString sets the text and updates it for all players where the textdraw is being shown.
Details like colors or font only update on your screen after using the appropriate editing functions followed by TextDrawShowForPlayer.

For player-specific text like HP, hunger, ... use playertextdraws.
You can have up to 256 of them PER PLAYER at once.
With 100 players, that's 25600 textdraws, which should be enough.
Reply
#8

If you need more than 2048 textdraws you are not scripting correctly.
Reply
#9

Two types of textdraws. Globals, and player based. Each player can see 1024 global and 1024 player textdraws.
Player based textdraws are only for one player, so creating 50 textdraws for one player, does not mean that you have 50 textdraws less for other players, as that textdraws are not meant for them.

TextDrawSetString belongs to global textdraw functions, and it only changes the string of the textdraw. If you want player to see that new string, you need to call TextDrawShowForPlayer or TextDrawShowForAll function (if textdraw is already shown, it will just update it).

Things specific for player are supposed to be created with Player Textdraws (like hunger, score, etc..) Things that are same for everyone like team score, server name, or just some info on screen like random messages for everyone, that is supposed to be created with global textdraws.

Also if you are so short on textdraws, create player textdraws only when you need them, and delete when you dont...
Reply
#10

Quote:
Originally Posted by DRIFT_HUNTER
Посмотреть сообщение
Two types of textdraws. Globals, and player based. Each player can see 1024 global and 1024 player textdraws.
Player based textdraws are only for one player, so creating 50 textdraws for one player, does not mean that you have 50 textdraws less for other players, as that textdraws are not meant for them.

TextDrawSetString belongs to global textdraw functions, and it only changes the string of the textdraw. If you want player to see that new string, you need to call TextDrawShowForPlayer or TextDrawShowForAll function (if textdraw is already shown, it will just update it).

Things specific for player are supposed to be created with Player Textdraws (like hunger, score, etc..) Things that are same for everyone like team score, server name, or just some info on screen like random messages for everyone, that is supposed to be created with global textdraws.

Also if you are so short on textdraws, create player textdraws only when you need them, and delete when you dont...
OMG, finally, hug me...my friend!!
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)