Advertisement
Guest User

Criador de Create3DTextLabel e Pickup

a guest
Sep 21st, 2011
544
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.69 KB | None | 0 0
  1. //------------------------------------------------
  2.  
  3. #include <a_samp>
  4.  
  5. //------------------------------------------------
  6.  
  7. #define scmd:%0(%1,%2) _%0(%1,%2); public _%0(%1,%2)//By [S]trong
  8.  
  9. #undef MAX_PLAYERS
  10. #define MAX_PLAYERS (3)
  11.  
  12. //------------------------------------------------
  13.  
  14. #define Vermelho 0xFF0000FF
  15. #define Vermelho_Claro 0xFF8080FF
  16. #define Azul_Claro 0x63C8E4FF
  17. #define Cinza 0x808080FF
  18. #define Verde 0x00FF00FF
  19. #define Azul 0x0000FFFF
  20. #define Amarelo 0x0000FFFF
  21. #define Rosa 0xFF00FFFF
  22.  
  23. //------------------------------------------------
  24. #define Criacao 100
  25. #define Texto 200
  26. #define Draw 400
  27. #define VirtualW 500
  28. #define Pickup 600
  29. #define PickupID 700
  30.  
  31. //------------------------------------------------
  32.  
  33. new
  34. stryng[128],
  35. Text3D: PickupP[MAX_PLAYERS],
  36. Float: Pos[3],
  37. Color[MAX_PLAYERS],
  38. Textoz[MAX_PLAYERS][128],
  39. Float: DrawDistance[MAX_PLAYERS],
  40. VW[MAX_PLAYERS]
  41. ;
  42. //------------------------------------------------
  43.  
  44. public OnFilterScriptInit()
  45. {
  46. print("\n\n**** Create3DPickup - Ligando....Ok\n");
  47. print("**** Create3DPickup - Carregando Comandos ....Ok\n");
  48. print("**** Create3DPickup - Carregado!!\n\n");
  49. return 1;
  50. }
  51.  
  52. //------------------------------------------------
  53.  
  54. public OnPlayerConnect(playerid)
  55. {
  56. SendClientMessage(playerid, -1, "Este servidor usa o FS Criaçao de 3DTextLabel e Pickup In-Game");
  57. SendClientMessage(playerid, -1, "Criador: [R]ousenber[K] ou [KoS]Dylan");
  58. return true;
  59. }
  60.  
  61. //------------------------------------------------
  62.  
  63. public OnPlayerDisconnect(playerid, reason)
  64. {
  65. return true;
  66. }
  67.  
  68. //------------------------------------------------
  69.  
  70. public OnPlayerPickUpPickup(playerid, pickupid)
  71. {
  72. return 1;
  73. }
  74.  
  75. //------------------------------------------------
  76.  
  77. public OnPlayerCommandText(playerid,cmdtext[])//By [S]trong
  78. {
  79. static i;
  80.  
  81. new
  82. cmdcall[26];
  83.  
  84. i = strfind(cmdtext," ");
  85. return i == -1 ? (cmdtext[0] = 95,CallLocalFunction(cmdtext,"ds",playerid,"\1")) : (strcat(cmdcall,cmdtext,i+1),cmdcall[0] = 95,CallLocalFunction(cmdcall,"ds",playerid,cmdtext[i+1]));
  86. }
  87.  
  88. //------------------------------------------------
  89.  
  90. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  91. {
  92. switch(dialogid)
  93. {
  94. case Criacao:
  95. {
  96. switch(listitem)
  97. {
  98. case 0:
  99. {
  100. GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  101. PickupP[playerid] = Create3DTextLabel("", Vermelho, Pos[0], Pos[1], Pos[2], 10.0, 0);
  102. ShowPlayerDialog(playerid, Texto, DIALOG_STYLE_INPUT, "{FF0000}> Digite o Texto de seu 3DLabel <","{FF0000}Digite seu Texto Abaixo:","Ok","Cancelar");
  103. Color[playerid] = Vermelho;
  104. }
  105. case 1:
  106. {
  107. GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  108. PickupP[playerid] = Create3DTextLabel("", Vermelho_Claro, Pos[0], Pos[1], Pos[2], 10.0, 0);
  109. ShowPlayerDialog(playerid, Texto, DIALOG_STYLE_INPUT, "{FF0000}> Digite o Texto de seu 3DLabel <","{FF0000}Digite seu Texto Abaixo:","Ok","Cancelar");
  110. Color[playerid] = Vermelho_Claro;
  111. }
  112. case 2:
  113. {
  114. GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  115. PickupP[playerid] = Create3DTextLabel("", Azul_Claro, Pos[0], Pos[1], Pos[2], 10.0, 0);
  116. ShowPlayerDialog(playerid, Texto, DIALOG_STYLE_INPUT, "{FF0000}> Digite o Texto de seu 3DLabel <","{FF0000}Digite seu Texto Abaixo:","Ok","Cancelar");
  117. Color[playerid] = Azul_Claro;
  118. }
  119. case 3:
  120. {
  121. GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  122. PickupP[playerid] = Create3DTextLabel("", Cinza, Pos[0], Pos[1], Pos[2], 10.0, 0);
  123. ShowPlayerDialog(playerid, Texto, DIALOG_STYLE_INPUT, "{FF0000}> Digite o Texto de seu 3DLabel <","{FF0000}Digite seu Texto Abaixo:","Ok","Cancelar");
  124. Color[playerid] = Cinza;
  125. }
  126. case 4:
  127. {
  128. GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  129. PickupP[playerid] = Create3DTextLabel("", Verde, Pos[0], Pos[1], Pos[2], 10.0, 0);
  130. ShowPlayerDialog(playerid, Texto, DIALOG_STYLE_INPUT, "{FF0000}> Digite o Texto de seu 3DLabel <","{FF0000}Digite seu Texto Abaixo:","Ok","Cancelar");
  131. Color[playerid] = Verde;
  132. }
  133. case 5:
  134. {
  135. GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  136. PickupP[playerid] = Create3DTextLabel("", Azul, Pos[0], Pos[1], Pos[2], 10.0, 0);
  137. ShowPlayerDialog(playerid, Texto, DIALOG_STYLE_INPUT, "{FF0000}> Digite o Texto de seu 3DLabel <","{FF0000}Digite seu Texto Abaixo:","Ok","Cancelar");
  138. Color[playerid] = Azul;
  139. }
  140. case 6:
  141. {
  142. GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  143. PickupP[playerid] = Create3DTextLabel("", Amarelo, Pos[0], Pos[1], Pos[2], 10.0, 0);
  144. ShowPlayerDialog(playerid, Texto, DIALOG_STYLE_INPUT, "{FF0000}> Digite o Texto de seu 3DLabel <","{FF0000}Digite seu Texto Abaixo:","Ok","Cancelar");
  145. Color[playerid] = Amarelo;
  146. }
  147. case 7:
  148. {
  149. GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  150. PickupP[playerid] = Create3DTextLabel("", Rosa, Pos[0], Pos[1], Pos[2], 10.0, 0);
  151. ShowPlayerDialog(playerid, Texto, DIALOG_STYLE_INPUT, "{FF0000}> Digite o Texto de seu 3DLabel <","{FF0000}Digite seu Texto Abaixo:","Ok","Cancelar");
  152. Color[playerid] = Rosa;
  153. }
  154. }
  155. }
  156. case Texto:
  157. {
  158. if(response)
  159. {
  160. Update3DTextLabelText(PickupP[playerid], Color[playerid], inputtext);
  161. format(stryng, sizeof(stryng), "%s", inputtext);
  162. Textoz[playerid] = stryng;
  163. ShowPlayerDialog(playerid, Draw, DIALOG_STYLE_INPUT, "{FF0000}> Digite a 'Draw Distance' <","{FF0000}Digite o tanto que você deseja de distancia que esse texto pode ser visto:","Ok","Cancelar");
  164. }
  165. }
  166. case Draw:
  167. {
  168. if(response)
  169. {
  170. Delete3DTextLabel(PickupP[playerid]);
  171. GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  172. DrawDistance[playerid] = float(strval(inputtext));
  173. PickupP[playerid] = Create3DTextLabel(Textoz[playerid], Color[playerid], Pos[0], Pos[1], Pos[2], float(strval(inputtext)), 0);
  174. ShowPlayerDialog(playerid, VirtualW, DIALOG_STYLE_INPUT, "{FF0000}> Digite o 'Virtual World' <","{FF0000}Digite o ID do Virtual World abaixo:","Ok","Cancelar");
  175. }
  176. }
  177. case VirtualW:
  178. {
  179. if(response)
  180. {
  181. if(strval(inputtext) < 0 || strval(inputtext) > 100) return ShowPlayerDialog(playerid, VirtualW, DIALOG_STYLE_INPUT, "{FF0000}> Digite o 'Virtual World' <","{FF0000}Digite o ID do Virtual World abaixo:","Ok","Cancelar");
  182. Delete3DTextLabel(PickupP[playerid]);
  183. VW[playerid] = strval(inputtext);
  184. GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  185. PickupP[playerid] = Create3DTextLabel(Textoz[playerid], Color[playerid], Pos[0], Pos[1], Pos[2], DrawDistance[playerid], strval(inputtext));
  186. ShowPlayerDialog(playerid, Pickup, DIALOG_STYLE_LIST, "{FF0000}> Deseja criar um pickup tambem? <","{00FF00}Sim\n{FF0000}Não", "Continuar", "Fechar");
  187. }
  188. }
  189. case Pickup:
  190. {
  191. switch(listitem)
  192. {
  193. case 0:
  194. {
  195. ShowPlayerDialog(playerid, PickupID, DIALOG_STYLE_INPUT, "{FF0000}> Digite o ID do pickup <","{FF0000}Digite o ID abaixo:", "Ok", "Cancelar");
  196. }
  197. case 1:
  198. {
  199. GameTextForPlayer(playerid, "Criacao do ~r~Create3DTextLabel~w~ Finalizada!", 7000, 5);
  200. }
  201. }
  202. }
  203. case PickupID:
  204. {
  205. if(response)
  206. {
  207. GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  208. GameTextForPlayer(playerid, "Criacao do ~r~Create3DTextLabel~w~ e ~r~Pickup~w~ Finalizada!", 7000, 5);
  209. CreatePickup(strval(inputtext), 23, Pos[0], Pos[1], Pos[2], VW[playerid]);
  210. }
  211. }
  212. }
  213. return 0;
  214. }
  215.  
  216. //------------------------------------------------
  217.  
  218. scmd:criarlp(playerid, params[])
  219. {
  220. ShowPlayerDialog(playerid, Criacao, DIALOG_STYLE_LIST, "{FF0000}> Seleciona a cor de Seu 3DLabel <","{FF0000}Vermelho\n{FF8080}Vermelho Claro\n{63C8E4}Azul Claro\n{808080}Cinza\n{00FF00}Verde\n{0000FF}Azul\n{FFFF80}Amarelo\n{FF00FF}Rosa","Selecionar","Cancelar");
  221. return true;
  222. }
  223.  
  224. //------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement