Advertisement
FamiliaSAMP

FILTERSCRIPT - Mensagens Aleatórias em Textdraw[FAMILIASAMP]

Apr 6th, 2016
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.90 KB | None | 0 0
  1. //Main FS Include
  2. #include <a_samp>
  3.  
  4. //Textdraw
  5. new Text:AnnouncesTD;
  6.  
  7. //Announces, edit 3 number in AnnounceMessages[3] like you want to put 10 announces set from 3 to 10 etc..
  8. new AnnounceMessage[3][] = {
  9. "~r~Visit ~y~familiasamp.com",
  10. "~r~Os melhores: ~y~Conteúdos para SAMP",
  11. "~r~Tutorial by ~y~shendlaw"
  12. };
  13.  
  14. //Forwards with timer for show and hide the messages, to define when display them and when hide them for display another text.
  15. forward ShowAnnounceTD(playerid);
  16. forward HideAnnounceMessage(playerid);
  17.  
  18. //Hide when a player selecting class(it looks ugly with the textdraw showing up when you select class)
  19. public OnPlayerRequestClass(playerid)
  20. {
  21. TextDrawHideForPlayer(playerid, AnnouncesTD);
  22. return 1;
  23. }
  24.  
  25. //Hide the textdraw when player disconnect
  26. public OnPlayerDisconnect(playerid, reason)
  27. {
  28. TextDrawHideForPlayer(playerid, AnnouncesTD);
  29. return 1;
  30. }
  31.  
  32. public OnPlayerSpawn(playerid)
  33. {
  34. TextDrawShowForPlayer(playerid, AnnouncesTD);
  35. return 1;
  36. }
  37.  
  38. //Here you got the textdraw, if you want you can change the position, font, color etc..
  39. public ShowAnnounceTD(playerid)
  40. {
  41. new RandomMessage = random(sizeof(AnnounceMessage));
  42. AnnouncesTD = TextDrawCreate(250.000000, 406.000000, AnnounceMessage[RandomMessage]);
  43. TextDrawBackgroundColor(AnnouncesTD, 85);
  44. TextDrawFont(AnnouncesTD, 1);
  45. TextDrawLetterSize(AnnouncesTD, 0.194999, 1.149999);
  46. TextDrawColor(AnnouncesTD, -1);
  47. TextDrawSetOutline(AnnouncesTD, 1);
  48. TextDrawSetProportional(AnnouncesTD, 1);
  49.  
  50. TextDrawShowForPlayer(playerid,AnnouncesTD);
  51.  
  52. SetTimer("HideAnnounceMessage", 9000, false); //Every 9000ms the textdraw will be hidden, after 9000ms it will be again ready to be displayed.
  53. }
  54.  
  55. public HideAnnounceMessage(playerid)
  56. {
  57. TextDrawHideForPlayer(playerid,AnnouncesTD);
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement