Advertisement
Guest User

Untitled

a guest
Oct 29th, 2011
473
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. #if !defined MAX_MESSAGES
  4. #define MAX_MESSAGES 50
  5. #endif
  6.  
  7. enum MessageInfo
  8. {
  9. textmsg[64],
  10. colormsg
  11. }
  12. new Messages[MAX_MESSAGES][MessageInfo];
  13. new CurrentMessageID;
  14. new TimerAlreadyActivated;
  15. forward SendAutoMessage();
  16.  
  17. stock AddRandomMessage(Msgcolor,Msgtext[])
  18. {
  19. format(Messages[CurrentMessageID][textmsg],64,"%s",Msgtext);
  20. Messages[CurrentMessageID][colormsg] = Msgcolor;
  21. CurrentMessageID++;
  22. if(TimerAlreadyActivated == 0)
  23. {
  24. #if defined MESSAGE_DELAY
  25. SetTimer("SendAutoMessage",MESSAGE_DELAY*1000);
  26. #else
  27. SetTimer("SendAutoMessage",60000,true);
  28. #endif
  29. TimerAlreadyActivated = 1;
  30. }
  31. return 1;
  32. }
  33.  
  34. public SendAutoMessage()
  35. {
  36. new randmsg = random(CurrentMessageID);
  37. SendClientMessageToAll(Messages[randmsg][colormsg],Messages[randmsg][textmsg]);
  38. return 1;
  39. }
  40.  
  41.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement