[Include] lNotifications [Text-Draws Based!]
#1

Hello,
I'm Back With Another Release On The Forum, This Time I Wanted To Create A Include Since I Have Too Many Filterscripts And Game-Modes.


Introduction:
Sends Desired Message To Player In Textdraws

Pictures:


Stocks:
ShowlNotificationForPlayer(playerid, lmsg[], Time)
playerid = Playerid It Will Send The Message
lmsg[] = Your Message Will Come Here
Time = Your Desired Time, It Will Disappear After The Time.


Version 2, Now The Box Has Transparency, Thanks To SuperViper For Suggestion.
Source:
pawn Code:
/* ******** Created By Littlehelper[MDZ] ********** */
/* ******** Dont Remove Any Credits Pl0x :) ******** */

#include <a_samp>

#if defined lNotifications_included
    #endinput
#endif
#define lNotifications_included

new
    Text:lMsg[MAX_PLAYERS];
new
    Text:lMsg2[MAX_PLAYERS];
new
    Text:lMsg3[MAX_PLAYERS];
   
forward HidePlayerNotification(playerid);
public HidePlayerNotification(playerid)
{
    TextDrawHideForPlayer(playerid, Text:lMsg[playerid]);
    TextDrawHideForPlayer(playerid, Text:lMsg2[playerid]);
    TextDrawHideForPlayer(playerid, Text:lMsg3[playerid]);
    return 1;
}
stock lNotificationsInit(playerid)
{
        lMsg[playerid] = TextDrawCreate(648.000000, 433.000000, "                  ");
        TextDrawBackgroundColor(lMsg[playerid], 255);
        TextDrawFont(lMsg[playerid], 1);
        TextDrawLetterSize(lMsg[playerid], 0.720000, 1.500000);
        TextDrawColor(lMsg[playerid], -1);
        TextDrawSetOutline(lMsg[playerid], 0);
        TextDrawSetProportional(lMsg[playerid], 1);
        TextDrawSetShadow(lMsg[playerid], 1);
        TextDrawUseBox(lMsg[playerid], 1);
        TextDrawBoxColor(lMsg[playerid], 0x0000008B);
        TextDrawTextSize(lMsg[playerid], 0.000000, 0.000000);

        lMsg2[playerid] = TextDrawCreate(-50.000000, 433.000000, "                        ");
        TextDrawBackgroundColor(lMsg2[playerid], 255);
        TextDrawFont(lMsg2[playerid], 1);
        TextDrawLetterSize(lMsg2[playerid], 0.500000, 1.000000);
        TextDrawColor(lMsg2[playerid], -1);
        TextDrawSetOutline(lMsg2[playerid], 0);
        TextDrawSetProportional(lMsg2[playerid], 1);
        TextDrawSetShadow(lMsg2[playerid], 1);
        TextDrawUseBox(lMsg2[playerid], 1);
        TextDrawBoxColor(lMsg2[playerid], 0x0000008B);
        TextDrawTextSize(lMsg2[playerid], 0.000000, 6.000000);

        lMsg3[playerid] = TextDrawCreate(173.000000, 436.000000, "Created By Littlehelper[MDZ] Lololololololol");
        TextDrawBackgroundColor(lMsg3[playerid], 255);
        TextDrawFont(lMsg3[playerid], 1);
        TextDrawLetterSize(lMsg3[playerid], 0.280000, 1.000000);
        TextDrawColor(lMsg3[playerid], -1);
        TextDrawSetOutline(lMsg3[playerid], 1);
        TextDrawSetProportional(lMsg3[playerid], 1);
}

stock lNotificationsExit(playerid)
{
        TextDrawHideForPlayer(lMsg[playerid]);
        TextDrawDestroy(lMsg[playerid]);
        TextDrawHideForPlayer(lMsg2[playerid]);
        TextDrawDestroy(lMsg2[playerid]);
        TextDrawHideForPlayer(lMsg3[playerid]);
        TextDrawDestroy(lMsg3[playerid]);
}

stock ShowlNotificationForPlayer(playerid, lmsg[], Time)
{
    TextDrawSetString(Text:lMsg3[playerid], lmsg);
    TextDrawShowForPlayer(playerid, Text:lMsg3[playerid]);
    TextDrawShowForPlayer(playerid, Text:lMsg2[playerid]);
    TextDrawShowForPlayer(playerid, Text:lMsg[playerid]);
    SetTimerEx("HidePlayerNotification",Time,0,"i",playerid);
}
Credits:
Littlehelper[MDZ] - Scripting
SA-MP Team - For SA-MP


Note:
Use "lNotificationsInit(playerid); On Your OnPlayerConnect Callback And "lNotificationsExit(playerid);" On Your OnPlayerDisconnect, Otherwise It Will Not Work!
Reply
#2

Awesome.
Reply
#3

Ugly
Reply
#4

Simple but good
Reply
#5

Not bad.
Reply
#6

Quote:
Originally Posted by Y_Less
View Post
pawn Code:
public OnFilterScriptInit()
{
    return 1;
}
public OnFilterScriptExit()
{
    return 1;
}
There is no need for them to exist, and if there was it wouldn't work in game modes and there is no hooking to allow the original callbacks to get called.
Oh my...
Thank you very much for pointing it out, i tested it as filterscript so they were inside the include by mistake.
Thanks again mate, cheers
Reply
#7

1) Why don't you use player textdraws?
2) Why don't you hook OnPlayerConnect and OnPlayerDisconnect so people don't need to add anything to their callbacks?
Reply
#8

Quote:
Originally Posted by SuperViper
View Post
1) Why don't you use player textdraws?
2) Why don't you hook OnPlayerConnect and OnPlayerDisconnect so people don't need to add anything to their callbacks?
1) Never used them.
2) I like cheese burger.
Reply
#9

Quote:
Originally Posted by FireCat
View Post
Ugly
-.-, are you always like that?


O.T: Good job, but you should add more decorations
Reply
#10

Quote:
Originally Posted by FireCat
View Post
Ugly
Just like you.
Quote:
Originally Posted by Naruto_Emilio
View Post
O.T: Good job, but you should add more decorations
Thanks, suggestions are taken into consideration
Reply
#11

Wow. This is a new way to show message to player. I think its cool. In the end i dont need to use SendClientMessage for every little thing i code!!

Btw what happens , when a ShowlNotificationForPlayer is shown to the playerid and he gets see a new one ?
Reply
#12

So where does it located (On-Screen) ?
Reply
#13

Quote:
Originally Posted by Ballu Miaa
Посмотреть сообщение
Wow. This is a new way to show message to player. I think its cool. In the end i dont need to use SendClientMessage for every little thing i code!!

Btw what happens , when a ShowlNotificationForPlayer is shown to the playerid and he gets see a new one ?
The textdraw for each player will disappear after a amount of time you type.
And that's not a problem, the older one will be over-written if you are too desperate to show a player the textdraw without waiting the amount of time you type in ShowlNotificationForPlayer
Quote:
Originally Posted by xkirill
Посмотреть сообщение
So where does it located (On-Screen) ?
At the lower end bar of the screen.
Reply
#14

Quote:
Originally Posted by Littlehelper[MDZ]
Посмотреть сообщение
The textdraw for each player will disappear after a amount of time you type.
And that's not a problem, the older one will be over-written if you are too desperate to show a player the textdraw without waiting the amount of time you type in ShowlNotificationForPlayer
Now thats cool lol. Thanks for the info! Great release.
Reply
#15

Quote:
Originally Posted by Ballu Miaa
Посмотреть сообщение
Now thats cool lol. Thanks for the info! Great release.
Thanks
Reply
#16

Nice it's useful!
Reply
#17

I recommend using transparency in the box to make it look better.
Reply
#18

Quote:
Originally Posted by SuperViper
Посмотреть сообщение
I recommend using transparency in the box to make it look better.
Updated, thanks for the suggestion.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)