Badyx

Sistema_Drogas

Nov 13th, 2011
424
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.88 KB | None | 0 0
  1. //============================================================================//
  2. // //
  3. // CREADO POR BADYX DESDE 0 //
  4. // //
  5. // FECHA DE INICIO DE SCRIPT 13 DE NOVIEMBRE DE 2011 //
  6. // //
  7. // PROHIBIDO ROBAR CREDITOS //
  8. // //
  9. //============================================================================//
  10.  
  11. /* ======- NOTAS -====== */
  12. /* */
  13. /* GENERALMENTE SUELO USAR FUNCIONES CAMBIANDO EL NOMBRE PARA ASI
  14. FACILITARME EL TRABAJO. AQUI DEJO LAS FUNCIONES ORIGINALES
  15. */
  16.  
  17. /*
  18.  
  19. ProxDetector == MensajeUserCercano
  20. NombreEx == ObtenerNombre
  21.  
  22. */
  23.  
  24. /* INCLUDES */
  25. #include <a_samp>
  26. /* COLORES */
  27. #define COLOR_PURPLE 0xB60597FF
  28. #define AMARILLO 0xF5DEB3AA
  29. /* NEWS */
  30. new EstaDrogado[MAX_PLAYERS];
  31. new TieneMarihuana[MAX_PLAYERS];
  32. new TieneChocolate[MAX_PLAYERS];
  33. new TieneSpeed[MAX_PLAYERS];
  34. new TieneHeroina[MAX_PLAYERS];
  35. new BigEar[MAX_PLAYERS];
  36.  
  37. #if defined FILTERSCRIPT
  38.  
  39. #else
  40.  
  41. main()
  42. {
  43. print("\n----------------------------------");
  44. print(" Sistema de drogas By The_Crazzy_Boy (Badyx) DESACTIVADO");
  45. print("----------------------------------\n");
  46. }
  47.  
  48. #endif
  49.  
  50. public OnPlayerCommandText(playerid, cmdtext[])
  51. {
  52. new string[256];
  53. if (strcmp("/tipodedroga", cmdtext, true, 10) == 0)
  54. {
  55. SendClientMessage(playerid, AMARILLO, "Mariguana -- /UsarMarihuana");
  56. SendClientMessage(playerid, AMARILLO, "Chocolate -- /UsarChocolate");
  57. SendClientMessage(playerid, AMARILLO, "Speed -- /UsarSpeed");
  58. SendClientMessage(playerid, AMARILLO, "Heroina -- /UsarHeroina");
  59. return 1;
  60. }
  61.  
  62. if (strcmp("/DameMarihuana", cmdtext, true, 10) == 0)
  63. {
  64. TieneMarihuana[playerid] = 1;
  65. return 1;
  66. }
  67.  
  68. if (strcmp("/DameChocolate", cmdtext, true, 10) == 0)
  69. {
  70. TieneChocolate[playerid] = 1;
  71. return 1;
  72. }
  73.  
  74. if (strcmp("/DameSpeed", cmdtext, true, 10) == 0)
  75. {
  76. TieneMarihuana[playerid] = 1;
  77. return 1;
  78. }
  79.  
  80. if (strcmp("/Dameheroina", cmdtext, true, 10) == 0)
  81. {
  82. TieneHeroina[playerid] = 1;
  83. return 1;
  84. }
  85.  
  86.  
  87. if (strcmp("/UsarMariguana", cmdtext, true, 10) == 0)
  88. {
  89. if(EstaDrogado[playerid] == 1)
  90. {
  91. SendClientMessage(playerid, AMARILLO, "Aun estas drogado");
  92. return 1;
  93. }
  94. if(TieneMarihuana[playerid] == 0)
  95. {
  96. SendClientMessage(playerid, AMARILLO, "No tienes Marihuana");
  97. return 1;
  98. }
  99. SetTimerEx("Drogado", 30000, false, "i", playerid);
  100. EstaDrogado[playerid] = 1;
  101. format(string, sizeof(string), "* %s Saca un porro de marihuana y se lo fuma.", ObtenerNombre(playerid));
  102. MensajeUserCercano(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  103. return 1;
  104. }
  105.  
  106. if (strcmp("/UsarChocolate", cmdtext, true, 10) == 0)
  107. {
  108. if(EstaDrogado[playerid] == 1)
  109. {
  110. SendClientMessage(playerid, AMARILLO, "Aun estas drogado");
  111. return 1;
  112. }
  113. if(TieneChocolate[playerid] == 0)
  114. {
  115. SendClientMessage(playerid, AMARILLO, "No tienes Chocolate");
  116. return 1;
  117. }
  118. SetTimerEx("Drogado", 30000, false, "i", playerid);
  119. EstaDrogado[playerid] = 1;
  120. format(string, sizeof(string), "* %s Saca un porro de Chocolate y se lo fuma.", ObtenerNombre(playerid));
  121. MensajeUserCercano(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  122. return 1;
  123. }
  124.  
  125. if (strcmp("/UsarSpeed", cmdtext, true, 10) == 0)
  126. {
  127. if(EstaDrogado[playerid] == 1)
  128. {
  129. SendClientMessage(playerid, AMARILLO, "Aun estas drogado");
  130. return 1;
  131. }
  132. if(TieneSpeed[playerid] == 0)
  133. {
  134. SendClientMessage(playerid, AMARILLO, "No tienes Speed");
  135. return 1;
  136. }
  137. SetTimerEx("Drogado", 30000, false, "i", playerid);
  138. EstaDrogado[playerid] = 1;
  139. format(string, sizeof(string), "* %s Saca un polvo blanco y lo inhala.", ObtenerNombre(playerid));
  140. MensajeUserCercano(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  141. return 1;
  142. }
  143.  
  144. if (strcmp("/UsarHeroina", cmdtext, true, 10) == 0)
  145. {
  146. if(EstaDrogado[playerid] == 1)
  147. {
  148. SendClientMessage(playerid, AMARILLO, "Aun estas drogado");
  149. return 1;
  150. }
  151. if(TieneHeroina[playerid] == 0)
  152. {
  153. SendClientMessage(playerid, AMARILLO, "No tienes Heroina");
  154. return 1;
  155. }
  156. SetTimerEx("Drogado", 30000, false, "i", playerid);
  157. EstaDrogado[playerid] = 1;
  158. format(string, sizeof(string), "* %s Saca una jeringuilla con un liquido y se lo inyecta en el brazo.", ObtenerNombre(playerid));
  159. MensajeUserCercano(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  160. return 1;
  161. }
  162. return 0;
  163. }
  164.  
  165.  
  166. forward Drogado(playerid);
  167. public Drogado(playerid)
  168. {
  169. new string[256];
  170. format(string, sizeof(string), "Se te paso el efecto de la droga.");
  171. GameTextForPlayer(playerid, string, 5000, 1);
  172. EstaDrogado[playerid] = 0;
  173. return 1;
  174. }
  175.  
  176.  
  177. forward MensajeUserCercano(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
  178. public MensajeUserCercano(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
  179. {
  180. if(IsPlayerConnected(playerid))
  181. {
  182. new Float:posx, Float:posy, Float:posz;
  183. new Float:oldposx, Float:oldposy, Float:oldposz;
  184. new Float:tempposx, Float:tempposy, Float:tempposz;
  185. GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  186. //radi = 2.0; //Trigger Radius
  187. for(new i = 0; i < MAX_PLAYERS; i++)
  188. {
  189. if(IsPlayerConnected(i) && (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i)))
  190. {
  191. if(!BigEar[i])
  192. {
  193. GetPlayerPos(i, posx, posy, posz);
  194. tempposx = (oldposx -posx);
  195. tempposy = (oldposy -posy);
  196. tempposz = (oldposz -posz);
  197. //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
  198. if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
  199. {
  200. SendClientMessage(i, col1, string);
  201. }
  202. else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
  203. {
  204. SendClientMessage(i, col2, string);
  205. }
  206. else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
  207. {
  208. SendClientMessage(i, col3, string);
  209. }
  210. else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
  211. {
  212. SendClientMessage(i, col4, string);
  213. }
  214. else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  215. {
  216. SendClientMessage(i, col5, string);
  217. }
  218. }
  219. else
  220. {
  221. SendClientMessage(i, col1, string);
  222. }
  223. }
  224. }
  225. }
  226. return 1;
  227. }
  228.  
  229. stock ObtenerNombre(playerid)
  230. {
  231. new string[24];
  232. GetPlayerName(playerid,string,24);
  233. new str[24];
  234. strmid(str,string,0,strlen(string),24);
  235. for(new i = 0; i < MAX_PLAYER_NAME; i++)
  236. {
  237. if (str[i] == '_') str[i] = ' ';
  238. }
  239. return str;
  240. }
  241.  
  242. //============================================================================//
  243. // SI TE SIRVIO RESPETA EL TRABAJO DEL CREADOR //
  244. // //
  245. //=========================FINAL DEL FILESCRIPT===============================//
  246.  
Advertisement
Add Comment
Please, Sign In to add comment