John1980

TextDraw Commands

Apr 22nd, 2012
1,052
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.29 KB | None | 0 0
  1. // Commands TextDraw by CaptainJohn.
  2. // When you bring up a TextDraw just LMB (Left Mouse Button) click to close the TextDraw.
  3. // Feel free to edit.
  4. #include <a_samp>
  5.  
  6. // Colours
  7. #define RED 0xE60000FF
  8.  
  9. // TextDraw Variables
  10. new Text:CMDText;
  11. new Text:CMDText2;
  12. new Text:CMDTextR1;
  13. new Text:CMDTextR2;
  14. new Text:CMDTextR3;
  15. new Text:CMDTextR4;
  16. new Text:CMDTextR5;
  17.  
  18. // Variable that allows you to open a another TextDraw when you type a number in.
  19. new OnCommandList[MAX_PLAYERS];
  20.  
  21. public OnGameModeInit()
  22. {
  23. // Textdraws
  24. CMDText2=TextDrawCreate(130.000000, 120.000000, "CJWOF Commands");
  25. TextDrawAlignment(CMDText2, 2);
  26. TextDrawBoxColor(CMDText2, 0x000000FF);
  27. TextDrawColor(CMDText2, RED);
  28. TextDrawFont(CMDText2, 3);
  29. TextDrawTextSize(CMDText2, 20.000000, 210.000000);
  30. TextDrawUseBox(CMDText2, 1);
  31.  
  32. CMDText=TextDrawCreate(25.000000, 135.000000, "Commands:~N~~N~ ~G~1. ~Y~General Commands~N~ ~G~2. ~Y~DM Zones~N~ ~G~3. ~Y~Stunt Zones~N~ ~G~4. ~Y~Houses~N~ ~G~5. ~Y~Other");
  33. TextDrawAlignment(CMDText, 1);
  34. TextDrawBoxColor(CMDText, 0x00000055);
  35. TextDrawFont(CMDText, 1);
  36. TextDrawLetterSize(CMDText, 0.250000, 0.900000);
  37. TextDrawSetShadow(CMDText, 0);
  38. TextDrawSetOutline(CMDText, 1);
  39. TextDrawTextSize(CMDText, 235.000000, 20.000000);
  40. TextDrawUseBox(CMDText, 1);
  41.  
  42. CMDTextR1=TextDrawCreate(25.000000, 135.000000, "General Commands:~N~~N~ ~G~- ~Y~/teleports~N~ ~G~- ~Y~/stunts~N~ ~G~- ~Y~/dm~N~ ~G~- ~Y~/events~N~ ~G~- ~Y~/style~N~ ~G~- ~Y~/hit");
  43. TextDrawAlignment(CMDTextR1, 1);
  44. TextDrawBoxColor(CMDTextR1, 0x00000055);
  45. TextDrawFont(CMDTextR1, 1);
  46. TextDrawLetterSize(CMDTextR1, 0.250000, 0.900000);
  47. TextDrawSetShadow(CMDTextR1, 0);
  48. TextDrawSetOutline(CMDTextR1, 1);
  49. TextDrawTextSize(CMDTextR1, 235.000000, 20.000000);
  50. TextDrawUseBox(CMDTextR1, 1);
  51.  
  52. CMDTextR2=TextDrawCreate(25.000000, 135.000000, "DM Zone Commands:~N~~N~ ~G~- ~Y~/dm1~N~ ~G~- ~Y~/dm2~N~ ~G~- ~Y~/dm3~N~ ~G~- ~Y~/dm4~N~ ~G~- ~Y~/dm5~N~ ~G~- ~Y~/dm6~N~ ~G~- ~Y~/dm7~N~ ~G~- ~Y~/dm8~N~ ~G~- ~Y~/sniper~N~ ~G~- ~Y~/deagle~N~ ~G~- ~Y~/jdm");
  53. TextDrawAlignment(CMDTextR2, 1);
  54. TextDrawBoxColor(CMDTextR2, 0x00000055);
  55. TextDrawFont(CMDTextR2, 1);
  56. TextDrawLetterSize(CMDTextR2, 0.250000, 0.900000);
  57. TextDrawSetShadow(CMDTextR2, 0);
  58. TextDrawSetOutline(CMDTextR2, 1);
  59. TextDrawTextSize(CMDTextR2, 235.000000, 20.000000);
  60. TextDrawUseBox(CMDTextR2, 1);
  61.  
  62. CMDTextR3=TextDrawCreate(25.000000, 135.000000, "Stunt Zone Commands:~N~~N~ ~G~- ~Y~/s1~N~ ~G~- ~Y~/s2~N~ ~G~- ~Y~/s3~N~ ~G~- ~Y~/s4~N~ ~G~- ~Y~/s5~N~ ~G~- ~Y~/s6~N~ ~G~- ~Y~/s7~N~ ~G~- ~Y~/s8~N~ ~G~- ~Y~/s9~N~ ~G~- ~Y~/s10~N~ ~G~- ~Y~/s11");
  63. TextDrawAlignment(CMDTextR3, 1);
  64. TextDrawBoxColor(CMDTextR3, 0x00000055);
  65. TextDrawFont(CMDTextR3, 1);
  66. TextDrawLetterSize(CMDTextR3, 0.250000, 0.900000);
  67. TextDrawSetShadow(CMDTextR3, 0);
  68. TextDrawSetOutline(CMDTextR3, 1);
  69. TextDrawTextSize(CMDTextR3, 235.000000, 20.000000);
  70. TextDrawUseBox(CMDTextR3, 1);
  71.  
  72. CMDTextR4=TextDrawCreate(25.000000, 135.000000, "House Commands:~N~~N~ ~G~- ~Y~/buyhouse~N~ ~G~- ~Y~/housemenu~N~ ~G~- ~Y~/gohome~N~ ~G~- ~Y~/exithouse");
  73. TextDrawAlignment(CMDTextR4, 1);
  74. TextDrawBoxColor(CMDTextR4, 0x00000055);
  75. TextDrawFont(CMDTextR4, 1);
  76. TextDrawLetterSize(CMDTextR4, 0.250000, 0.900000);
  77. TextDrawSetShadow(CMDTextR4, 0);
  78. TextDrawSetOutline(CMDTextR4, 1);
  79. TextDrawTextSize(CMDTextR4, 235.000000, 20.000000);
  80. TextDrawUseBox(CMDTextR4, 1);
  81.  
  82. CMDTextR5=TextDrawCreate(25.000000, 135.000000, "Other Commands:~N~~N~ ~G~- ~Y~/carcolour~N~ ~G~- ~Y~/saveplace~N~ ~G~- ~Y~/gotoplace");
  83. TextDrawAlignment(CMDTextR5, 1);
  84. TextDrawBoxColor(CMDTextR5, 0x00000055);
  85. TextDrawFont(CMDTextR5, 1);
  86. TextDrawLetterSize(CMDTextR5, 0.250000, 0.900000);
  87. TextDrawSetShadow(CMDTextR5, 0);
  88. TextDrawSetOutline(CMDTextR5, 1);
  89. TextDrawTextSize(CMDTextR5, 235.000000, 20.000000);
  90. TextDrawUseBox(CMDTextR5, 1);
  91. return 1;
  92. }
  93.  
  94. public OnGameModeExit()
  95. {
  96. TextDrawDestroy(CMDText);
  97. TextDrawDestroy(CMDText2);
  98. TextDrawDestroy(CMDTextR1);
  99. TextDrawDestroy(CMDTextR2);
  100. TextDrawDestroy(CMDTextR3);
  101. TextDrawDestroy(CMDTextR4);
  102. TextDrawDestroy(CMDTextR5);
  103. return 1;
  104. }
  105.  
  106.  
  107. public OnPlayerText(playerid, text[])
  108. {
  109. if(OnCommandList[playerid] == 1)
  110. {
  111. if(strval(text) == 1)
  112. {
  113. OnCommandList[playerid]=0;
  114. TextDrawHideForPlayer(playerid,CMDText);
  115. TextDrawShowForPlayer(playerid, CMDTextR1);
  116. return 0;
  117. }
  118. if(strval(text) == 2)
  119. {
  120. OnCommandList[playerid]=0;
  121. TextDrawHideForPlayer(playerid,CMDText);
  122. TextDrawShowForPlayer(playerid, CMDTextR2);
  123. return 0;
  124. }
  125. if(strval(text) == 3)
  126. {
  127. OnCommandList[playerid]=0;
  128. TextDrawHideForPlayer(playerid,CMDText);
  129. TextDrawShowForPlayer(playerid, CMDTextR3);
  130. return 0;
  131. }
  132. if(strval(text) == 4)
  133. {
  134. OnCommandList[playerid]=0;
  135. TextDrawHideForPlayer(playerid,CMDText);
  136. TextDrawShowForPlayer(playerid, CMDTextR4);
  137. return 0;
  138. }
  139. if(strval(text) == 5)
  140. {
  141. OnCommandList[playerid]=0;
  142. TextDrawHideForPlayer(playerid,CMDText);
  143. TextDrawShowForPlayer(playerid, CMDTextR5);
  144. return 0;
  145. }
  146. }
  147. return 1;
  148. }
  149.  
  150. public OnPlayerCommandText(playerid, cmdtext[])
  151. {
  152. if((strcmp("/cmds", cmdtext, true) == 0) || (strcmp("/commands", cmdtext, true) == 0))
  153. {
  154. OnCommandList[playerid]=1;
  155. TextDrawHideForPlayer(playerid,CMDTextR1);
  156. TextDrawHideForPlayer(playerid,CMDTextR2);
  157. TextDrawHideForPlayer(playerid,CMDTextR3);
  158. TextDrawHideForPlayer(playerid,CMDTextR4);
  159. TextDrawHideForPlayer(playerid,CMDTextR5);
  160. TextDrawHideForPlayer(playerid,CMDText);
  161. TextDrawHideForPlayer(playerid,CMDText2);
  162. TextDrawShowForPlayer(playerid,CMDText);
  163. TextDrawShowForPlayer(playerid,CMDText2);
  164. return 1;
  165. }
  166. return 0;
  167. }
  168.  
  169. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  170. {
  171. if(newkeys == KEY_FIRE)
  172. {
  173. TextDrawHideForPlayer(playerid,CMDText);
  174. TextDrawHideForPlayer(playerid,CMDText2);
  175. TextDrawHideForPlayer(playerid,CMDTextR1);
  176. TextDrawHideForPlayer(playerid,CMDTextR2);
  177. TextDrawHideForPlayer(playerid,CMDTextR3);
  178. TextDrawHideForPlayer(playerid,CMDTextR4);
  179. TextDrawHideForPlayer(playerid,CMDTextR5);
  180. }
  181. return 1;
  182. }
Advertisement
Add Comment
Please, Sign In to add comment