Guest User

Hiddos

a guest
Oct 29th, 2010
463
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.49 KB | None | 0 0
  1. #include <a_samp>
  2. #define CURRENT_MESSAGES 4 /*
  3. This the the amount of messages you have. This number must be the exact number at ALL times!
  4. */
  5. #define MESSAGE_COLOR 0x4169E1FF /*
  6. This is the color you want your random messages to be
  7. */
  8. #define MESSAGE_INTERVAL 60 /*
  9. This is the amount of seconds between each randomly sent message.
  10. */
  11. new RM[CURRENT_MESSAGES][128];
  12. forward SendRandomMessage();
  13. public OnFilterScriptInit()
  14. {
  15.     print("\n------------------------------------------");
  16.     print(" Easy-to-use random message script");
  17.     print(" Thank you for using! Created by Hiddos");
  18.     print(" Piss on it.                         McFaik");
  19.     print("--------------------------------------------\n");
  20.     AddRandomMessage("3rd party mods aren't allowed on this server, cows are (Pinguin's are strictly FORBIDDEN!)");
  21.     AddRandomMessage("You might wish to change those messages hehe.");
  22.     AddRandomMessage("Adam Taylor you really are an asshole :D");
  23.     AddRandomMessage("Server closed the connection.");
  24.     SetTimer("SendRandomMessage", MESSAGE_INTERVAL * 1000, 1);
  25.     return 1;
  26. }
  27.  
  28. public SendRandomMessage()
  29. {
  30.     static lastmessage = 0;
  31.     new rand = random(CURRENT_MESSAGES);
  32.     while(rand == lastmessage && CURRENT_MESSAGES != 1) { rand = random(CURRENT_MESSAGES);  }
  33.     lastmessage = rand;
  34.     SendClientMessageToAll(MESSAGE_COLOR, RM[lastmessage]);
  35. }
  36.  
  37. stock AddRandomMessage(text[])
  38. {
  39.     for(new m; m < CURRENT_MESSAGES; m++)
  40.     {
  41.         if(!strlen(RM[m]))
  42.         {
  43.             strmid(RM[m], text, 0, 127);
  44.             return 1;
  45.         }
  46.     }
  47.     return 0;
  48. }
Advertisement
Add Comment
Please, Sign In to add comment