[FilterScript] Textdraw with random messages (simple)
#1

This filterscript was made by me time ago when i start scripting a little stunt server, everything is perfect you just need to edit the messages and create your own textdraw and place it somewhere else if you want too, this is not only a filterscript, you can also place this code in your gamemode insteand of running it as an filterscript.

Simple, fast and easy, rep+ if i helped you!



PHP код:
/*
                    THIS FILTERSCRIPT WAS MADE BY SHENDLAW
                    FOR www.sa-mp.com
*/
//Main FS Include
#include <a_samp>
//Textdraw
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.sa-mp.com",
"~r~Server IP: ~y~37.187.96.190:50322",
"~r~Tutorial by ~y~shendlaw"
};
//Forwards with timer for show and hide the messages, to define when display them and when hide them for display another text.
forward ShowAnnounceTD(playerid);
forward HideAnnounceMessage(playerid);
//Hide when a player selecting class(it looks ugly with the textdraw showing up when you select class)
public OnPlayerRequestClass(playerid)
{
    
TextDrawHideForPlayer(playeridAnnouncesTD);
    return 
1;
}
//Hide the textdraw when player disconnect
public OnPlayerDisconnect(playeridreason)
{
    
TextDrawHideForPlayer(playeridAnnouncesTD);
    return 
1;
}
public 
OnPlayerSpawn(playerid)
{
    
TextDrawShowForPlayer(playeridAnnouncesTD);
    return 
1;
}
//Here you got the textdraw, if you want you can change the position, font, color etc..
public ShowAnnounceTD(playerid
{
        new 
RandomMessage random(sizeof(AnnounceMessage));
        
AnnouncesTD TextDrawCreate(250.000000406.000000AnnounceMessage[RandomMessage]);
        
TextDrawBackgroundColor(AnnouncesTD85);
        
TextDrawFont(AnnouncesTD1);
        
TextDrawLetterSize(AnnouncesTD0.1949991.149999);
        
TextDrawColor(AnnouncesTD, -1);
        
TextDrawSetOutline(AnnouncesTD1);
        
TextDrawSetProportional(AnnouncesTD1);
        
TextDrawShowForPlayer(playerid,AnnouncesTD);
        
SetTimer("HideAnnounceMessage"9000false); //Every 9000ms the textdraw will be hidden, after 9000ms it will be again ready to be displayed.
}
public 
HideAnnounceMessage(playerid)
{
        
TextDrawHideForPlayer(playerid,AnnouncesTD);

Reply
#2

Didnґt work for me.
Reply
#3

lol ! what is that .
Reply
#4

Quote:
Originally Posted by Yzaka
Посмотреть сообщение
Didnґt work for me.
It obviously depends on your GameMode and how long your GM would take to totally spawn player.

And also its kinda useless filterscript but at all its good.
Reply
#5

Quote:
Originally Posted by Alpay0098
Посмотреть сообщение
It obviously depends on your GameMode and how long your GM would take to totally spawn player.

And also its kinda useless filterscript but at all its good.
What's your definition of useless? It has a use; therefore, it isn't useless.

Good job.
Reply
#6

Not Bad
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)