Burgershot
  • Home
  • Members
  • Team
  • Help
  • Search
  • Register
  • Login
  • Home
  • Members
  • Help
  • Search
Burgershot SA-MP Releases Libraries [Library] td-notification

 
  • 0 Vote(s) - 0 Average
Library td-notification
ThePez
Offline

Desarrollador
Posts: 21
Threads: 8
Joined: Apr 2019
Reputation: 0
#1
2020-04-05, 06:37 PM (This post was last modified: 2020-04-05, 06:40 PM by ThePez.)
td-notification

[Image: 68747470733a2f2f696d672e736869656c64732e...6261646765]

This Include allows you to create TextDraw Notifications

[Image: 68747470733a2f2f692e6962622e636f2f704c48...382e706e67]


Installation

Simply install to your project:

Code:
sampctl package install ThePez/td-notification

Include in your code and begin using the library:

Code:
#define TDN_MODE_DEFAULT
#include <td-notification>

Usage
  • MAX_TDN: set how many TextDraw will be shown in TextDraw's Notification

  • TDN_POS_X: TextDraw notifications will be at the position set on the X axis

  • TDN_POS_Y: TextDraw notifications will be at the position set on the Y axis

  • TDN_FONT: TextDraw Notification will have the set font

  • TDN_LETTER_SIZE_X: TextDraw notifications will have the set font size on the X axis

  • TDN_LETTER_SIZE_Y: TextDraw notifications will have the set font size on the Y axis

  • TDN_SIZE: TextDraw notifications will have the set width size

  • TDN_COLOR: TextDraw notifications will have the set font color

  • TDN_COLOR_BOX: TextDraw notifications will have the set box color

  • TDN_PROPORTIONAL: TextDraw notifications will have the set proportional

  • TDN_DISTANCE: TextDraw notifications will have the set distance

  • MAX_TDN_TEXT: TextDraw notifications will have a maximum the set text

  • TDN_MODE_DOWN: TextDraw notifications will scroll down

  • TDN_MODE_UP: TextDraw notifications will scroll up

  • TDN_TIME: TextDraw notifications will hide at the set time

  • TDN_MODE_DEFAULT: TextDraw notifications will use the default settings
Function

Code:
ShowTDN(playerid, const reason[], hide = -1);

Shows a textdraw with the set text
  • If you pass the hide parameter, the same thing will return (this is the id of the TextDraw)
Normal functioning: the TextDraw will be automatically hidden, with the time set in TDN_TIME (no need to use HideTDN)
  • Returns 1, if the textdraw is shown, perfectly

  • Returns 0, if the text drawing could not be displayed (there are as many TextDraws displayed as set in MAX_TDN)

Code:
HideTDN(playerid, TDN);

Hides the textdraw

You must pass the id that returned the function ShowTDN
  • Returns 1, if the textdraw was hidden, perfectly

  • Returns 0, if the id passed in the function was not found

Testing

To test, simply run the package:
Code:
sampctl package run


Credits
  • ThePez - Creator of the include

  • NaS - helped me gather information to make the include, also helped me somewhere in the code

  • Kristo - Creator of the samp-td-string-width include, it helped me to calculate the width of the TextDraw

  • Y_less - Creator of the YSI include

https://youtu.be/8QKCcM6X14w
[Image: Fondo.jpg]
Dawkin
Offline

Burgershot Member
Posts: 7
Threads: 1
Joined: May 2019
Reputation: 1
Location: Vietnam
#2
2020-04-06, 06:27 AM
Simply, useful, nice work.
Three things you should know about this life:
Do not trust anyone.
Do not beg anyone.
Do not expect anything from anyone.
« Next Oldest | Next Newest »



  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Burgershot - Powered by our Community and MyBB Original Theme by Emerald

Linear Mode
Threaded Mode