[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


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)