Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- RANDOM TEXTDRAW MESSAGES FILTERSCRIPT BY REMBA031
- */
- #include <a_samp>
- #define FILTERSCRIPT
- #if defined FILTERSCRIPT
- #define NEW_RANDOM_MESSAGE 20 // Every 20 seconds new random message will appear
- #define SERVER_NAME_COLOR 0xB8860BAA // The color of the server name
- #define SERVER_NAME "THE BEST SERVER" // Your server name
- new Text:RandomMessage;
- new messagestring[256];
- new RandomMSG[][] =
- {
- "Random Message 1",
- "Random Message 2",
- "Random Message 3"
- };
- forward SendMSG();
- public OnFilterScriptInit()
- {
- print("\n------------------------------------------------");
- print("Random TextDraw messages by Remba031 loaded.");
- print("------------------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- print("\n------------------------------------------------");
- print("Random TextDraw messages by Remba031 unloaded.");
- print("------------------------------------------------\n");
- return 1;
- }
- public OnGameModeInit()
- {
- RandomMessage = TextDrawCreate(20.0,430.0,"[SERVERNAME] Random message");
- TextDrawFont(RandomMessage,1);
- TextDrawColor(RandomMessage,SERVER_NAME_COLOR);
- TextDrawSetShadow(RandomMessage,0);
- TextDrawSetOutline(RandomMessage,1);
- SetTimer("SendMSG",NEW_RANDOM_MESSAGE*1000, true);
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- TextDrawShowForPlayer(playerid,RandomMessage);
- return 1;
- }
- public SendMSG()
- {
- new randMSG = random(sizeof(RandomMSG));
- format(messagestring,sizeof(messagestring),"[%s] ~w~%s",SERVER_NAME,RandomMSG[randMSG]);
- TextDrawSetString(RandomMessage,messagestring);
- }
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement