Badyx

[FS] Robos en casas.

Jul 22nd, 2019
601
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.71 KB | None | 0 0
  1. // Robos By BadyX
  2. /*
  3. 367 Cámara
  4. 1792 Televisor
  5. 1719 Consola blanca
  6. 2028 Consola negra
  7. 1210 Maletín
  8. 2149 Microondas
  9. 11743 Cafetera
  10. */
  11.  
  12. #include <a_samp>
  13. #include <streamer>
  14. #include <zcmd>
  15. #include <a_actor>
  16. #include <easyDialog>
  17.  
  18. #define funcion%0(%1) forward %0(%1); public %0(%1)
  19.  
  20. new ObjetosRobo[8];
  21. new ObjetosFlechas[8];
  22. new Actores[1];
  23. new ObjetoEnManos[MAX_PLAYERS];
  24. new ObjetosEnVehiculo[MAX_VEHICLES][32];
  25. new ViendoMaleteroCoche[MAX_PLAYERS];
  26. new bool:EstaRobando[MAX_PLAYERS];
  27. new PickupRobo;
  28. public OnFilterScriptInit()
  29. {
  30. print("\n--------------------------------------");
  31. print(" [FS] Robos en casas cargado.");
  32. print("--------------------------------------\n");
  33. PickupRobo = CreatePickup(1239, 19, 2736.3992,-2003.8533,13.5472, 0);
  34. for (new i = 1; i != MAX_VEHICLES; i ++)
  35. {
  36. for(new slot = 0; slot < 32; slot++)
  37. {
  38. ObjetosEnVehiculo[i][slot] = -1;
  39. }
  40. }
  41. return 1;
  42. }
  43.  
  44. public OnFilterScriptExit()
  45. {
  46. return 1;
  47. }
  48.  
  49. main()
  50. {
  51. print("\n----------------------------------");
  52. print(" Sistema de robos By BadyX");
  53. print("----------------------------------\n");
  54. }
  55.  
  56. /* Comandos */
  57.  
  58. CMD:ir(playerid, params[])
  59. {
  60. if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "[!] Necesitas estar logeado con RCON para usar el comando.");
  61. SetPlayerPos(playerid, 2807.619873, -1171.899902,1025.570312);
  62. SetPlayerInterior(playerid, 8);
  63. return 1;
  64. }
  65.  
  66. CMD:ir2(playerid, params[])
  67. {
  68. if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "[!] Necesitas estar logeado con RCON para usar el comando.");
  69. SetPlayerPos(playerid, 2736.3992,-2003.8533,13.5472);
  70. SetPlayerInterior(playerid, 0);
  71. return 1;
  72. }
  73.  
  74. CMD:robar(playerid, params[])
  75. {
  76. switch(EstaRobando[playerid])
  77. {
  78. case false:
  79. {
  80. if(GetPlayerDistanceFromPoint(playerid, 2807.619873, -1171.899902,1025.570312) > 20.0) return SendClientMessage(playerid, -1, "[!] No estás en una vivienda que se pueda robar.");
  81. ColocarObjetosParaRobo();
  82. ObjetoEnManos[playerid] = -1;
  83. EstaRobando[playerid] = true;
  84. SendClientMessage(playerid, -1, "[!] Busca objetos de valor por la casa.");
  85. }
  86. case true:
  87. {
  88. DestruirObjetosRobo();
  89. DestroyDynamicActor(Actores[0]);
  90. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
  91. ObjetoEnManos[playerid] = -1;
  92. EstaRobando[playerid] = false;
  93. SendClientMessage(playerid, -1, "[!] Dejaste de robar casa.");
  94. }
  95. }
  96. return 1;
  97. }
  98.  
  99.  
  100. CMD:vender(playerid, params[])
  101. {
  102. if(GetPlayerDistanceFromPoint(playerid, 2736.3992,-2003.8533,13.5472) > 2.0) return SendClientMessage(playerid, -1, "[!] No estás cerca del almacen para vender objetos.");
  103. if(ObjetoEnManos[playerid] == -1) return SendClientMessage(playerid, -1, "[!] No tienes ningún objeto en tus manos para vender.");
  104. PagarPorObjeto(playerid, ObjetoEnManos[playerid]);
  105. return 1;
  106. }
  107.  
  108. CMD:ver(playerid, params[])
  109. {
  110. new dialog[2024], string[128];
  111. new Conteo, Resultado;
  112. for(new i; i != MAX_VEHICLES; i++)
  113. {
  114. new dist = CheckPlayerDistanceToVehicle(4.5, playerid, i);
  115. if(dist)
  116. {
  117. Resultado = i;
  118. Conteo++;
  119. }
  120. }
  121. if(Conteo == 0) return SendClientMessage(playerid, -1, "Ningún vehículo cerca de usted.");
  122. if(Conteo > 1) return SendClientMessage(playerid, -1, "Encontrado más de un vehículo acercate bien.");
  123. ViendoMaleteroCoche[playerid] = Resultado;
  124. for(new i = 0; i < 32; i++)
  125. {
  126. new Bol = ObjetosEnVehiculo[Resultado][i];
  127. if(Bol == 0){format(string, sizeof(string), "\n{5cacee}#%d: {ffffff}Espacio libre", i+1);}
  128. else{format(string, sizeof(string), "\n{5cacee}#%d: {ffffff}%s {5cacee}", i+1, ObtenerNombreObjeto(ObjetosEnVehiculo[Resultado][i])); }
  129. strcat(dialog, string);
  130. }
  131. Dialog_Show(playerid, VerMaletero, DIALOG_STYLE_LIST, "Maletero", dialog, "Aceptar", "");
  132. return 1;
  133. }
  134.  
  135. CMD:guardar(playerid, params[])
  136. {
  137. new Conteo, Resultado, TotalObjetos = 0;
  138. if(ObjetoEnManos[playerid] == -1) return SendClientMessage(playerid, -1, "No tienes ningún objeto para guardar.");
  139. for(new i; i != MAX_VEHICLES; i++)
  140. {
  141. new dist = CheckPlayerDistanceToVehicle(4.5, playerid, i);
  142. if(dist)
  143. {
  144. Resultado = i;
  145. Conteo++;
  146. }
  147. }
  148. if(Conteo == 0) return SendClientMessage(playerid, -1, "Ningún vehículo cerca de usted.");
  149. if(Conteo > 1) return SendClientMessage(playerid, -1, "Encontrado más de un vehículo acercate bien.");
  150. if(GetVehicleModel(Resultado) != 498) return SendClientMessage(playerid, -1, "Necesitas una furgoneta de ladrón para guardar los objetos.");
  151. new string[100];
  152.  
  153. for(new slot = 0; slot < 32; slot++)
  154. {
  155. if(ObjetosEnVehiculo[Resultado][slot] == -1)
  156. {
  157. format(string, sizeof string, "Guardaste %s.\n", ObtenerNombreObjeto(ObjetoEnManos[playerid]));
  158. SendClientMessage(playerid, -1, string);
  159. ObjetosEnVehiculo[Resultado][slot] = ObjetoEnManos[playerid];
  160. RemovePlayerAttachedObject(playerid, 0);
  161. ObjetoEnManos[playerid] = -1;
  162. TotalObjetos ++;
  163. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
  164. break;
  165. }
  166. }
  167. if(TotalObjetos == 0)
  168. {
  169. SendClientMessage(playerid, -1, "Éste vehículo no puede guardar más objetos.");
  170. return 1;
  171. }
  172. return 1;
  173. }
  174.  
  175. /* Funciones */
  176.  
  177. Dialog:VerMaletero(playerid, response, listitem, inputtext[])
  178. {
  179. if(!response) return 1;
  180. if(ObjetosEnVehiculo[ViendoMaleteroCoche[playerid]][listitem] != -1)
  181. {
  182. if(ObjetoEnManos[playerid] == -1)
  183. {
  184. SendClientMessage(playerid, -1, "Objeto sacado.");
  185.  
  186. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_CARRY);
  187. ApplyAnimation(playerid, "CARRY","crry_prtial",4.1,0,1,1,1,1);
  188. ApplyAnimation(playerid, "CARRY","crry_prtial",4.1,0,1,1,1,1);
  189. ObjetoEnManos[playerid] = ObjetosEnVehiculo[ViendoMaleteroCoche[playerid]][listitem];
  190. ObjetosEnVehiculo[ViendoMaleteroCoche[playerid]][listitem] = -1;
  191. switch(ObjetoEnManos[playerid])
  192. {
  193. case 0:
  194. {
  195. SetPlayerAttachedObject(playerid,0,367,6,0.198000,0.051999,0.107000,-108.099960,7.900002,83.099945,1.468000,1.000000,1.000000);
  196. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_CARRY);
  197. ApplyAnimation(playerid, "CARRY","crry_prtial",4.1,0,1,1,1,1);
  198. ApplyAnimation(playerid, "CARRY","crry_prtial",4.1,0,1,1,1,1);
  199. }
  200. case 2:
  201. {
  202. SetPlayerAttachedObject(playerid,0,2028,6,0.045999,0.008000,-0.165999,74.899986,178.400009,82.499969,0.743999,0.642000,0.795000);
  203. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_CARRY);
  204. ApplyAnimation(playerid, "CARRY","crry_prtial",4.1,0,1,1,1,1);
  205. ApplyAnimation(playerid, "CARRY","crry_prtial",4.1,0,1,1,1,1);
  206. }
  207. case 3:
  208. {
  209. SetPlayerAttachedObject(playerid,0,1210,6,0.000000,0.063999,-0.186999,-18.399997,84.799995,0.000000,1.000000,1.000000,1.000000);
  210. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_CARRY);
  211. ApplyAnimation(playerid, "CARRY","crry_prtial",4.1,0,1,1,1,1);
  212. ApplyAnimation(playerid, "CARRY","crry_prtial",4.1,0,1,1,1,1);
  213. }
  214. case 4:
  215. {
  216. SetPlayerAttachedObject(playerid,0,1719,6,0.045999,0.008000,-0.165999,74.899986,178.400009,82.499969,0.743999,0.642000,0.795000);
  217. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_CARRY);
  218. ApplyAnimation(playerid, "CARRY","crry_prtial",4.1,0,1,1,1,1);
  219. ApplyAnimation(playerid, "CARRY","crry_prtial",4.1,0,1,1,1,1);
  220. }
  221. case 5:
  222. {
  223. SetPlayerAttachedObject(playerid,0,1792,6,-0.137999,-0.022000,-0.160000,-105.900016,-1.299999,82.399955,0.646000,0.816000,0.720000);
  224. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_CARRY);
  225. ApplyAnimation(playerid, "CARRY","crry_prtial",4.1,0,1,1,1,1);
  226. ApplyAnimation(playerid, "CARRY","crry_prtial",4.1,0,1,1,1,1);
  227. }
  228. case 6:
  229. {
  230. SetPlayerAttachedObject(playerid,0,11743,6,0.050999,0.157000,0.001999,162.499969,9.800006,0.699999,0.606000,0.686999,0.812000);
  231. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_CARRY);
  232. ApplyAnimation(playerid, "CARRY","crry_prtial",4.1,0,1,1,1,1);
  233. ApplyAnimation(playerid, "CARRY","crry_prtial",4.1,0,1,1,1,1);
  234. }
  235. case 7:
  236. {
  237. SetPlayerAttachedObject(playerid,0,2149,6,0.089000,0.112999,-0.155999,-106.799972,-8.799959,71.500000,1.000000,1.000000,1.000000);
  238. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_CARRY);
  239. ApplyAnimation(playerid, "CARRY","crry_prtial",4.1,0,1,1,1,1);
  240. ApplyAnimation(playerid, "CARRY","crry_prtial",4.1,0,1,1,1,1);
  241. }
  242. }
  243. }
  244. }
  245. else
  246. {
  247. SendClientMessage(playerid, -1, "No hay ningún objeto para sacar en ese slot.");
  248. }
  249. return 1;
  250. }
  251.  
  252. stock CheckPlayerDistanceToVehicle(Float:radi, playerid, vehicleid)
  253. {
  254. if(IsPlayerConnected(playerid))
  255. {
  256. new Float:PX,Float:PY,Float:PZ,Float:X,Float:Y,Float:Z;
  257. GetPlayerPos(playerid,PX,PY,PZ);
  258. GetVehiclePos(vehicleid, X,Y,Z);
  259. new Float:Distance = (X-PX)*(X-PX)+(Y-PY)*(Y-PY)+(Z-PZ)*(Z-PZ);
  260. if(Distance <= radi*radi)
  261. {
  262. return 1;
  263. }
  264. }
  265. return 0;
  266. }
  267.  
  268. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  269. {
  270. if(newkeys & KEY_YES)
  271. {
  272. if(EstaRobando[playerid] == true)
  273. {
  274. CercaDeObjeto(playerid);
  275. }
  276. }
  277. return 1;
  278. }
  279.  
  280. public OnPlayerConnect(playerid)
  281. {
  282. EstaRobando[playerid] = false;
  283. ObjetoEnManos[playerid] = -1;
  284. return 1;
  285. }
  286.  
  287. funcion ColocarObjetosParaRobo()
  288. {
  289. ObjetosRobo[0] = CreateDynamicObject(367, 2810.40137, -1167.04810, 1025.08875, 0.00000, 0.00000, 0.00000); //Camara
  290. ObjetosRobo[1] = CreateDynamicObject(1821, 2804.98022, -1171.09167, 1024.56250, 3.14160, 0.00000, -90.18170); //Mesa de decoración
  291. ObjetosRobo[2] = CreateDynamicObject(2028, 2805.32007, -1171.68420, 1025.10864, 0.00000, 0.00000, 0.00000); //Consola negra
  292. ObjetosRobo[3] = CreateDynamicObject(1210, 2819.63110, -1165.62585, 1028.97314, 90.00000, 0.00000, 270.00000); //Maletín
  293. ObjetosRobo[4] = CreateDynamicObject(1719, 2810.95142, -1165.37976, 1025.38354, 0.00000, 0.00000, 0.00000); //Consola blanca
  294. ObjetosRobo[5] = CreateDynamicObject(1792, 2815.05811, -1173.54016, 1025.31848, 0.00000, 0.00000, 180.00000); //Televisor
  295. ObjetosRobo[6] = CreateDynamicObject(11743, 2820.42578, -1167.46448, 1025.62134, 0.00000, 0.00000, 270.00000); //Cafetera
  296. ObjetosRobo[7] = CreateDynamicObject(2149, 2818.48608, -1165.15588, 1025.75403, 0.00000, 0.00000, 0.00000); //Microondas
  297.  
  298. ObjetosFlechas[0] = CreateDynamicObject(1559, 2805.41870, -1171.58545, 1026.22314, 0.00000, 0.00000, 0.00000); //Consola negra
  299. ObjetosFlechas[1] = CreateDynamicObject(1559, 2810.90503, -1165.32532, 1026.56311, 0.00000, 0.00000, 0.00000); //Consola blanca
  300. ObjetosFlechas[2] = CreateDynamicObject(1559, 2810.46338, -1166.89905, 1026.22314, 0.00000, 0.00000, 0.00000); //Cámara
  301. ObjetosFlechas[3] = CreateDynamicObject(1559, 2818.52222, -1165.14221, 1026.98315, 0.00000, 0.00000, 0.00000); //Microondas
  302. ObjetosFlechas[4] = CreateDynamicObject(1559, 2820.48901, -1167.44141, 1027.18323, 0.00000, 0.00000, 0.00000); //Cafetera
  303. ObjetosFlechas[5] = CreateDynamicObject(1559, 2815.02734, -1173.16248, 1027.26318, 0.00000, 0.00000, 0.00000); //Televisor
  304. ObjetosFlechas[6] = CreateDynamicObject(1559, 2819.55225, -1165.58606, 1030.02417, 0.00000, 0.00000, 0.00000); //Maletín
  305.  
  306. Actores[0] = CreateDynamicActor(252, 2817.0649,-1169.1329,1029.9033,249.6644);
  307. ApplyDynamicActorAnimation(Actores[0], "CRACK","crckidle2",4.1,0,1,1,1,1);
  308. ApplyDynamicActorAnimation(Actores[0], "CRACK","crckidle2",4.1,0,1,1,1,1);
  309. return 1;
  310. }
  311.  
  312. funcion DestruirObjetosRobo()
  313. {
  314. for(new slot = 0; slot < 7; slot++)
  315. {
  316. DestroyDynamicObject(ObjetosRobo[slot]);
  317. DestroyDynamicObject(ObjetosFlechas[slot]);
  318. }
  319. return 1;
  320. }
  321.  
  322. funcion CercaDeObjeto(Jugador)
  323. {
  324. new Conteo = 0;
  325. if(IsPlayerInRangeOfPoint(Jugador, 1.0, 2810.40137, -1167.04810, 1025.08875))
  326. {
  327. if(ObjetoEnManos[Jugador] != -1) return SendClientMessage(Jugador, -1, "Ya portas un objeto en tus manos, déjalo primero.");
  328. SendClientMessage(Jugador, -1, # Cámara cerca);
  329. SetPlayerSpecialAction(Jugador, SPECIAL_ACTION_CARRY);
  330. SetPlayerAttachedObject(Jugador,0,367,6,0.198000,0.051999,0.107000,-108.099960,7.900002,83.099945,1.468000,1.000000,1.000000);
  331. ApplyAnimation(Jugador, "CARRY","crry_prtial",4.1,0,1,1,1,1);
  332. ApplyAnimation(Jugador, "CARRY","crry_prtial",4.1,0,1,1,1,1);
  333. DestroyDynamicObject(ObjetosRobo[0]);
  334. DestroyDynamicObject(ObjetosFlechas[2]);
  335. ObjetoEnManos[Jugador] = 0;
  336. Conteo ++;
  337. }
  338. else if(IsPlayerInRangeOfPoint(Jugador, 2.0, 2815.05811, -1173.54016, 1025.31848))
  339. {
  340. if(ObjetoEnManos[Jugador] != -1) return SendClientMessage(Jugador, -1, "Ya portas un objeto en tus manos, déjalo primero.");
  341. SendClientMessage(Jugador, -1, # Televisor cerca);
  342. SetPlayerSpecialAction(Jugador, SPECIAL_ACTION_CARRY);
  343. SetPlayerAttachedObject(Jugador,0,1792,6,-0.137999,-0.022000,-0.160000,-105.900016,-1.299999,82.399955,0.646000,0.816000,0.720000);
  344. ApplyAnimation(Jugador, "CARRY","crry_prtial",4.1,0,1,1,1,1);
  345. ApplyAnimation(Jugador, "CARRY","crry_prtial",4.1,0,1,1,1,1);
  346. DestroyDynamicObject(ObjetosRobo[5]);
  347. DestroyDynamicObject(ObjetosFlechas[5]);
  348. Conteo ++;
  349. ObjetoEnManos[Jugador] = 5;
  350. }
  351. else if(IsPlayerInRangeOfPoint(Jugador, 1.0, 2805.32007, -1171.68420, 1025.10864))
  352. {
  353. if(ObjetoEnManos[Jugador] != -1) return SendClientMessage(Jugador, -1, "Ya portas un objeto en tus manos, déjalo primero.");
  354. SendClientMessage(Jugador, -1, # Videoconsola negra);
  355. SetPlayerSpecialAction(Jugador, SPECIAL_ACTION_CARRY);
  356. SetPlayerAttachedObject(Jugador,0,2028,6,0.045999,0.008000,-0.165999,74.899986,178.400009,82.499969,0.743999,0.642000,0.795000);
  357. ApplyAnimation(Jugador, "CARRY","crry_prtial",4.1,0,1,1,1,1);
  358. ApplyAnimation(Jugador, "CARRY","crry_prtial",4.1,0,1,1,1,1);
  359. DestroyDynamicObject(ObjetosRobo[2]);
  360. DestroyDynamicObject(ObjetosFlechas[0]);
  361. ObjetoEnManos[Jugador] = 2;
  362. Conteo ++;
  363. }
  364. else if(IsPlayerInRangeOfPoint(Jugador, 1.0, 2819.63110, -1165.62585, 1028.97314))
  365. {
  366. if(ObjetoEnManos[Jugador] != -1) return SendClientMessage(Jugador, -1, "Ya portas un objeto en tus manos, déjalo primero.");
  367. SendClientMessage(Jugador, -1, # Maletín cerca);
  368. SetPlayerSpecialAction(Jugador, SPECIAL_ACTION_CARRY);
  369. SetPlayerAttachedObject(Jugador,0,1210,6,0.000000,0.063999,-0.186999,-18.399997,84.799995,0.000000,1.000000,1.000000,1.000000);
  370. ApplyAnimation(Jugador, "CARRY","crry_prtial",4.1,0,1,1,1,1);
  371. ApplyAnimation(Jugador, "CARRY","crry_prtial",4.1,0,1,1,1,1);
  372. DestroyDynamicObject(ObjetosRobo[3]);
  373. DestroyDynamicObject(ObjetosFlechas[6]);
  374. ObjetoEnManos[Jugador] = 3;
  375. Conteo ++;
  376. }
  377. else if(IsPlayerInRangeOfPoint(Jugador, 1.0, 2810.95142, -1165.37976, 1025.38354))
  378. {
  379. if(ObjetoEnManos[Jugador] != -1) return SendClientMessage(Jugador, -1, "Ya portas un objeto en tus manos, déjalo primero.");
  380. SendClientMessage(Jugador, -1, # Videoconsola blanca);
  381. SetPlayerSpecialAction(Jugador, SPECIAL_ACTION_CARRY);
  382. SetPlayerAttachedObject(Jugador,0,1719,6,0.045999,0.008000,-0.165999,74.899986,178.400009,82.499969,0.743999,0.642000,0.795000);
  383. ApplyAnimation(Jugador, "CARRY","crry_prtial",4.1,0,1,1,1,1);
  384. ApplyAnimation(Jugador, "CARRY","crry_prtial",4.1,0,1,1,1,1);
  385. DestroyDynamicObject(ObjetosRobo[4]);
  386. DestroyDynamicObject(ObjetosFlechas[1]);
  387. ObjetoEnManos[Jugador] = 4;
  388. Conteo ++;
  389. }
  390. else if(IsPlayerInRangeOfPoint(Jugador, 1.0, 2820.42578, -1167.46448, 1025.62134))
  391. {
  392. if(ObjetoEnManos[Jugador] != -1) return SendClientMessage(Jugador, -1, "Ya portas un objeto en tus manos, déjalo primero.");
  393. SendClientMessage(Jugador, -1, # Cafetera cerca);
  394. SetPlayerSpecialAction(Jugador, SPECIAL_ACTION_CARRY);
  395. SetPlayerAttachedObject(Jugador,0,11743,6,0.050999,0.157000,0.001999,162.499969,9.800006,0.699999,0.606000,0.686999,0.812000);
  396. ApplyAnimation(Jugador, "CARRY","crry_prtial",4.1,0,1,1,1,1);
  397. ApplyAnimation(Jugador, "CARRY","crry_prtial",4.1,0,1,1,1,1);
  398. DestroyDynamicObject(ObjetosRobo[6]);
  399. DestroyDynamicObject(ObjetosFlechas[4]);
  400. ObjetoEnManos[Jugador] = 6;
  401. Conteo ++;
  402. }
  403. else if(IsPlayerInRangeOfPoint(Jugador, 1.0, 2818.48608, -1165.15588, 1025.75403))
  404. {
  405. if(ObjetoEnManos[Jugador] != -1) return SendClientMessage(Jugador, -1, "Ya portas un objeto en tus manos, déjalo primero.");
  406. SendClientMessage(Jugador, -1, # Microondas cerca);
  407. SetPlayerSpecialAction(Jugador, SPECIAL_ACTION_CARRY);
  408. SetPlayerAttachedObject(Jugador,0,2149,6,0.089000,0.112999,-0.155999,-106.799972,-8.799959,71.500000,1.000000,1.000000,1.000000);
  409. ApplyAnimation(Jugador, "CARRY","crry_prtial",4.1,0,1,1,1,1);
  410. ApplyAnimation(Jugador, "CARRY","crry_prtial",4.1,0,1,1,1,1);
  411. DestroyDynamicObject(ObjetosRobo[7]);
  412. DestroyDynamicObject(ObjetosFlechas[3]);
  413. ObjetoEnManos[Jugador] = 7;
  414. Conteo ++;
  415. }
  416. if(Conteo == 0) return SendClientMessage(Jugador, -1, # No hay objetos cercanos);
  417. return 1;
  418. }
  419.  
  420. stock ObtenerNombreObjeto(id)
  421. {
  422. new nombre[64] = "n objeto desconocido";
  423. if(id == -1) nombre = "Slot libre";
  424. if(id == 0) nombre = "Una cámara fotográfica";
  425. if(id == 2) nombre = "Una videoconsola negra";
  426. if(id == 3) nombre = "Un maletín";
  427. if(id == 4) nombre = "Una videoconsola blanca";
  428. if(id == 5) nombre = "Un televisor";
  429. if(id == 6) nombre = "Una cafetera";
  430. if(id == 7) nombre = "Un microondas";
  431. return nombre;
  432. }
  433.  
  434. funcion PagarPorObjeto(Jugador, Objeto)
  435. {
  436. new string[80];
  437. switch(Objeto)
  438. {
  439. case 0:
  440. {
  441. new PrecioCamara = random(100) + 200;
  442. GivePlayerMoney(Jugador, PrecioCamara);
  443. format(string, sizeof(string), "Recibiste %d$ por vender \n", PrecioCamara, ObtenerNombreObjeto(ObjetoEnManos[Jugador]));
  444. SendClientMessage(Jugador, -1, string);
  445. ObjetoEnManos[Jugador] = -1;
  446. RemovePlayerAttachedObject(Jugador, 0);
  447. SetPlayerSpecialAction(Jugador, SPECIAL_ACTION_NONE);
  448. }
  449. case 2:
  450. {
  451. new PrecioConsolaNegra = random(300) + 200;
  452. GivePlayerMoney(Jugador, PrecioConsolaNegra);
  453. format(string, sizeof(string), "Recibiste %d$ por vender \n", PrecioConsolaNegra, ObtenerNombreObjeto(ObjetoEnManos[Jugador]));
  454. SendClientMessage(Jugador, -1, string);
  455. ObjetoEnManos[Jugador] = -1;
  456. RemovePlayerAttachedObject(Jugador, 0);
  457. SetPlayerSpecialAction(Jugador, SPECIAL_ACTION_NONE);
  458. }
  459. case 3:
  460. {
  461. GivePlayerMoney(Jugador, 5000);
  462. SendClientMessage(Jugador, -1, "Recibiste 5000$ por el maletín.");
  463. ObjetoEnManos[Jugador] = -1;
  464. RemovePlayerAttachedObject(Jugador, 0);
  465. SetPlayerSpecialAction(Jugador, SPECIAL_ACTION_NONE);
  466. }
  467. case 4:
  468. {
  469. new PrecioConsolaBlanca = random(300) + 200;
  470. GivePlayerMoney(Jugador, PrecioConsolaBlanca);
  471. format(string, sizeof(string), "Recibiste %d$ por vender \n", PrecioConsolaBlanca, ObtenerNombreObjeto(ObjetoEnManos[Jugador]));
  472. SendClientMessage(Jugador, -1, string);
  473. ObjetoEnManos[Jugador] = -1;
  474. RemovePlayerAttachedObject(Jugador, 0);
  475. SetPlayerSpecialAction(Jugador, SPECIAL_ACTION_NONE);
  476. }
  477. case 5:
  478. {
  479. new PrecioTelevisor = random(400) + 200;
  480. GivePlayerMoney(Jugador, PrecioTelevisor);
  481. format(string, sizeof(string), "Recibiste %d$ por vender \n", PrecioTelevisor, ObtenerNombreObjeto(ObjetoEnManos[Jugador]));
  482. SendClientMessage(Jugador, -1, string);
  483. ObjetoEnManos[Jugador] = -1;
  484. RemovePlayerAttachedObject(Jugador, 0);
  485. SetPlayerSpecialAction(Jugador, SPECIAL_ACTION_NONE);
  486. }
  487. case 6:
  488. {
  489. new PrecioCafetera = random(100) + 150;
  490. GivePlayerMoney(Jugador, PrecioCafetera);
  491. format(string, sizeof(string), "Recibiste %d$ por vender \n", PrecioCafetera, ObtenerNombreObjeto(ObjetoEnManos[Jugador]));
  492. SendClientMessage(Jugador, -1, string);
  493. ObjetoEnManos[Jugador] = -1;
  494. RemovePlayerAttachedObject(Jugador, 0);
  495. SetPlayerSpecialAction(Jugador, SPECIAL_ACTION_NONE);
  496. }
  497. case 7:
  498. {
  499. new PrecioMicroondas = random(100) + 150;
  500. GivePlayerMoney(Jugador, PrecioMicroondas);
  501. format(string, sizeof(string), "Recibiste %d$ por vender \n", PrecioMicroondas, ObtenerNombreObjeto(ObjetoEnManos[Jugador]));
  502. SendClientMessage(Jugador, -1, string);
  503. ObjetoEnManos[Jugador] = -1;
  504. RemovePlayerAttachedObject(Jugador, 0);
  505. SetPlayerSpecialAction(Jugador, SPECIAL_ACTION_NONE);
  506. }
  507.  
  508. }
  509. return 1;
  510. }
  511.  
  512. #pragma unused PickupRobo
Advertisement
Add Comment
Please, Sign In to add comment