Advertisement
Guest User

Untitled

a guest
Dec 15th, 2013
364
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.03 KB | None | 0 0
  1. // Keep Credits. Even though some of you will delete it and claim it as your own. ;)
  2. #include <a_samp>
  3.  
  4. // Colours
  5. #define RED 0xE60000FF
  6.  
  7. // TextDraw Variables
  8. new Text:CMDText;
  9. new Text:CMDText2;
  10.  
  11. // Variable that allows you to open a another TextDraw when you type a number in.
  12. new OnCommandList[MAX_PLAYERS];
  13.  
  14. public OnGameModeInit()
  15. {
  16. // Textdraws
  17. CMDText2=TextDrawCreate(130.000000, 120.000000, "Christmas Songs");
  18. TextDrawAlignment(CMDText2, 2);
  19. TextDrawBoxColor(CMDText2, 0x000000FF);
  20. TextDrawColor(CMDText2, RED);
  21. TextDrawFont(CMDText2, 3);
  22. TextDrawTextSize(CMDText2, 20.000000, 210.000000);
  23. TextDrawUseBox(CMDText2, 1);
  24.  
  25. CMDText=TextDrawCreate(25.000000, 135.000000, "Songs:~N~~N~ ~G~1. ~Y~Happy Xmas War is Over~N~ ~G~2. ~Y~Mistletoe and Wine~N~ ~G~3. ~Y~Christmas Lights~N~ ~G~4. ~Y~Do They Know It's Christmas?~N~ ~G~5. ~Y~Merry Christmas Everybody");
  26. TextDrawAlignment(CMDText, 1);
  27. TextDrawBoxColor(CMDText, 0x00000055);
  28. TextDrawFont(CMDText, 1);
  29. TextDrawLetterSize(CMDText, 0.250000, 0.900000);
  30. TextDrawSetShadow(CMDText, 0);
  31. TextDrawSetOutline(CMDText, 1);
  32. TextDrawTextSize(CMDText, 235.000000, 20.000000);
  33. TextDrawUseBox(CMDText, 1);
  34.  
  35. return 1;
  36. }
  37.  
  38. public OnGameModeExit()
  39. {
  40. TextDrawDestroy(CMDText);
  41. TextDrawDestroy(CMDText2);
  42. return 1;
  43. }
  44.  
  45.  
  46. public OnPlayerText(playerid, text[])
  47. {
  48. if(OnCommandList[playerid] == 1)
  49. {
  50. if(strval(text) == 1)
  51. {
  52. OnCommandList[playerid]=0;
  53. PlayAudioStreamForPlayer(playerid, "http://k007.kiwi6.com/hotlink/whhuprdkgu/Happy_Xmas_War_Is_Over");
  54. GameTextForPlayer(playerid,"~R~Playing: ~W~Happy xmas War is Over", 5000, 5);
  55. TextDrawHideForPlayer(playerid,CMDText);
  56. TextDrawHideForPlayer(playerid,CMDText2);
  57. return 0;
  58. }
  59. if(strval(text) == 2)
  60. {
  61. OnCommandList[playerid]=0;
  62. PlayAudioStreamForPlayer(playerid, "http://k007.kiwi6.com/hotlink/gdypehmsr0/Mistletoe_and_Wine");
  63. GameTextForPlayer(playerid,"~R~Playing: ~W~Mistleto and Wine", 5000, 5);
  64. TextDrawHideForPlayer(playerid,CMDText);
  65. TextDrawHideForPlayer(playerid,CMDText2);
  66. return 0;
  67. }
  68. if(strval(text) == 3)
  69. {
  70. OnCommandList[playerid]=0;
  71. PlayAudioStreamForPlayer(playerid, "http://k007.kiwi6.com/hotlink/qeq3sahznx/Christmas_Lights");
  72. GameTextForPlayer(playerid,"~R~Playing: ~W~Christmas Lights", 5000, 5);
  73. TextDrawHideForPlayer(playerid,CMDText);
  74. TextDrawHideForPlayer(playerid,CMDText2);
  75. return 0;
  76. }
  77. if(strval(text) == 4)
  78. {
  79. OnCommandList[playerid]=0;
  80. PlayAudioStreamForPlayer(playerid, "http://k007.kiwi6.com/hotlink/qmg0lvxq8d/Do_They_Know_It_s_Christmas");
  81. GameTextForPlayer(playerid,"~R~Playing: ~W~Do they know it's Christmas?", 5000, 5);
  82. TextDrawHideForPlayer(playerid,CMDText);
  83. TextDrawHideForPlayer(playerid,CMDText2);
  84. return 0;
  85. }
  86. if(strval(text) == 5)
  87. {
  88. OnCommandList[playerid]=0;
  89. PlayAudioStreamForPlayer(playerid, "http://k007.kiwi6.com/hotlink/n9kwclglx5/Merry_Christmas_Everybody");
  90. GameTextForPlayer(playerid,"~R~Playing: ~W~Merry Christmas Everybody", 5000, 5);
  91. TextDrawHideForPlayer(playerid,CMDText);
  92. TextDrawHideForPlayer(playerid,CMDText2);
  93. return 0;
  94. }
  95. }
  96. return 1;
  97. }
  98.  
  99. public OnPlayerCommandText(playerid, cmdtext[])
  100. {
  101. if((strcmp("/xmassong", cmdtext, true) == 0) || (strcmp("/xs", cmdtext, true) == 0))
  102. {
  103. OnCommandList[playerid]=1;
  104. TextDrawHideForPlayer(playerid,CMDText);
  105. TextDrawHideForPlayer(playerid,CMDText2);
  106. TextDrawShowForPlayer(playerid,CMDText);
  107. TextDrawShowForPlayer(playerid,CMDText2);
  108. return 1;
  109. }
  110. if((strcmp("/stopsong", cmdtext, true) == 0) || (strcmp("/ss", cmdtext, true) == 0))
  111. {
  112. StopAudioStreamForPlayer(playerid); // Stop the audio stream
  113. return 1;
  114. }
  115. return 0;
  116. }
  117.  
  118. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  119. {
  120. if(newkeys == KEY_FIRE)
  121. {
  122. TextDrawHideForPlayer(playerid,CMDText);
  123. TextDrawHideForPlayer(playerid,CMDText2);
  124. }
  125. return 1;
  126. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement