Advertisement
Guest User

Zume-Zero

a guest
Aug 24th, 2012
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.89 KB | None | 0 0
  1. /* Funciones ZumeZero v1.0 */
  2. /* Version 1.0 - 10 Funciones */
  3. /* Creado el 24/08/2012 por Zume-Zero */
  4.  
  5. /* MensajePro(playerid,color,"Texto"); - Mensaje */
  6. /* ShowInfoClientDestroy(playerid); - Destruir Info antes */
  7. /* ShowInfoClient("Texto", 5000, playerid); - Mostrar un Info */
  8. /* DarArma(playerid, id, municion); - Dar Arma al playerid */
  9. /* PlayRolUser(playerid, "Rol") - Rol Automatico añadiendo el name */
  10. /* MostrarAmmunation(playerid); - Mostrar una Tienda de armas */
  11. /* QuitarDinero(playerid, monto); - Quita el dinero y un GText Rojo con lo que perdimos */
  12. /* DarDinero(playerid, monto); - Da el dinero y un GText Verde con lo que Ganamos */
  13. /* DarDinero(playerid, monto); - Da el dinero y un GText Verde con lo que Ganamos */
  14. /* ChequearDinero(playerid, dinero) - Si tiene menos de la cantidad de 'dinero' Envia una Restriccion */
  15.  
  16. #include <a_samp>
  17.  
  18. // Importantes
  19. #define LLAMADA:%0(%1) forward %0(%1); public %0(%1) // LLAMADA:
  20. #define DarArma GivePlayerWeapon // DarArma(playerid, idarma, municion);
  21.  
  22. #define Ammunation_Orden 2182
  23. #define AMMUNATION_MENU_DEF 3791
  24. #define Ammu_Pistolas_1683 2368
  25. #define Ammu_AM_3782 732
  26. #define Ammu_Petas_192 572
  27. #define Ammu_ARraz_873 4562
  28. #define Ammu_Fesiona_282 4756
  29.  
  30. #define COLOR_DEL_ROL 0xC2A2DAAA
  31. #define Raya_Util "____"
  32. #define de_25512 "d"
  33. #define CajaColor_2792 0x00000066
  34. #define Tiempo_Nombre_a47 "[%d-%d-%d] %s"
  35. #define Message_Restriccion "¡Dinero Insuficiente! Te Falta: %d$"
  36.  
  37. #define Nombre_Y_Message "%s %s"
  38.  
  39. #define Distancia_Rol_23xD (30.0)
  40. #define Interior_Defaul (0)
  41.  
  42. // Armas - Nombres
  43. #define WEP_BRASS 1 // Brass Knuckles - Nudillos
  44. #define WEP_GOLF 2 // Golf Club - Palo de Golf
  45. #define WEP_STICK 3 // Nite Stick- Machete de policia
  46. #define WEP_KNIFE 4 // Knife- Cuchillo
  47. #define WEP_BASE 5 // Baseball Bat- Bate de Baseball
  48. #define WEP_SHOV 6 // Shovel- Pala
  49. #define WEP_POOL 7 // Pool Cue- Palo de Pool
  50. #define WEP_KATA 8 // Katana -Katana
  51. #define WEP_CHAIN 9 // ChainSaw- MotoSierra
  52. #define WEP_PUDIL 10 // Purple Dildo - Consolador Violeta
  53. #define WEP_SWVIB 11 // Small White Vibrator - Consolador blanco pequeño
  54. #define WEP_LWVIB 12 // Large White Vibrator - Consolador blanco largo
  55. #define WEP_SVIBR 13 // Silver Vibrator - Consolador plateado
  56. #define WEP_FLOW 14 // Flowers - Flores
  57. #define WEP_CANE 15 // Cane - Baston
  58. #define WEP_GRENA 16 // Grenade - Granadas
  59. #define WEP_TEAR 17 // Tear Grenade - Granada de humo
  60. #define WEP_MOLOT 18 // Molotov Cocktail - Molotov
  61. #define WEP_9MM 22// 9mm - 9mm
  62. #define WEP_SI9MM 23// Silenced 9mm - 9mm Silenciosa
  63. #define WEP_EAGLE 24 // Desert Eagle - Desert Eagle
  64. #define WEP_SHOTG 25 // Shotgun - Escopeta
  65. #define WEP_SAWNO 26// Sawn-off Shotgun - Escopeta recortada
  66. #define WEP_CSHOT 27// Combat Shotgun - Escopeta de Combate
  67. #define WEP_MISMG 28 // Micro SMG - Micro SMG
  68. #define WEP_MP5 29 // MP5 - MP5
  69. #define WEP_AK47 30// AK47 - AK47
  70. #define WEP_M4 31 // M4 - M4
  71. #define WEP_TEC9 32 // Tec9 - Tec9
  72. #define WEP_CRIFL 33 // Country Rifle - Rifle con mira
  73. #define WEP_SNIRI 34 // Sniper Rifle - Rifle de presicion
  74. #define WEP_ROCKT 35 // Rocket Launcher - Lanzacohetes sin mira
  75. #define WEP_HSROC 36 // HS Rocket Launcher - Lanzacohetes con mira
  76. #define WEP_FLAME 37 // Flamethrower - Lanzallamas
  77. #define WEP_MINIG 38 // Minigun - Minigun
  78. #define WEP_SATCH 39 // Satchel Charge - Dispositivo explosivo
  79. #define WEP_DETON 40 // Detonator - Detonador
  80. #define WEP_SPRY 41 // Spraycan - Aerosol
  81. #define WEP_FIRER 42 // Fire Extinguisher
  82. #define WEP_CAMAR 43 // Camarera - Camara de fotos
  83. #define WEP_NIGHT 44 // Nightvision Goggles - Lentes de vision nocturna
  84. #define WEP_TERM 45 // Thermal Goggles - Lentes de vision termica
  85. #define WEP_PARAC 46 // Parachute - Paracaidas
  86.  
  87. new BigEar[MAX_PLAYERS];
  88. new Text:Box_Texto[MAX_PLAYERS];
  89.  
  90. #pragma tabsize 0
  91.  
  92. LLAMADA: ShowInfoClient(texto[], interval, playerid)
  93. {
  94. ShowInfoClientDraw();
  95. TextDrawSetString(Box_Texto[playerid], texto);
  96. TextDrawShowForPlayer(playerid, Box_Texto[playerid]);
  97. SetTimerEx("ShowInfoClientDestroy", interval, false, de_25512, playerid);
  98. }
  99.  
  100. LLAMADA: ShowInfoClientDraw()
  101. {
  102. for(new playerid; playerid < MAX_PLAYERS; playerid++)
  103. {
  104. Box_Texto[playerid] = TextDrawCreate(25.000000, 190.000000,Raya_Util);
  105. TextDrawBackgroundColor(Box_Texto[playerid], 255);
  106. TextDrawFont(Box_Texto[playerid], 1);
  107. TextDrawLetterSize(Box_Texto[playerid], 0.300000, 1.299999);
  108. TextDrawColor(Box_Texto[playerid], -1);
  109. TextDrawSetOutline(Box_Texto[playerid], 1);
  110. TextDrawSetProportional(Box_Texto[playerid], 1);
  111. TextDrawUseBox(Box_Texto[playerid], 1);
  112. TextDrawBoxColor(Box_Texto[playerid],0x00000066);
  113. TextDrawTextSize(Box_Texto[playerid], 219.000000, 0.000000);
  114. }
  115. }
  116.  
  117. LLAMADA: ShowInfoClientDestroy(playerid)
  118. {
  119. TextDrawHideForPlayer(playerid, Box_Texto[playerid]);
  120. }
  121.  
  122. LLAMADA: PlayRolUser(playerid,mensaje[])
  123. {
  124. new string[128];
  125. format(string, sizeof(string), Nombre_Y_Message, UserRolerNombre(playerid), mensaje);
  126. MessageDistancia(Distancia_Rol_23xD, playerid, string, COLOR_DEL_ROL,COLOR_DEL_ROL,COLOR_DEL_ROL,COLOR_DEL_ROL,COLOR_DEL_ROL);
  127. return 1;
  128. }
  129.  
  130. LLAMADA: MessageDistancia(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
  131. {
  132. if(IsPlayerConnected(playerid))
  133. {
  134. new Float:posx, Float:posy, Float:posz;
  135. new Float:oldposx, Float:oldposy, Float:oldposz;
  136. new Float:tempposx, Float:tempposy, Float:tempposz;
  137. GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  138. for(new i = 0; i < MAX_PLAYERS; i++)
  139. {
  140. if(IsPlayerConnected(i) && (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i)))
  141. {
  142. if(!BigEar[i])
  143. {
  144. GetPlayerPos(i, posx, posy, posz);
  145. tempposx = (oldposx -posx);
  146. tempposy = (oldposy -posy);
  147. tempposz = (oldposz -posz);
  148. if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
  149. {
  150. SendClientMessage(i, col1, string);
  151. }
  152. else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
  153. {
  154. SendClientMessage(i, col2, string);
  155. }
  156. else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
  157. {
  158. SendClientMessage(i, col3, string);
  159. }
  160. else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
  161. {
  162. SendClientMessage(i, col4, string);
  163. }
  164. else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  165. {
  166. SendClientMessage(i, col5, string);
  167. }
  168. }
  169. else
  170. {
  171. SendClientMessage(i, col1, string);
  172. }
  173. }
  174. }
  175. }
  176. return 1;
  177. }
  178.  
  179. LLAMADA: MensajePro(playerid,color,texto[])
  180. {
  181. new string[250];
  182. new Hora1,Minuto1,Segundo1;
  183. gettime(Hora1,Minuto1,Segundo1);
  184. format(string, sizeof(string), Tiempo_Nombre_a47, Hora1, Minuto1, Segundo1, texto);
  185. SendClientMessage(playerid, color, string);
  186. return 1;
  187. }
  188.  
  189. stock UserRolerNombre(playerid)
  190. {
  191. new Nombre[24];
  192. GetPlayerName(playerid,Nombre,24);
  193. new N[24];
  194. strmid(N,Nombre,0,strlen(Nombre),24);
  195. for(new i = 0; i < MAX_PLAYER_NAME; i++)
  196. {
  197. if (N[i] == '_') N[i] = ' ';
  198. }
  199. return N;
  200. }
  201.  
  202. LLAMADA: MostrarAmmunation(playerid)
  203. {
  204. if(IsPlayerConnected(playerid))
  205. {
  206. ShowPlayerDialog(playerid,Ammunation_Orden,DIALOG_STYLE_LIST,"Ammunation_Tienda","Pistolas\nMetralletas\nEscopetas\nArrojadizas\nProtección","Mirar","Salir");
  207. }
  208. return 1;
  209. }
  210.  
  211. LLAMADA: OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  212. {
  213.  
  214. if(dialogid == Ammunation_Orden)
  215. {
  216. if(response == 1)
  217. {
  218. switch(listitem)
  219. {
  220. case 0:
  221. {
  222. ShowPlayerDialog(playerid,Ammu_Pistolas_1683,DIALOG_STYLE_LIST,"Pistolas","9mm :20: - (220$)\nDesert Eagle :10: - (300$)","Aceptar","Atras");
  223. }
  224. case 1:
  225. {
  226. ShowPlayerDialog(playerid,Ammu_AM_3782,DIALOG_STYLE_LIST,"Fusiles","MP5 :100: - (799$)\nM4 :150: - (1099$)\nAK-47 :250: - (1400$)","Aceptar","Atras");
  227. }
  228. case 2:
  229. {
  230. ShowPlayerDialog(playerid,Ammu_Petas_192,DIALOG_STYLE_LIST,"Escopetas","Escopeta Caza :20: - (399$)\nShotgun :15: - (499$)","Aceptar","Atras");
  231. }
  232. case 3:
  233. {
  234. ShowPlayerDialog(playerid,Ammu_Fesiona_282,DIALOG_STYLE_LIST,"Protección","Chaleco - (400$)\nCaja PainKillerS :6: - (99$)","Aceptar","Atras");
  235. }
  236. }
  237. }
  238. }
  239.  
  240. if(dialogid == AMMUNATION_MENU_DEF)
  241. {
  242. if(response == 1)
  243. {
  244. switch(listitem)
  245. {
  246. case 0:
  247. {
  248. QuitarDinero(playerid, 5);
  249. DarArma(playerid, 41, 500);
  250. }
  251. case 1:
  252. {
  253. QuitarDinero(playerid, 25);
  254. DarArma(playerid, 1,1);
  255. }
  256. case 2:
  257. {
  258. QuitarDinero(playerid, 45);
  259. DarArma(playerid, 4,1);
  260. }
  261. case 3:
  262. {
  263. QuitarDinero(playerid, 15);
  264. DarArma(playerid, 15,1);
  265. }
  266. case 4:
  267. {
  268. QuitarDinero(playerid, 75);
  269. DarArma(playerid, 5,1);
  270. }
  271. }
  272. } else MostrarAmmunation(playerid);
  273. }
  274.  
  275. if(dialogid == Ammu_Pistolas_1683)
  276. {
  277. if(response == 1)
  278. {
  279. switch(listitem)
  280. {
  281. case 0:
  282. {
  283. QuitarDinero(playerid, 220);
  284. DarArma(playerid,22,20);
  285. }
  286. case 1:
  287. {
  288. QuitarDinero(playerid, 300);
  289. DarArma(playerid, 24,10);
  290. }
  291. }
  292. } else MostrarAmmunation(playerid);
  293. }
  294.  
  295. if(dialogid == Ammu_AM_3782)
  296. {
  297. if(response == 1)
  298. {
  299. switch(listitem)
  300. {
  301. case 0:
  302. {
  303. QuitarDinero(playerid, 799);
  304. DarArma(playerid, 29,100);
  305. }
  306. case 1:
  307. {
  308. QuitarDinero(playerid, 1099);
  309. DarArma(playerid, 31,150);
  310. }
  311. case 2:
  312. {
  313. QuitarDinero(playerid, 1400);
  314. DarArma(playerid, 30,250);
  315. }
  316. }
  317. } else MostrarAmmunation(playerid);
  318. }
  319.  
  320. if(dialogid == Ammu_Petas_192)
  321. {
  322. if(response == 1)
  323. {
  324. switch(listitem)
  325. {
  326. case 0:
  327. {
  328. QuitarDinero(playerid, 399);
  329. DarArma(playerid, 33,20);
  330. }
  331. case 1:
  332. {
  333. QuitarDinero(playerid, 499);
  334. DarArma(playerid, 25,15);
  335. }
  336. }
  337. } else MostrarAmmunation(playerid);
  338. }
  339.  
  340. if(dialogid == Ammu_ARraz_873)
  341. {
  342. if(response == 1)
  343. {
  344. switch(listitem)
  345. {
  346. case 0:
  347. {
  348. QuitarDinero(playerid, 20);
  349. DarArma(playerid, 18,1);
  350. }
  351. }
  352. } else MostrarAmmunation(playerid);
  353. }
  354.  
  355. if(dialogid == Ammu_Fesiona_282)
  356. {
  357. if(response == 1)
  358. {
  359. switch(listitem)
  360. {
  361. case 0:
  362. {
  363. QuitarDinero(playerid, 400);
  364. SetPlayerArmour(playerid, 100);
  365. }
  366. }
  367. } else MostrarAmmunation(playerid);
  368. }
  369.  
  370. return 1;
  371. }
  372.  
  373. LLAMADA: QuitarDinero(playerid, monto)
  374. {
  375. if(IsPlayerConnected(playerid))
  376. {
  377. new a[12];
  378. format(a,sizeof(a),"~r~ -%d$",monto);
  379. GameTextForPlayer(playerid, a, 5000, 1);
  380. GivePlayerMoney(playerid, -monto);
  381. PlayerPlaySound(playerid, 1084, 0.0, 0.0, 0.0);
  382. }
  383. return 1;
  384. }
  385.  
  386. LLAMADA: DarDinero(playerid, monto)
  387. {
  388. if(IsPlayerConnected(playerid))
  389. {
  390. new a[12];
  391. format(a,sizeof(a),"~g~ %d$",monto);
  392. GameTextForPlayer(playerid, a, 5000, 1);
  393. GivePlayerMoney(playerid, monto);
  394. PlayerPlaySound(playerid, 1083, 0.0, 0.0, 0.0);
  395. }
  396. return 1;
  397. }
  398.  
  399. LLAMADA: ChequearDinero(playerid, dinero)
  400. {
  401. if(IsPlayerConnected(playerid))
  402. {
  403. new b[64];
  404. new xx;
  405. xx = dinero - (GetPlayerMoney(playerid));
  406. if(GetPlayerMoney(playerid) >= dinero)
  407. {
  408. return 1;
  409. }
  410. else
  411. {
  412. format(b,sizeof(b),Message_Restriccion,xx);
  413. SendClientMessage(playerid, 0xDC092FFF, b);
  414. return 0;
  415. }
  416. }
  417. return 0;
  418. }
  419.  
  420. ////////////////////////////////// By Zume-Zero ////////////////////////////////
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement