Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #define CURRENT_MESSAGES 4 /*
- This the the amount of messages you have. This number must be the exact number at ALL times!
- */
- #define MESSAGE_COLOR 0x4169E1FF /*
- This is the color you want your random messages to be
- */
- #define MESSAGE_INTERVAL 60 /*
- This is the amount of seconds between each randomly sent message.
- */
- new RM[CURRENT_MESSAGES][128];
- forward SendRandomMessage();
- public OnFilterScriptInit()
- {
- print("\n------------------------------------------");
- print(" Easy-to-use random message script");
- print(" Thank you for using! Created by Hiddos");
- print(" Piss on it. McFaik");
- print("--------------------------------------------\n");
- AddRandomMessage("3rd party mods aren't allowed on this server, cows are (Pinguin's are strictly FORBIDDEN!)");
- AddRandomMessage("You might wish to change those messages hehe.");
- AddRandomMessage("Adam Taylor you really are an asshole :D");
- AddRandomMessage("Server closed the connection.");
- SetTimer("SendRandomMessage", MESSAGE_INTERVAL * 1000, 1);
- return 1;
- }
- public SendRandomMessage()
- {
- static lastmessage = 0;
- new rand = random(CURRENT_MESSAGES);
- while(rand == lastmessage && CURRENT_MESSAGES != 1) { rand = random(CURRENT_MESSAGES); }
- lastmessage = rand;
- SendClientMessageToAll(MESSAGE_COLOR, RM[lastmessage]);
- }
- stock AddRandomMessage(text[])
- {
- for(new m; m < CURRENT_MESSAGES; m++)
- {
- if(!strlen(RM[m]))
- {
- strmid(RM[m], text, 0, 127);
- return 1;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment