IS4Code / YSF

YSF Server Functions
Other
98 stars 34 forks source link

Global TextDraw functions per-player #53

Open IstuntmanI opened 7 years ago

IstuntmanI commented 7 years ago

For example, TextDrawSetString sends a RPC to all players, even if they are AFK. With a TextDrawSetStringForPlayer function we could improve it and stop it from affecting AFK players, therefore limiting the RPCs in queue. It will reduce the probability for them to receive a kick for too many RPCs/packets received/sent: '[warning] client exceeded 'messageslimit' IP:port (X) Limit: Y/sec' '[warning] client exceeded 'messageholelimit' IP:port (X) Limit: Y' (not sure which one of them is caused by those RPCs sent to AFK players, probably the 'messageslimit' one)

ghost commented 7 years ago

https://github.com/kurta999/YSF/commit/f9394c9d127b1461214fa05ee335b6631a29b862#diff-87dfefaed993171c340cac919e651cb6R3566

IstuntmanI commented 7 years ago

Great. Other global textdraw functions should also have per-player alternatives:

native TextDrawLetterSize(Text:text, Float:x, Float:y);
native TextDrawTextSize(Text:text, Float:x, Float:y);
native TextDrawAlignment(Text:text, alignment);
native TextDrawColor(Text:text, color);
native TextDrawUseBox(Text:text, use);
native TextDrawBoxColor(Text:text, color);
native TextDrawSetShadow(Text:text, size);
native TextDrawSetOutline(Text:text, size);
native TextDrawBackgroundColor(Text:text, color);
native TextDrawFont(Text:text, font);
native TextDrawSetProportional(Text:text, set);
native TextDrawSetSelectable(Text:text, set);
native TextDrawSetString(Text:text, string[]);
native TextDrawSetPreviewModel(Text:text, modelindex);
native TextDrawSetPreviewRot(Text:text, Float:fRotX, Float:fRotY, Float:fRotZ, Float:fZoom = 1.0);
native TextDrawSetPreviewVehCol(Text:text, color1, color2);

(if it is possible for everything)

ghost commented 7 years ago

It's possible, but from my view it would be very messy. Global textdraws, globals for player & player textdrwas. wtf :D

IstuntmanI commented 7 years ago

Yeah, I know. Haha. But it helps with the thing I described, bandwidth saving.

ghost commented 7 years ago

If you do it, create a pull request i will merge it xD its not reall hard just time consuming which is problem for me at the moment.

ghost commented 7 years ago

Hmm might i will do it..