[FilterScript] Announces Textdraw
#1

Announces Textdraw
Hi sa-mp forums users, this is a old script made by me for my server, you can put this script on a gamemode too, it will work without problems, for a preview click me.

Code:
/*

					THIS FILTERSCRIPT WAS MADE BY SHENDLAW
					FOR www.sa-mp.com

*/

//Main FS Includes
#include <a_samp>

//Textdraw related
new Text:AnnouncesTD;

//Announces, edit 3 number in AnnounceMessages[3] like you want to put 10 announces set from 3 to 10 etc..
new AnnounceMessage[3][] = {
"~r~Visit ~y~www.rbkbrigades.com",
"~r~Server IP: ~y~192.168.1.2:7777",
"~r~Tutorial by ~y~shendlaw"
};

//Forwards with timers for show and hide the messages, to define when display them and when hide them for display another text.
forward ShowAnnounceTD();
forward HideAnnounceMessage();

//Hiding the textdraw when it not needed, also if you need to hide it somewhere else add this code always TextDrawHideForPlayer(playerid, AnnouncesTD);
public OnPlayerRequestClass(playerid, classid)
{
    TextDrawHideForPlayer(playerid, AnnouncesTD);
	return 1;
}

public OnPlayerConnect(playerid)
{
    TextDrawHideForPlayer(playerid, AnnouncesTD);
	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    TextDrawHideForPlayer(playerid, AnnouncesTD);
	return 1;
}

public OnPlayerSpawn(playerid)
{
    TextDrawHideForPlayer(playerid, AnnouncesTD);
	return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    TextDrawHideForPlayer(playerid, AnnouncesTD);
	return 1;
}

public OnPlayerRequestSpawn(playerid)
{
    TextDrawHideForPlayer(playerid, AnnouncesTD);
	return 1;
}

//Here you got the textdraw, if you want you can change the position, font, color etc..
public ShowAnnounceTD() {
        new RandomMessage = random(sizeof(AnnounceMessage));
        AnnouncesTD = TextDrawCreate(250.000000, 406.000000, AnnounceMessage[RandomMessage]);
        TextDrawBackgroundColor(AnnouncesTD, 85);
        TextDrawFont(AnnouncesTD, 1);
        TextDrawLetterSize(AnnouncesTD, 0.194999, 1.149999);
        TextDrawColor(AnnouncesTD, -1);
        TextDrawSetOutline(AnnouncesTD, 1);
        TextDrawSetProportional(AnnouncesTD, 1);
        TextDrawShowForAll(AnnouncesTD);
        SetTimer("HideAnnounceMessage", 9000, false); //Every 9000ms the textdraw will be hidden, after 9000ms it will be again ready to be displayed.
}

public HideAnnounceMessage() {
        TextDrawHideForAll(AnnouncesTD);
}
Credits goes to me.
Reply
#2

Good Job Keep it up
Reply
#3

Good job!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)