Guest User

Untitled

a guest
Nov 29th, 2011
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.36 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. new Showing[MAX_PLAYERS], Count[MAX_PLAYERS], CD[MAX_PLAYERS];
  4. new Text:Textdraw0[MAX_PLAYERS], Text:Textdraw1[MAX_PLAYERS];
  5. new Text:Red[MAX_PLAYERS],Text:Yellow[MAX_PLAYERS],Text:Green[MAX_PLAYERS];
  6. new Float:x,Float:y,Float:z;
  7.  
  8. forward HideTextdraws(playerid);
  9. forward TLu(i);
  10.  
  11. public OnFilterScriptInit()
  12. {
  13. for (new i = 0; i != MAX_PLAYERS; ++i)
  14. {
  15. if (IsPlayerConnected(i)) CreateTLTD(i);
  16. }
  17. return 1;
  18. }
  19.  
  20. public OnFilterScriptExit()
  21. {
  22. for (new i = 0; i != MAX_PLAYERS; ++i)
  23. {
  24. if (IsPlayerConnected(i))
  25. {
  26. TextDrawHideForAll(Textdraw0[i]);
  27. TextDrawDestroy(Textdraw0[i]);
  28. TextDrawHideForAll(Textdraw1[i]);
  29. TextDrawDestroy(Textdraw1[i]);
  30. TextDrawHideForAll(Red[i]);
  31. TextDrawDestroy(Red[i]);
  32. TextDrawHideForAll(Yellow[i]);
  33. TextDrawDestroy(Yellow[i]);
  34. TextDrawHideForAll(Green[i]);
  35. TextDrawDestroy(Green[i]);
  36. }
  37. }
  38. return 1;
  39. }
  40.  
  41. public OnPlayerConnect(playerid)
  42. {
  43. CreateTLTD(playerid);
  44. }
  45.  
  46.  
  47. public OnPlayerCommandText(playerid, cmdtext[])
  48. {
  49. if(!strcmp(cmdtext, "/StartCD"))
  50. {
  51. if(Showing[playerid] == 1) return 0;
  52. Showing[playerid] = 1;
  53. Count[playerid] =0;
  54. ShowTL(playerid);
  55. }
  56. return 1;
  57. }
  58.  
  59. public HideTextdraws(playerid)
  60. {
  61. TextDrawHideForPlayer(playerid, Textdraw0[playerid]);
  62. TextDrawHideForPlayer(playerid, Textdraw1[playerid]);
  63. TextDrawHideForPlayer(playerid, Red[playerid]);
  64. TextDrawHideForPlayer(playerid, Yellow[playerid]);
  65. TextDrawHideForPlayer(playerid, Green[playerid]);
  66. Showing[playerid] = 0;
  67. }
  68.  
  69. public TLu(i)
  70. {
  71. Count[i]++;
  72. if(Count[i] == 1)
  73. {
  74. TextDrawHideForPlayer(i, Red[i]);
  75. TextDrawShowForPlayer(i, Yellow[i]);
  76. GameTextForPlayer(i, "~y~Set", 1200, 3);
  77. GetPlayerPos(i, x, y, z);
  78. PlayerPlaySound(i, 1056,x, y, z);
  79. }
  80. if(Count[i] == 2)
  81. {
  82. TextDrawHideForPlayer(i, Yellow[i]);
  83. TextDrawShowForPlayer(i, Green[i]);
  84. GameTextForPlayer(i, "~g~Go!!", 1200, 3);
  85. GetPlayerPos(i, x, y, z);
  86. PlayerPlaySound(i, 1057,x, y, z);
  87.  
  88. }
  89. if(Count[i] == 3)
  90. {
  91. HideTextdraws(i);
  92. KillTimer(CD[i]);
  93. }
  94. return 1;
  95.  
  96. }
  97. stock ShowTL(playerid)
  98. {
  99. if(Count[playerid] == 0)
  100. {
  101. TextDrawShowForPlayer(playerid, Textdraw0[playerid]);
  102. TextDrawShowForPlayer(playerid, Textdraw1[playerid]);
  103. TextDrawShowForPlayer(playerid, Red[playerid]);
  104. GameTextForPlayer(playerid, "~r~Ready", 1200, 3);
  105. GetPlayerPos(playerid, x, y, z);
  106. PlayerPlaySound(playerid, 1056,x, y, z);
  107. }
  108. CD[playerid] = SetTimerEx("TLu", 1000, true, "i", playerid);
  109. }
  110.  
  111. stock CreateTLTD(i)
  112. {
  113. Textdraw0[i] = TextDrawCreate(489.000000, 189.000000, "I");
  114. TextDrawBackgroundColor(Textdraw0[i], 255);
  115. TextDrawFont(Textdraw0[i], 1);
  116. TextDrawLetterSize(Textdraw0[i], 3.699998, 27.200000);
  117. TextDrawColor(Textdraw0[i], -1717986817);
  118. TextDrawSetOutline(Textdraw0[i], 0);
  119. TextDrawSetProportional(Textdraw0[i], 1);
  120. TextDrawSetShadow(Textdraw0[i], 1);
  121.  
  122. Textdraw1[i] = TextDrawCreate(555.000000, 247.000000, "____");
  123. TextDrawBackgroundColor(Textdraw1[i], 255);
  124. TextDrawFont(Textdraw1[i], 1);
  125. TextDrawLetterSize(Textdraw1[i], 0.500000, -15.100000);
  126. TextDrawColor(Textdraw1[i], -1);
  127. TextDrawSetOutline(Textdraw1[i], 0);
  128. TextDrawSetProportional(Textdraw1[i], 1);
  129. TextDrawSetShadow(Textdraw1[i], 1);
  130. TextDrawUseBox(Textdraw1[i], 1);
  131. TextDrawBoxColor(Textdraw1[i], 255);
  132. TextDrawTextSize(Textdraw1[i], 470.000000, -170.000000);
  133.  
  134. Red[i] = TextDrawCreate(481.000000, 15.000000, "~r~.");
  135. TextDrawBackgroundColor(Red[i], 255);
  136. TextDrawFont(Red[i], 1);
  137. TextDrawLetterSize(Red[i], 5.319997, 18.200000);
  138. TextDrawColor(Red[i], -1);
  139. TextDrawSetOutline(Red[i], 0);
  140. TextDrawSetProportional(Red[i], 1);
  141. TextDrawSetShadow(Red[i], 1);
  142.  
  143. Yellow[i] = TextDrawCreate(482.000000, 59.000000, "~y~.");
  144. TextDrawBackgroundColor(Yellow[i], 255);
  145. TextDrawFont(Yellow[i], 1);
  146. TextDrawLetterSize(Yellow[i], 5.319900, 18.200000);
  147. TextDrawColor(Yellow[i], -1);
  148. TextDrawSetOutline(Yellow[i], 0);
  149. TextDrawSetProportional(Yellow[i], 1);
  150. TextDrawSetShadow(Yellow[i], 1);
  151.  
  152. Green[i] = TextDrawCreate(483.000000, 101.000000, "~g~.");
  153. TextDrawBackgroundColor(Green[i], 255);
  154. TextDrawFont(Green[i], 1);
  155. TextDrawLetterSize(Green[i], 5.319900, 18.200000);
  156. TextDrawColor(Green[i], -1);
  157. TextDrawSetOutline(Green[i], 0);
  158. TextDrawSetProportional(Green[i], 1);
  159. TextDrawSetShadow(Green[i], 1);
  160. }
  161.  
Advertisement
Add Comment
Please, Sign In to add comment