Advertisement
Guest User

Untitled

a guest
May 8th, 2018
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 47.08 KB | None | 0 0
  1. BPS::RemovePlayerAttachedObjectEx(playerid,SlotReal)
  2. {
  3. if(ItemSlotA[playerid][SlotReal] != -1)
  4. {
  5. if(ItemSlotP[playerid][ItemSlotA[playerid][SlotReal]] != Vaga_Aureola1 && ItemSlotP[playerid][ItemSlotA[playerid][SlotReal]] != Vaga_Aureola2
  6. && ItemSlotP[playerid][ItemSlotA[playerid][SlotReal]] != Vaga_Celular && ItemSlotP[playerid][ItemSlotA[playerid][SlotReal]] != Vaga_Roubo
  7. && ItemSlotP[playerid][ItemSlotA[playerid][SlotReal]] != Vaga_Radio && ItemSlotP[playerid][ItemSlotA[playerid][SlotReal]] != Vaga_Pa
  8. && ItemSlotP[playerid][ItemSlotA[playerid][SlotReal]] != Vaga_Maconha && ItemSlotP[playerid][ItemSlotA[playerid][SlotReal]] != Vaga_Escudo
  9. && ItemSlotP[playerid][ItemSlotA[playerid][SlotReal]] != Vaga_Planta && ItemSlotP[playerid][ItemSlotA[playerid][SlotReal]] != Vaga_Corrente
  10. && ItemSlotP[playerid][ItemSlotA[playerid][SlotReal]] != Vaga_Ejetar && ItemSlotP[playerid][ItemSlotA[playerid][SlotReal]] != Vaga_Ejetar2
  11. && ItemSlotP[playerid][ItemSlotA[playerid][SlotReal]] != Vaga_Escudo && ItemSlotP[playerid][ItemSlotA[playerid][SlotReal]] != Vaga_Colete
  12. && ItemSlotP[playerid][ItemSlotA[playerid][SlotReal]] != Vaga_Taser)
  13. {
  14. if(IsAItem(playerid,SlotDItem[playerid][ItemSlotA[playerid][SlotReal]],0))
  15. {
  16. if(TipoItem[playerid] != 0)
  17. {
  18. itemnamochila(playerid,SlotDItem[playerid][ItemSlotA[playerid][SlotReal]]);
  19. }
  20. }
  21. }
  22. RemovePlayerAttachedObject(playerid, ItemSlotA[playerid][SlotReal]);
  23. ItemSlotP[playerid][ItemSlotA[playerid][SlotReal]] = -1;
  24. SlotDItem[playerid][ItemSlotA[playerid][SlotReal]] = -1;
  25. ObjectLoad[playerid][ItemSlotA[playerid][SlotReal]][Objindexid2] = 0;
  26. ItemSlotA[playerid][SlotReal] = -1;
  27. }
  28. }
  29.  
  30. //Sistema de guardar armas na mochila
  31. new Selected[MAX_PLAYERS][3];
  32.  
  33. new Text:avisoMochila;
  34.  
  35. ShowMochila(playerid, bag){
  36. new Str[45];
  37. format(Str, 45, "LD_SPAC:power");
  38. PlayerTextDrawSetString(playerid, moListBox1[playerid], Str);
  39. format(Str, 45, "LD_SPAC:power");
  40. PlayerTextDrawSetString(playerid, moListBox2[playerid], Str);
  41. format(Str, 45, "LD_SPAC:power");
  42. PlayerTextDrawSetString(playerid, moListBox3[playerid], Str);
  43. format(Str, 45, "LD_SPAC:power");
  44. PlayerTextDrawSetString(playerid, moListBox4[playerid], Str);
  45. switch(bag)
  46. {
  47. case 4:{ }
  48. case 3:
  49. {
  50. format(Str, 45, "LD_SPAC:Health");
  51. PlayerTextDrawSetString(playerid, moListBox4[playerid], Str);
  52. }
  53. case 2:
  54. {
  55. format(Str, 45, "LD_SPAC:Health");
  56. PlayerTextDrawSetString(playerid, moListBox3[playerid], Str);
  57. format(Str, 45, "LD_SPAC:Health");
  58. PlayerTextDrawSetString(playerid, moListBox4[playerid], Str);
  59. }
  60. default:
  61. {
  62. format(Str, 45, "LD_SPAC:Health");
  63. PlayerTextDrawSetString(playerid, moListBox2[playerid], Str);
  64. format(Str, 45, "LD_SPAC:Health");
  65. PlayerTextDrawSetString(playerid, moListBox3[playerid], Str);
  66. format(Str, 45, "LD_SPAC:Health");
  67. PlayerTextDrawSetString(playerid, moListBox4[playerid], Str);
  68. }
  69. }
  70. //PlayerTextDrawShow(playerid, moBox1[playerid]);
  71. PlayerTextDrawShow(playerid, moBox2[playerid]);
  72. PlayerTextDrawShow(playerid, moBox3[playerid]);
  73. PlayerTextDrawShow(playerid, moBox4[playerid]);
  74. PlayerTextDrawShow(playerid, moListBox1[playerid]);
  75. PlayerTextDrawShow(playerid, moListBox2[playerid]);
  76. PlayerTextDrawShow(playerid, moListBox3[playerid]);
  77. PlayerTextDrawShow(playerid, moListBox4[playerid]);
  78. PlayerTextDrawShow(playerid, moList1[playerid]);
  79. PlayerTextDrawShow(playerid, moList2[playerid]);
  80. PlayerTextDrawShow(playerid, moList3[playerid]);
  81. PlayerTextDrawShow(playerid, moList4[playerid]);
  82. for(new x=1; x <= 12; x++)
  83. {
  84. PlayerTextDrawSetPreviewModel(playerid, moPrev[playerid][x], getidxModelSlot(playerid, x));
  85. PlayerTextDrawShow(playerid, moPrev[playerid][x]);
  86. }
  87. PlayerTextDrawShow(playerid, moMsg[playerid]);
  88. PlayerTextDrawSetPreviewModel(playerid, moEquipPrev[playerid], 5699);
  89. PlayerTextDrawShow(playerid, moEquipPrev[playerid]);
  90. PlayerTextDrawShow(playerid, moArma[playerid]);
  91. PlayerTextDrawShow(playerid, moBalas[playerid]);
  92. PlayerTextDrawShow(playerid, moUse[playerid]);
  93. PlayerTextDrawShow(playerid, moUseBox[playerid]);
  94. PlayerTextDrawShow(playerid, moExit[playerid]);
  95. PlayerTextDrawShow(playerid, moInfo[playerid]);
  96. PlayerTextDrawShow(playerid, moInfoBox[playerid]);
  97. PlayerTextDrawShow(playerid, moHelp[playerid]);
  98. PlayerTextDrawShow(playerid, moCr[playerid]);
  99.  
  100. Selected[playerid][0] = 0;
  101. Selected[playerid][1] = 0;
  102. Selected[playerid][2] = 0;
  103.  
  104. setweaponNome(playerid, Selected[playerid][0], Selected[playerid][1]);
  105.  
  106. SelectTextDraw(playerid, 0xAAAAAAFF);
  107.  
  108. SetPVarInt(playerid, "vMochila", 1);
  109. }
  110.  
  111. //---------------------------------------------------
  112.  
  113. HideMochila(playerid){
  114.  
  115. // PlayerTextDrawHide(playerid, moBox1[playerid]);
  116. PlayerTextDrawHide(playerid, moBox2[playerid]);
  117. PlayerTextDrawHide(playerid, moBox3[playerid]);
  118. PlayerTextDrawHide(playerid, moBox4[playerid]);
  119. PlayerTextDrawHide(playerid, moListBox1[playerid]);
  120. PlayerTextDrawHide(playerid, moListBox2[playerid]);
  121. PlayerTextDrawHide(playerid, moListBox3[playerid]);
  122. PlayerTextDrawHide(playerid, moListBox4[playerid]);
  123. PlayerTextDrawHide(playerid, moList1[playerid]);
  124. PlayerTextDrawHide(playerid, moList2[playerid]);
  125. PlayerTextDrawHide(playerid, moList3[playerid]);
  126. PlayerTextDrawHide(playerid, moList4[playerid]);
  127. for(new x=1; x <= 12; x++)
  128. {
  129. PlayerTextDrawHide(playerid, moPrev[playerid][x]);
  130. }
  131. PlayerTextDrawHide(playerid, moMsg[playerid]);
  132. PlayerTextDrawHide(playerid, moEquipPrev[playerid]);
  133. PlayerTextDrawHide(playerid, moArma[playerid]);
  134. PlayerTextDrawHide(playerid, moBalas[playerid]);
  135. PlayerTextDrawHide(playerid, moUse[playerid]);
  136. PlayerTextDrawHide(playerid, moUseBox[playerid]);
  137. PlayerTextDrawHide(playerid, moExit[playerid]);
  138. PlayerTextDrawHide(playerid, moInfo[playerid]);
  139. PlayerTextDrawHide(playerid, moInfoBox[playerid]);
  140. PlayerTextDrawHide(playerid, moHelp[playerid]);
  141. PlayerTextDrawHide(playerid, moCr[playerid]);
  142.  
  143. CancelSelectTextDraw(playerid);
  144.  
  145. SetPVarInt(playerid, "vMochila", 0);
  146.  
  147. }
  148.  
  149. //------------------------------------------------------
  150.  
  151. stock atualizarMochila(playerid,inv)
  152. {
  153. new Str[45],y;
  154. format(Str, 45, "I");
  155. PlayerTextDrawSetString(playerid, moList1[playerid], Str);
  156. format(Str, 45, "II");
  157. PlayerTextDrawSetString(playerid, moList2[playerid], Str);
  158. format(Str, 45, "III");
  159. PlayerTextDrawSetString(playerid, moList3[playerid], Str);
  160. format(Str, 45, "IV");
  161. PlayerTextDrawSetString(playerid, moList4[playerid], Str);
  162. switch(inv)
  163. {
  164. case 1:
  165. {
  166. format(Str, 45, "~y~I");
  167. PlayerTextDrawSetString(playerid, moList1[playerid], Str);
  168. for(new x=1; x <= 12; x++)
  169. {
  170. PlayerTextDrawSetPreviewModel(playerid, moPrev[playerid][x], getidxModelSlot(playerid, x));
  171. PlayerTextDrawShow(playerid, moPrev[playerid][x]);
  172. }
  173. Inventario[playerid] = 1;
  174. return 1;
  175. }
  176. case 2:
  177. {
  178. format(Str, 45, "~y~II");
  179. PlayerTextDrawSetString(playerid, moList2[playerid], Str);
  180. for(new x=13; x <= 24; x++)
  181. {
  182. y = x-12;
  183. PlayerTextDrawSetPreviewModel(playerid, moPrev[playerid][y], getidxModelSlot(playerid, x));
  184. PlayerTextDrawShow(playerid, moPrev[playerid][y]);
  185. }
  186. Inventario[playerid] = 2;
  187. return 1;
  188. }
  189. case 3:
  190. {
  191. format(Str, 45, "~y~III");
  192. PlayerTextDrawSetString(playerid, moList3[playerid], Str);
  193. for(new x=25; x <= 36; x++)
  194. {
  195. y = x-24;
  196. PlayerTextDrawSetPreviewModel(playerid, moPrev[playerid][y], getidxModelSlot(playerid, x));
  197. PlayerTextDrawShow(playerid, moPrev[playerid][y]);
  198.  
  199. }
  200. Inventario[playerid] = 3;
  201. return 1;
  202. }
  203. case 4:
  204. {
  205. format(Str, 45, "~y~IV");
  206. PlayerTextDrawSetString(playerid, moList4[playerid], Str);
  207. for(new x=37; x < MAX_ITEMS; x++)
  208. {
  209. y = x-36;
  210. PlayerTextDrawSetPreviewModel(playerid, moPrev[playerid][y], getidxModelSlot(playerid, x));
  211. PlayerTextDrawShow(playerid, moPrev[playerid][y]);
  212.  
  213. }
  214. Inventario[playerid] = 4;
  215. return 1;
  216. }
  217. }
  218. return 0;
  219. }
  220.  
  221.  
  222.  
  223.  
  224. if(clickedid == Text:INVALID_TEXT_DRAW){
  225.  
  226. if(GetPVarInt(playerid, "vMochila")){
  227.  
  228. HideMochila(playerid);
  229. }
  230. if(GetPVarInt(playerid, "vportamala") && !GetPVarInt(playerid, "guardando")){
  231.  
  232. HidePortaMala(playerid);
  233. }
  234. }
  235. if(GetPVarInt(playerid, "skinc_active") == 0) return 0;
  236.  
  237. // Handle: They cancelled (with ESC)
  238. if(clickedid == Text:INVALID_TEXT_DRAW) {
  239. DestroySelectionMenu(playerid);
  240. SetPVarInt(playerid, "skinc_active", 0);
  241. PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
  242. return 1;
  243. }
  244. return 1;
  245. }
  246.  
  247. //----------------------------------------------------------
  248.  
  249. dialogGuardar(playerid){
  250.  
  251. ShowPlayerDialog(playerid, 305, DIALOG_STYLE_MSGBOX, " ",
  252. "{00CCFF} Você quer guardar uma arma neste slot?\n\
  253. {00CCFF} OBS: Você precisa ter uma arma com você!",
  254. "Sim", "Voltar");
  255.  
  256. SetPVarInt(playerid, "guardando", 1);
  257.  
  258. CancelSelectTextDraw(playerid);
  259. }
  260.  
  261. //-------------------------------------------------------
  262.  
  263. dialogGuardarPM(playerid){
  264.  
  265. ShowPlayerDialog(playerid, 307, DIALOG_STYLE_MSGBOX, " ",
  266. "{00CCFF} Você quer guardar uma arma neste slot?\n\
  267. {00CCFF} OBS: Você precisa ter uma arma com você!",
  268. "Sim", "Voltar");
  269.  
  270. SetPVarInt(playerid, "guardando", 1);
  271.  
  272. CancelSelectTextDraw(playerid);
  273. }
  274.  
  275. //-------------------------------------------------------
  276.  
  277. dialogHelp(playerid){
  278.  
  279. MEGAString[0]=EOS;
  280.  
  281. strcat(MEGAString, "{FFFFFF} Sistema de Inventário onde você pode\n");
  282. strcat(MEGAString, "{FFFFFF} guardar, pegar ou descartar suas armas ou itens\n\n");
  283.  
  284. strcat(MEGAString, "{FFFFFF}x{A0A0A0} Para usar/guardar uma arma/item, selecione ela e vá em ''usar'' e coloque usar/guardar\n");
  285. strcat(MEGAString, "{FFFFFF}x{A0A0A0} Para descartar uma arma, selecione ela e vá em ''usar'' e coloque dropar\n");
  286.  
  287. ShowPlayerDialog(playerid, 8724, DIALOG_STYLE_MSGBOX, "Ajuda Inventario", MEGAString, "Informado","");
  288. }
  289.  
  290. //------------------------------------------------------
  291.  
  292. countWeapons(playerid){
  293.  
  294. new count, weap, ammo;
  295. for(new x = 1; x != 13; x++){
  296.  
  297. GetPlayerWeaponData(playerid, x, weap, ammo);
  298.  
  299. if(weap && ammo){
  300.  
  301. count++;
  302. }
  303. }
  304. return count;
  305. }
  306.  
  307. //------------------------------------------------------
  308.  
  309. dialogArmas(playerid){
  310.  
  311. if(!countWeapons(playerid))
  312. return SendClientMessage(playerid, COLOR_YELLOW, "*Você não tem uma arma com você."), CancelSelectTextDraw(playerid),SelectTextDraw(playerid, 0xAAAAAAFF);
  313.  
  314. new Str[95],
  315. weap,
  316. ammo;
  317.  
  318. MEGAString[0] = EOS;
  319.  
  320. for(new x = 1; x != 13; x++){
  321.  
  322. GetPlayerWeaponData(playerid, x, weap, ammo);
  323.  
  324. if(weap && ammo){
  325.  
  326. format(Str, 95, "{FFFFFF}Arma: {A0A0A0}%s {FFFFFF}Balas: {A0A0A0}%03d\n", GunNames[weap], ammo);
  327. strcat(MEGAString, Str);
  328. }else{
  329.  
  330. strcat(MEGAString, "{FFFFFF}Arma: {A0A0A0}-------- {FFFFFF}Balas: {A0A0A0}---\n");
  331. }
  332. }
  333. ShowPlayerDialog(playerid, 306, DIALOG_STYLE_LIST, "Escolha a arma para guardar", MEGAString, "Guardar", "Sair");
  334.  
  335. return 1;
  336. }
  337.  
  338. dialogArmasPM(playerid){
  339.  
  340. if(!countWeapons(playerid))
  341. return SendClientMessage(playerid, COLOR_YELLOW, "*Você não tem uma arma com você."), SelectTextDraw(playerid, 0xAAAAAAFF);
  342.  
  343. new Str[95],
  344. weap,
  345. ammo;
  346.  
  347. MEGAString[0] = EOS;
  348.  
  349. for(new x = 1; x != 13; x++){
  350.  
  351. GetPlayerWeaponData(playerid, x, weap, ammo);
  352.  
  353. if(weap && ammo){
  354.  
  355. format(Str, 95, "{FFFFFF}Arma: {A0A0A0}%s {FFFFFF}Balas: {A0A0A0}%03d\n", GunNames[weap], ammo);
  356. strcat(MEGAString, Str);
  357. }else{
  358.  
  359. strcat(MEGAString, "{FFFFFF}Arma: {A0A0A0}-------- {FFFFFF}Balas: {A0A0A0}---\n");
  360. }
  361. }
  362. ShowPlayerDialog(playerid, 308, DIALOG_STYLE_LIST, "Escolha a arma para guardar", MEGAString, "Guardar", "Sair");
  363.  
  364. return 1;
  365. }
  366. stock RemoveVendingMachines(playerid)
  367. {
  368. // Remove 24/7 machines
  369. RemoveBuildingForPlayer(playerid, 1776, -33.8750, -186.7656, 1003.6328, 0.25);
  370. RemoveBuildingForPlayer(playerid, 1775, -32.4453, -186.6953, 1003.6328, 0.25);
  371.  
  372. // Remove all other machines
  373. for(new i = 0; i < 43; i++)
  374. {
  375. RemoveBuildingForPlayer(playerid, 955, VMachines[i][0], VMachines[i][1], VMachines[i][2], 0.50);
  376. RemoveBuildingForPlayer(playerid, 956, VMachines[i][0], VMachines[i][1], VMachines[i][2], 0.50);
  377. }
  378. return 1;
  379. }
  380.  
  381.  
  382.  
  383. public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid) {
  384. if(GetPVarInt(playerid, "vMochila")){
  385.  
  386. for(new x = 1; x <= 12; x++){
  387.  
  388. if(playertextid == moPrev[playerid][x]) {
  389. if(Inventario[playerid] == 2) x = x+12;
  390. if(Inventario[playerid] == 3) x = x+24;
  391. if(Inventario[playerid] == 4) x = x+36;
  392. if(x != MAX_ITEMS) {
  393. if(ArmasGuardadas[playerid][x] < 1 && ItemID[playerid][x] == 0){
  394. //dialogGuardar(playerid);
  395. Selected[playerid][0] = 0;
  396. Selected[playerid][1] = 0;
  397. Selected[playerid][2] = x;
  398.  
  399. setweaponNome(playerid, Selected[playerid][0], Selected[playerid][1]);
  400. ///SendClientMessage(playerid, COLOR_LIGHTRED, "* Não tem uma arma nesse slot!");
  401. PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
  402. return 1;
  403. }
  404. /*if(ItemID[playerid][x] == 1252 && PlayerInfo[playerid][pExplosivos] < 1)
  405. {
  406. ItemID[playerid][x] = 0;
  407. }*/
  408. if(ItemID[playerid][x] > 0) {
  409.  
  410. Selected[playerid][0] = ItemID[playerid][x];
  411. if(IsAItem(playerid,Selected[playerid][0],0))
  412. Selected[playerid][1] = 1;
  413. else
  414. Selected[playerid][1] = 0;
  415. /*if(ItemID[playerid][x] == 1252)
  416. {
  417. Selected[playerid][1] = PlayerInfo[playerid][pExplosivos];
  418. }*/
  419. Selected[playerid][2] = x;
  420.  
  421. RotateTipItem(playerid,x);
  422.  
  423. setweaponNome(playerid, Selected[playerid][0], Selected[playerid][1]);
  424.  
  425. PlayerPlaySound(playerid, 1083, 0.0, 0.0, 0.0);
  426. return 1;
  427. }
  428. else {
  429. PlayerTextDrawSetPreviewRot(playerid, moEquipPrev[playerid], 180.000000, 160.000000, 360.000000, 2.099999);
  430. PlayerTextDrawSetPreviewModel(playerid, moEquipPrev[playerid], getidxModelSlot(playerid, x));
  431. PlayerTextDrawShow(playerid, moEquipPrev[playerid]);
  432. Selected[playerid][0] = ArmasGuardadas[playerid][x];
  433. if(IsAItem(playerid,Selected[playerid][0],0)) {
  434. Selected[playerid][0] = ArmasGuardadas[playerid][x];
  435. Selected[playerid][1] = BalasGuardadas[playerid][x];
  436. Selected[playerid][2] = x;
  437. }
  438.  
  439. setweaponNome(playerid, Selected[playerid][0], Selected[playerid][1]);
  440.  
  441. PlayerPlaySound(playerid, 1083, 0.0, 0.0, 0.0);
  442. return 1;
  443. }
  444. }
  445. }
  446. }
  447.  
  448. if(playertextid == moInfo[playerid]){
  449.  
  450. //nova info do item em breve
  451. }
  452.  
  453. else if(playertextid == moUse[playerid]) {
  454. ShowPlayerDialog(playerid, Dialog_Mouse, DIALOG_STYLE_LIST, \
  455. "{FFFFFF}Opçoes do Item",
  456. "Usar/Guardar\n\
  457. Dropar",
  458. "Selecionar", "Cancelar");
  459.  
  460. }
  461. else if(playertextid == moHelp[playerid]){
  462.  
  463. dialogHelp(playerid);
  464. }
  465. else if(playertextid == moListBox1[playerid]){
  466. if(PlayerInfo[playerid][pMochila] >= 1) {
  467. PlayerPlaySound(playerid, 1150, 0.0, 0.0, 0.0);
  468. atualizarMochila(playerid,1);
  469. }
  470. }
  471. else if(playertextid == moListBox2[playerid]){
  472. if(PlayerInfo[playerid][pMochila] > 1) {
  473. PlayerPlaySound(playerid, 1150, 0.0, 0.0, 0.0);
  474. atualizarMochila(playerid,2);
  475. }
  476. else {
  477. SendClientMessage(playerid, COLOR_GRAD4, "Sua Mochila deve ser Média para usar Este Inventório");
  478. }
  479. }
  480. else if(playertextid == moListBox3[playerid]){
  481. if(PlayerInfo[playerid][pMochila] > 2) {
  482. PlayerPlaySound(playerid, 1150, 0.0, 0.0, 0.0);
  483. atualizarMochila(playerid,3);
  484. }
  485. else
  486. SendClientMessage(playerid, COLOR_GRAD4, "Sua Mochila deve ser Grande para usar Este Inventório");
  487. }
  488. else if(playertextid == moListBox4[playerid]){
  489. if(PlayerInfo[playerid][pMochila] > 3) {
  490. PlayerPlaySound(playerid, 1150, 0.0, 0.0, 0.0);
  491. atualizarMochila(playerid,4);
  492. }
  493. else
  494. SendClientMessage(playerid, COLOR_GRAD4, "Sua Mochila deve ser Gigante para usar Este Inventório");
  495. }
  496.  
  497. else if(playertextid == moExit[playerid]){
  498. HideMochila(playerid);
  499. }
  500. }
  501. if(GetPVarInt(playerid, "vportamala")){
  502.  
  503. for(new x = 1; x != MAX_TRUNK_SLOTS; x++){
  504.  
  505. if(playertextid == pmPrev[playerid][x]){
  506.  
  507. if(vehTrunk[VeiculoPortaM[playerid]][x] < 1) {
  508. dialogGuardarPM(playerid);
  509. Selected[playerid][2] = x;
  510. ///SendClientMessage(playerid, COLOR_LIGHTRED, "* Não tem uma arma nesse slot!");
  511. PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
  512. return 1;
  513. }
  514.  
  515. PlayerTextDrawSetPreviewModel(playerid, pmEquipPrev[playerid], getidxPMModelSlot(VeiculoPortaM[playerid], x));
  516. PlayerTextDrawShow(playerid, pmEquipPrev[playerid]);
  517.  
  518. Selected[playerid][0] = vehTrunk[VeiculoPortaM[playerid]][x];
  519. Selected[playerid][1] = vehTrunkAmmo[VeiculoPortaM[playerid]][x];
  520. Selected[playerid][2] = x;
  521.  
  522. setweaponpmNome(playerid, Selected[playerid][0], Selected[playerid][1]);
  523.  
  524. PlayerPlaySound(playerid, 1083, 0.0, 0.0, 0.0);
  525. return 1;
  526. }
  527. }
  528. if(playertextid == pmPrev[playerid][8]) {
  529. PlayerTextDrawSetPreviewModel(playerid, pmEquipPrev[playerid], 1242);
  530. PlayerTextDrawShow(playerid, pmEquipPrev[playerid]);
  531.  
  532. Selected[playerid][0] = VeiculoPortaM[playerid];
  533. setItenpmNome(playerid, 8, Selected[playerid][0]);
  534. Selected[playerid][2] = 8;
  535. PlayerPlaySound(playerid, 1083, 0.0, 0.0, 0.0);
  536. }
  537. if(playertextid == pmPrev[playerid][9])
  538. {
  539. PlayerTextDrawSetPreviewModel(playerid, pmEquipPrev[playerid], 1279);
  540. PlayerTextDrawShow(playerid, pmEquipPrev[playerid]);
  541.  
  542. Selected[playerid][0] = VeiculoPortaM[playerid];
  543. setItenpmNome(playerid, 9, Selected[playerid][0]);
  544. Selected[playerid][2] = 9;
  545. PlayerPlaySound(playerid, 1083, 0.0, 0.0, 0.0);
  546. }
  547. if(playertextid == pmPrev[playerid][10])
  548. {
  549. PlayerTextDrawSetPreviewModel(playerid, pmEquipPrev[playerid], 1579);
  550. PlayerTextDrawShow(playerid, pmEquipPrev[playerid]);
  551.  
  552. Selected[playerid][0] = VeiculoPortaM[playerid];
  553. setItenpmNome(playerid, 10, Selected[playerid][0]);
  554. Selected[playerid][2] = 10;
  555. PlayerPlaySound(playerid, 1083, 0.0, 0.0, 0.0);
  556. }
  557. if(playertextid == pmDescart[playerid])
  558. {
  559. new thestring[128];
  560. new result = VeiculoPortaM[playerid];
  561. if(Selected[playerid][2] == 8)
  562. {
  563. if(GetPlayerArmourEx(playerid) > 0)
  564. {
  565. if(vehTrunkArmour[result] >= 500.000) return SendClientMessage(playerid, COLOR_GRAD1, " Seu Porta-malas só suporta 5 Coletes!");
  566. vehTrunkArmour[result] += GetPlayerArmourEx(playerid);
  567. SetPlayerArmour(playerid, 0);
  568. format(thestring, sizeof(thestring), "%s tirou o colete e colocou no porta-malas do carro.", NomePlayer(playerid));
  569. SendClientMessageInRange(30.0, playerid, thestring, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  570. setItenpmNome(playerid, 8, result);
  571. return 1;
  572. }
  573. else
  574. return SendClientMessage(playerid, COLOR_GRAD1, " Você não tem nenhum colete ");
  575. }
  576. else if(Selected[playerid][2] == 9)
  577. {
  578. if(PlayerInfo[playerid][pDrogas] != 0)
  579. {
  580. vehTrunkDroga[result] += PlayerInfo[playerid][pDrogas];
  581. PlayerInfo[playerid][pDrogas] = 0;
  582. format(thestring, sizeof(thestring), "%s colocou todas sua Maconha no porta-malas do carro.", NomePlayer(playerid));
  583. SendClientMessageInRange(30.0, playerid, thestring, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  584. setItenpmNome(playerid, 9, result);
  585. return 1;
  586. }
  587. else
  588. return SendClientMessage(playerid, COLOR_GRAD1, " Você não tem nenhuma droga para por no porta-malas.");
  589.  
  590. }
  591. else if(Selected[playerid][2] == 10)
  592. {
  593. if(PlayerInfo[playerid][pMats] != 0)
  594. {
  595. vehTrunkMaterial[result] += PlayerInfo[playerid][pMats];
  596. PlayerInfo[playerid][pMats] = 0;
  597.  
  598. format(thestring, sizeof(thestring), "%s colocou todos seus materiais no porta-malas do carro.", NomePlayer(playerid));
  599. SendClientMessageInRange(30.0, playerid, thestring, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  600. setItenpmNome(playerid, 10, result);
  601. return 1;
  602. }
  603. else
  604. return SendClientMessage(playerid, COLOR_GRAD1, " Você não tem nenhum material para por no porta-malas.");
  605. }
  606. }
  607. else if(playertextid == pmEquip[playerid])
  608. {
  609. new thestring[128];
  610. new result = VeiculoPortaM[playerid];
  611. if(Selected[playerid][2] == 8)
  612. {
  613. if(vehTrunkArmour[result] >= 100.000)
  614. {
  615. vehTrunkArmour[result] -= 100.000;
  616. SetPlayerArmour(playerid, 100);
  617. format(thestring, sizeof(thestring), "%s Pegou um colete que estava no porta-malas do carro.", NomePlayer(playerid));
  618. SendClientMessageInRange(30.0, playerid, thestring, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  619. setItenpmNome(playerid, 8, result);
  620. return 1;
  621. }
  622. else
  623. return SendClientMessage(playerid, COLOR_GRAD1, " Seu Porta-malas está sem Colete suficiente para lhe dar.");
  624. }
  625. else if(Selected[playerid][2] == 9)
  626. {
  627. if(vehTrunkDroga[result] > 0)
  628. {
  629. PlayerInfo[playerid][pDrogas] += vehTrunkDroga[result];
  630. vehTrunkDroga[result] = 0;
  631. format(thestring, sizeof(thestring), "%s pegou toda sua Maconha no porta-malas do carro.", NomePlayer(playerid));
  632. SendClientMessageInRange(30.0, playerid, thestring, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  633. setItenpmNome(playerid, 9, result);
  634. return 1;
  635. }
  636. else
  637. return SendClientMessage(playerid, COLOR_GRAD1, " Você não tem nenhuma droga para pegar no porta-malas.");
  638. }
  639. else if(Selected[playerid][2] == 10) {
  640. if(vehTrunkMaterial[result] > 0) {
  641.  
  642. PlayerInfo[playerid][pMats] += vehTrunkMaterial[result];
  643. vehTrunkMaterial[result] = 0;
  644.  
  645. format(thestring, sizeof(thestring), "%s pegou todo seus material no porta-malas do carro.", NomePlayer(playerid));
  646. SendClientMessageInRange(30.0, playerid, thestring, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  647. setItenpmNome(playerid, 10, result);
  648. return 1;
  649. }
  650. else
  651. return SendClientMessage(playerid, COLOR_GRAD1, " Você não tem nenhum material para pegar no porta-malas.");
  652. }
  653. else if(Selected[playerid][0])
  654. {
  655. new string[85];
  656.  
  657. GivePlayerWeapon(playerid, Selected[playerid][0], Selected[playerid][1]);
  658.  
  659. format(string, sizeof string, "Você pegou uma arma %s com %d balas!",NomeArma(Selected[playerid][0]),vehTrunkAmmo[VeiculoPortaM[playerid]][Selected[playerid][2]]);
  660. SendClientMessage(playerid, COLOR_R, string);
  661. Sound(playerid, 36401, 30.0);
  662. format(string, sizeof(string), "* %s pegou uma arma do Porta Malas", NomeArma(Selected[playerid][0]));
  663. SendClientMessageInRange(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  664.  
  665. vehTrunk[VeiculoPortaM[playerid]][Selected[playerid][2]] = 0;
  666. vehTrunkAmmo[VeiculoPortaM[playerid]][Selected[playerid][2]] = 0;
  667.  
  668. atualizarPortaMala(playerid);
  669.  
  670. Selected[playerid][0] = 0;
  671. Selected[playerid][1] = 0;
  672. Selected[playerid][2] = 0;
  673.  
  674. setweaponpmNome(playerid, 0, 0);
  675. }
  676. else
  677. {
  678. SendClientMessage(playerid, COLOR_LIGHTRED, "* Você ainda não selecionou uma arma!");
  679. PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
  680. }
  681. }
  682.  
  683. else if(playertextid == pmHelp[playerid]){
  684.  
  685. dialogHelp(playerid);
  686. }
  687.  
  688. else if(playertextid == pmExit[playerid]){
  689.  
  690. HidePortaMala(playerid);
  691. }
  692. }
  693.  
  694.  
  695. CMD:mochila(playerid, params[])
  696. {
  697. if (!gPlayerLogged[playerid])
  698. return SendClientMessage(playerid, COLOR_GRAD1, " Você não está logado !");
  699.  
  700. if(PlayerInfo[playerid][pJailed] == 9) {
  701. SendClientMessage(playerid,COLOR_GRAD1," Você não pode usar este comando nas Celas da Administração!");
  702. return true;
  703. }
  704.  
  705. if(!GetPVarInt(playerid, "vMochila")){
  706.  
  707. new string[128];
  708. format(string, sizeof(string), "* %s abriu sua mochila!", NomePlayer(playerid));
  709. SendClientMessageInRange(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  710. ShowMochila(playerid, PlayerInfo[playerid][pMochila]);
  711. Sound(playerid, 1039, 30.0);
  712. new Str[45];
  713. format(Str, 45, "~y~I");
  714. PlayerTextDrawSetString(playerid, moList1[playerid], Str);
  715. format(Str, 45, "II");
  716. PlayerTextDrawSetString(playerid, moList2[playerid], Str);
  717. format(Str, 45, "III");
  718. PlayerTextDrawSetString(playerid, moList3[playerid], Str);
  719. format(Str, 45, "IV");
  720. PlayerTextDrawSetString(playerid, moList4[playerid], Str);
  721. Inventario[playerid] = 1;
  722. }
  723. else
  724. HideMochila(playerid);
  725. return true;
  726. }
  727.  
  728.  
  729. if(dialogid == 306){
  730.  
  731. SelectTextDraw(playerid, 0xAAAAAAFF);
  732. if(response){
  733.  
  734. new weap, ammo;
  735.  
  736. GetPlayerWeaponData(playerid, listitem + 1, weap, ammo);
  737.  
  738. if(ammo < 1)
  739. return CancelSelectTextDraw(playerid), SendClientMessage(playerid, COLOR_YELLOW, "*Esta arma é inválida!"), dialogArmas(playerid);
  740.  
  741. ArmasGuardadas[playerid][Selected[playerid][2]] = weap;
  742. BalasGuardadas[playerid][Selected[playerid][2]] = ammo;
  743. format(string, sizeof string, "Você guardou uma arma %s com %d balas no slot: %d. Para pegar use: /mochila", NomeItemID(ArmasGuardadas[playerid][Selected[playerid][2]]),BalasGuardadas[playerid][Selected[playerid][2]], Selected[playerid][2]);
  744. SendClientMessage(playerid, COLOR_R, string);
  745. RemovePlayerWeapon(playerid, weap);
  746. format(string, sizeof(string), "* %s guardou um(a) %s em sua mochila", NomePlayer(playerid), NomeItemID(ArmasGuardadas[playerid][Selected[playerid][2]]));
  747. SendClientMessageInRange(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  748.  
  749. SetPVarInt(playerid, "guardando", 0);
  750.  
  751. HideMochila(playerid);
  752.  
  753. }
  754. else{
  755.  
  756. SetPVarInt(playerid, "guardando", 0);
  757. }
  758. }
  759.  
  760. if(dialogid == 305){
  761.  
  762. if(response){
  763.  
  764. dialogArmas(playerid);
  765. }else{
  766.  
  767. SetPVarInt(playerid, "guardando", 0);
  768. SelectTextDraw(playerid, 0xAAAAAAFF);
  769. }
  770. }
  771.  
  772. if(dialogid == 307){
  773.  
  774. if(response){
  775.  
  776. dialogArmasPM(playerid);
  777. }else{
  778.  
  779. SetPVarInt(playerid, "guardando", 0);
  780. SelectTextDraw(playerid, 0xAAAAAAFF);
  781. }
  782. }
  783. if(dialogid == 308){
  784.  
  785. SelectTextDraw(playerid, 0xAAAAAAFF);
  786. if(response){
  787.  
  788. new weap, ammo;
  789.  
  790. GetPlayerWeaponData(playerid, listitem + 1, weap, ammo);
  791.  
  792. if(ammo < 1)
  793. return CancelSelectTextDraw(playerid), SendClientMessage(playerid, COLOR_YELLOW, "*Esta arma é inválida!"), dialogArmasPM(playerid);
  794.  
  795. vehTrunk[VeiculoPortaM[playerid]][Selected[playerid][2]] = weap;
  796. vehTrunkAmmo[VeiculoPortaM[playerid]][Selected[playerid][2]] = ammo;
  797. format(string, sizeof string, "Você guardou uma arma %s com %d balas no slot: %d. Para pegar vá ao Porta-Malas.", NomeArma(weap),vehTrunkAmmo[VeiculoPortaM[playerid]][Selected[playerid][2]], Selected[playerid][2]);
  798. SendClientMessage(playerid, COLOR_R, string);
  799. RemovePlayerWeapon(playerid, weap);
  800. format(string, sizeof(string), "* %s guardou um(a) %s no Porta Malas de Seu Veiculo.", NomePlayer(playerid), NomeArma(weap));
  801. SendClientMessageInRange(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  802.  
  803. SetPVarInt(playerid, "guardando", 0);
  804.  
  805. atualizarPortaMala(playerid);
  806.  
  807. }
  808. else{
  809.  
  810. SetPVarInt(playerid, "guardando", 0);
  811. }
  812. }
  813.  
  814.  
  815. {
  816. equiparitem(playerid,Selected[playerid][0],Selected[playerid][2]);
  817. if(TipoItem[playerid] == 0) return 1;
  818. if(SlotCheio[playerid] == 1) { SlotCheio[playerid] = 0; return 1; }
  819. setweaponNome(playerid, 0, 0);
  820. HideMochila(playerid);
  821. Selected[playerid][0] = 0;
  822. Selected[playerid][1] = 0;
  823. Selected[playerid][2] = 0;
  824. SendClientMessage(playerid, 0xFFFFFFFF, "Você Colocou Seu Item no Corpo!");
  825. EditAttachedObject(playerid, ultimoSlotEQ[playerid]);
  826. return 1;
  827. }
  828. }
  829. else if(IsAArma(playerid,Selected[playerid][2]))
  830. {
  831. GivePlayerWeapon(playerid, Selected[playerid][0], Selected[playerid][1]);
  832.  
  833. format(string, sizeof string, "Você pegou uma arma %s com %d balas!",NomeItem(playerid,TipoItem[playerid]),BalasGuardadas[playerid][Selected[playerid][2]]);
  834. SendClientMessage(playerid, COLOR_R, string);
  835. Sound(playerid, 36401, 30.0);
  836. format(string, sizeof(string), "* %s pegou uma arma da mochila", NomePlayer(playerid));
  837. SendClientMessageInRange(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  838.  
  839. ArmasGuardadas[playerid][Selected[playerid][2]] = 0;
  840. BalasGuardadas[playerid][Selected[playerid][2]] = 0;
  841.  
  842. Selected[playerid][0] = 0;
  843. Selected[playerid][1] = 0;
  844. Selected[playerid][2] = 0;
  845.  
  846. setweaponNome(playerid, 0, 0);
  847.  
  848. atualizarMochila(playerid,Inventario[playerid]);
  849. }
  850. else
  851. {
  852. SendClientMessage(playerid, 0xFF0000FF, "•• {FFFFFF}ITEM DESCONHECIDO retirado do inventario, Aguarde ele ser liberado em uma LOJA de Acessórios.");
  853. ItemID[playerid][Selected[playerid][2]] = 0;
  854. Selected[playerid][0] = 0;
  855. Selected[playerid][1] = 0;
  856. Selected[playerid][2] = 0;
  857. setweaponNome(playerid, 0, 0);
  858. atualizarMochila(playerid,Inventario[playerid]);
  859. return 1;
  860. }
  861. }
  862. else{
  863. dialogGuardar(playerid);
  864. //SendClientMessage(playerid, COLOR_LIGHTRED, "* Você ainda não selecionou uma arma!");
  865. PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
  866. }
  867. }
  868. else if(listitem == 1) //descartar
  869. {
  870. /*if(PlayerInfo[playerid][ComExplosivo] || ItemID[playerid][Selected[playerid][2]] == 1252)
  871. {
  872. descartarBomba(playerid,1252);
  873. //ForT:guardarexplosivo(playerid);
  874. Selected[playerid][0] = 0;
  875. Selected[playerid][1] = 0;
  876. Selected[playerid][2] = 0;
  877.  
  878. setweaponNome(playerid, 1252, PlayerInfo[playerid][pExplosivos]);
  879. return 1;
  880. }*/
  881. if(Selected[playerid][0] > 47)
  882. {
  883. descartarItem(playerid,Selected[playerid][2]);
  884. PlayerTextDrawSetPreviewModel(playerid, moPrev[playerid][Selected[playerid][2]], getidxModelSlot(playerid, 0));
  885. PlayerTextDrawShow(playerid, moPrev[playerid][Selected[playerid][2]]);
  886. atualizarMochila(playerid,Inventario[playerid]);
  887.  
  888. Selected[playerid][0] = 0;
  889. Selected[playerid][1] = 0;
  890. Selected[playerid][2] = 0;
  891.  
  892. setweaponNome(playerid, 0, 0);
  893. return 1;
  894. }
  895. if(Selected[playerid][0]){
  896.  
  897. //if(TempDropArmas[playerid] < 30) return SendClientMessage(playerid, COLOR_LIGHTRED, "* Você só pode dropar armas após ficar um bom tempo Online!");
  898. descartarArma(playerid, Selected[playerid][2]);
  899. PlayerTextDrawSetPreviewModel(playerid, moPrev[playerid][Selected[playerid][2]], getidxModelSlot(playerid, 0));
  900. PlayerTextDrawShow(playerid, moPrev[playerid][Selected[playerid][2]]);
  901. atualizarMochila(playerid,Inventario[playerid]);
  902.  
  903. Selected[playerid][0] = 0;
  904. Selected[playerid][1] = 0;
  905. Selected[playerid][2] = 0;
  906.  
  907. setweaponNome(playerid, 0, 0);
  908. }
  909. else{
  910. SendClientMessage(playerid, COLOR_LIGHTRED, "* Você ainda não selecionou um Item!");
  911. PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
  912. }
  913. }
  914. }
  915. else
  916. {
  917. HideMochila(playerid);
  918. }
  919. return 1;
  920. }
  921.  
  922. BPS:: hideAviso(playerid)
  923. {
  924. TextDrawHideForPlayer(playerid, avisoMochila);
  925. if( CarregandoI[playerid] < 1) { carregarObjetos(playerid); CarregandoI[playerid]++; }
  926. }
  927.  
  928.  
  929. BPS::itemnamochila(playerid,itemid)
  930. {
  931. new x;
  932. for(x=1; x < MAX_ITEMS; x++)
  933. {
  934. if(ArmasGuardadas[playerid][x] <= 0)
  935. {
  936. if(ItemID[playerid][x] <= 0)
  937. {
  938. if(x >= 13 && PlayerInfo[playerid][pMochila] < 2)
  939. {
  940. InvCheio[playerid] = 1;
  941. x = MAX_ITEMS-1;
  942. SendClientMessage(playerid, COLOR_GRAD4, "Seu Inventário está cheio.Não pode receber o item.");
  943. }
  944. else if(x >= 25 && PlayerInfo[playerid][pMochila] < 3)
  945. {
  946. InvCheio[playerid] = 1;
  947. x = MAX_ITEMS-1;
  948. SendClientMessage(playerid, COLOR_GRAD4, "Seu Inventário está cheio.Não pode receber o item.");
  949. }
  950. else if(x >= 37 && PlayerInfo[playerid][pMochila] < 4)
  951. {
  952. InvCheio[playerid] = 1;
  953. x = MAX_ITEMS-1;
  954. SendClientMessage(playerid, COLOR_GRAD4, "Seu Inventário está cheio.Não pode receber o item.");
  955. }
  956. else
  957. {
  958. ItemID[playerid][x] = itemid;
  959. break;
  960. }
  961. }
  962. }
  963. if(x == MAX_ITEMS-1 && InvCheio[playerid] == 0)
  964. {
  965. InvCheio[playerid] = 1;
  966. SendClientMessage(playerid, COLOR_GRAD4, "Seu Inventário está cheio.Não pode receber o item.");
  967. }
  968. }
  969. }
  970.  
  971.  
  972. public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid) {
  973. if(GetPVarInt(playerid, "vMochila")){
  974.  
  975. for(new x = 1; x <= 12; x++){
  976.  
  977. if(playertextid == moPrev[playerid][x]) {
  978. if(Inventario[playerid] == 2) x = x+12;
  979. if(Inventario[playerid] == 3) x = x+24;
  980. if(Inventario[playerid] == 4) x = x+36;
  981. if(x != MAX_ITEMS) {
  982. if(ArmasGuardadas[playerid][x] < 1 && ItemID[playerid][x] == 0){
  983. //dialogGuardar(playerid);
  984. Selected[playerid][0] = 0;
  985. Selected[playerid][1] = 0;
  986. Selected[playerid][2] = x;
  987.  
  988. setweaponNome(playerid, Selected[playerid][0], Selected[playerid][1]);
  989. ///SendClientMessage(playerid, COLOR_LIGHTRED, "* Não tem uma arma nesse slot!");
  990. PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
  991. return 1;
  992. }
  993. /*if(ItemID[playerid][x] == 1252 && PlayerInfo[playerid][pExplosivos] < 1)
  994. {
  995. ItemID[playerid][x] = 0;
  996. }*/
  997. if(ItemID[playerid][x] > 0) {
  998.  
  999. Selected[playerid][0] = ItemID[playerid][x];
  1000. if(IsAItem(playerid,Selected[playerid][0],0))
  1001. Selected[playerid][1] = 1;
  1002. else
  1003. Selected[playerid][1] = 0;
  1004. /*if(ItemID[playerid][x] == 1252)
  1005. {
  1006. Selected[playerid][1] = PlayerInfo[playerid][pExplosivos];
  1007. }*/
  1008. Selected[playerid][2] = x;
  1009.  
  1010. RotateTipItem(playerid,x);
  1011.  
  1012. setweaponNome(playerid, Selected[playerid][0], Selected[playerid][1]);
  1013.  
  1014. PlayerPlaySound(playerid, 1083, 0.0, 0.0, 0.0);
  1015. return 1;
  1016. }
  1017. else {
  1018. PlayerTextDrawSetPreviewRot(playerid, moEquipPrev[playerid], 180.000000, 160.000000, 360.000000, 2.099999);
  1019. PlayerTextDrawSetPreviewModel(playerid, moEquipPrev[playerid], getidxModelSlot(playerid, x));
  1020. PlayerTextDrawShow(playerid, moEquipPrev[playerid]);
  1021. Selected[playerid][0] = ArmasGuardadas[playerid][x];
  1022. if(IsAItem(playerid,Selected[playerid][0],0)) {
  1023. Selected[playerid][0] = ArmasGuardadas[playerid][x];
  1024. Selected[playerid][1] = BalasGuardadas[playerid][x];
  1025. Selected[playerid][2] = x;
  1026. }
  1027.  
  1028. setweaponNome(playerid, Selected[playerid][0], Selected[playerid][1]);
  1029.  
  1030. PlayerPlaySound(playerid, 1083, 0.0, 0.0, 0.0);
  1031. return 1;
  1032. }
  1033. }
  1034. }
  1035. }
  1036.  
  1037. if(playertextid == moInfo[playerid]){
  1038.  
  1039. //nova info do item em breve
  1040. }
  1041.  
  1042. else if(playertextid == moUse[playerid]) {
  1043. ShowPlayerDialog(playerid, Dialog_Mouse, DIALOG_STYLE_LIST, \
  1044. "{FFFFFF}Opçoes do Item",
  1045. "Usar/Guardar\n\
  1046. Dropar",
  1047. "Selecionar", "Cancelar");
  1048.  
  1049. }
  1050. else if(playertextid == moHelp[playerid]){
  1051.  
  1052. dialogHelp(playerid);
  1053. }
  1054. else if(playertextid == moListBox1[playerid]){
  1055. if(PlayerInfo[playerid][pMochila] >= 1) {
  1056. PlayerPlaySound(playerid, 1150, 0.0, 0.0, 0.0);
  1057. atualizarMochila(playerid,1);
  1058. }
  1059. }
  1060. else if(playertextid == moListBox2[playerid]){
  1061. if(PlayerInfo[playerid][pMochila] > 1) {
  1062. PlayerPlaySound(playerid, 1150, 0.0, 0.0, 0.0);
  1063. atualizarMochila(playerid,2);
  1064. }
  1065. else {
  1066. SendClientMessage(playerid, COLOR_GRAD4, "Sua Mochila deve ser Média para usar Este Inventório");
  1067. }
  1068. }
  1069. else if(playertextid == moListBox3[playerid]){
  1070. if(PlayerInfo[playerid][pMochila] > 2) {
  1071. PlayerPlaySound(playerid, 1150, 0.0, 0.0, 0.0);
  1072. atualizarMochila(playerid,3);
  1073. }
  1074. else
  1075. SendClientMessage(playerid, COLOR_GRAD4, "Sua Mochila deve ser Grande para usar Este Inventório");
  1076. }
  1077. else if(playertextid == moListBox4[playerid]){
  1078. if(PlayerInfo[playerid][pMochila] > 3) {
  1079. PlayerPlaySound(playerid, 1150, 0.0, 0.0, 0.0);
  1080. atualizarMochila(playerid,4);
  1081. }
  1082. else
  1083. SendClientMessage(playerid, COLOR_GRAD4, "Sua Mochila deve ser Gigante para usar Este Inventório");
  1084. }
  1085.  
  1086. else if(playertextid == moExit[playerid]){
  1087. HideMochila(playerid);
  1088. }
  1089. }
  1090. if(GetPVarInt(playerid, "vportamala")){
  1091.  
  1092. for(new x = 1; x != MAX_TRUNK_SLOTS; x++){
  1093.  
  1094. if(playertextid == pmPrev[playerid][x]){
  1095.  
  1096. if(vehTrunk[VeiculoPortaM[playerid]][x] < 1) {
  1097. dialogGuardarPM(playerid);
  1098. Selected[playerid][2] = x;
  1099. ///SendClientMessage(playerid, COLOR_LIGHTRED, "* Não tem uma arma nesse slot!");
  1100. PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
  1101. return 1;
  1102. }
  1103.  
  1104. PlayerTextDrawSetPreviewModel(playerid, pmEquipPrev[playerid], getidxPMModelSlot(VeiculoPortaM[playerid], x));
  1105. PlayerTextDrawShow(playerid, pmEquipPrev[playerid]);
  1106.  
  1107. Selected[playerid][0] = vehTrunk[VeiculoPortaM[playerid]][x];
  1108. Selected[playerid][1] = vehTrunkAmmo[VeiculoPortaM[playerid]][x];
  1109. Selected[playerid][2] = x;
  1110.  
  1111. setweaponpmNome(playerid, Selected[playerid][0], Selected[playerid][1]);
  1112.  
  1113. PlayerPlaySound(playerid, 1083, 0.0, 0.0, 0.0);
  1114. return 1;
  1115. }
  1116. }
  1117. if(playertextid == pmPrev[playerid][8]) {
  1118. PlayerTextDrawSetPreviewModel(playerid, pmEquipPrev[playerid], 1242);
  1119. PlayerTextDrawShow(playerid, pmEquipPrev[playerid]);
  1120.  
  1121. Selected[playerid][0] = VeiculoPortaM[playerid];
  1122. setItenpmNome(playerid, 8, Selected[playerid][0]);
  1123. Selected[playerid][2] = 8;
  1124. PlayerPlaySound(playerid, 1083, 0.0, 0.0, 0.0);
  1125. }
  1126. if(playertextid == pmPrev[playerid][9])
  1127. {
  1128. PlayerTextDrawSetPreviewModel(playerid, pmEquipPrev[playerid], 1279);
  1129. PlayerTextDrawShow(playerid, pmEquipPrev[playerid]);
  1130.  
  1131. Selected[playerid][0] = VeiculoPortaM[playerid];
  1132. setItenpmNome(playerid, 9, Selected[playerid][0]);
  1133. Selected[playerid][2] = 9;
  1134. PlayerPlaySound(playerid, 1083, 0.0, 0.0, 0.0);
  1135. }
  1136. if(playertextid == pmPrev[playerid][10])
  1137. {
  1138. PlayerTextDrawSetPreviewModel(playerid, pmEquipPrev[playerid], 1579);
  1139. PlayerTextDrawShow(playerid, pmEquipPrev[playerid]);
  1140.  
  1141. Selected[playerid][0] = VeiculoPortaM[playerid];
  1142. setItenpmNome(playerid, 10, Selected[playerid][0]);
  1143. Selected[playerid][2] = 10;
  1144. PlayerPlaySound(playerid, 1083, 0.0, 0.0, 0.0);
  1145. }
  1146. if(playertextid == pmDescart[playerid])
  1147. {
  1148. new thestring[128];
  1149. new result = VeiculoPortaM[playerid];
  1150. if(Selected[playerid][2] == 8)
  1151. {
  1152. if(GetPlayerArmourEx(playerid) > 0)
  1153. {
  1154. if(vehTrunkArmour[result] >= 500.000) return SendClientMessage(playerid, COLOR_GRAD1, " Seu Porta-malas só suporta 5 Coletes!");
  1155. vehTrunkArmour[result] += GetPlayerArmourEx(playerid);
  1156. SetPlayerArmour(playerid, 0);
  1157. format(thestring, sizeof(thestring), "%s tirou o colete e colocou no porta-malas do carro.", NomePlayer(playerid));
  1158. SendClientMessageInRange(30.0, playerid, thestring, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1159. setItenpmNome(playerid, 8, result);
  1160. return 1;
  1161. }
  1162. else
  1163. return SendClientMessage(playerid, COLOR_GRAD1, " Você não tem nenhum colete ");
  1164. }
  1165. else if(Selected[playerid][2] == 9)
  1166. {
  1167. if(PlayerInfo[playerid][pDrogas] != 0)
  1168. {
  1169. vehTrunkDroga[result] += PlayerInfo[playerid][pDrogas];
  1170. PlayerInfo[playerid][pDrogas] = 0;
  1171. format(thestring, sizeof(thestring), "%s colocou todas sua Maconha no porta-malas do carro.", NomePlayer(playerid));
  1172. SendClientMessageInRange(30.0, playerid, thestring, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1173. setItenpmNome(playerid, 9, result);
  1174. return 1;
  1175. }
  1176. else
  1177. return SendClientMessage(playerid, COLOR_GRAD1, " Você não tem nenhuma droga para por no porta-malas.");
  1178.  
  1179. }
  1180. else if(Selected[playerid][2] == 10)
  1181. {
  1182. if(PlayerInfo[playerid][pMats] != 0)
  1183. {
  1184. vehTrunkMaterial[result] += PlayerInfo[playerid][pMats];
  1185. PlayerInfo[playerid][pMats] = 0;
  1186.  
  1187. format(thestring, sizeof(thestring), "%s colocou todos seus materiais no porta-malas do carro.", NomePlayer(playerid));
  1188. SendClientMessageInRange(30.0, playerid, thestring, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1189. setItenpmNome(playerid, 10, result);
  1190. return 1;
  1191. }
  1192. else
  1193. return SendClientMessage(playerid, COLOR_GRAD1, " Você não tem nenhum material para por no porta-malas.");
  1194. }
  1195. }
  1196. else if(playertextid == pmEquip[playerid])
  1197. {
  1198. new thestring[128];
  1199. new result = VeiculoPortaM[playerid];
  1200. if(Selected[playerid][2] == 8)
  1201. {
  1202. if(vehTrunkArmour[result] >= 100.000)
  1203. {
  1204. vehTrunkArmour[result] -= 100.000;
  1205. SetPlayerArmour(playerid, 100);
  1206. format(thestring, sizeof(thestring), "%s Pegou um colete que estava no porta-malas do carro.", NomePlayer(playerid));
  1207. SendClientMessageInRange(30.0, playerid, thestring, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1208. setItenpmNome(playerid, 8, result);
  1209. return 1;
  1210. }
  1211. else
  1212. return SendClientMessage(playerid, COLOR_GRAD1, " Seu Porta-malas está sem Colete suficiente para lhe dar.");
  1213. }
  1214. else if(Selected[playerid][2] == 9)
  1215. {
  1216. if(vehTrunkDroga[result] > 0)
  1217. {
  1218. PlayerInfo[playerid][pDrogas] += vehTrunkDroga[result];
  1219. vehTrunkDroga[result] = 0;
  1220. format(thestring, sizeof(thestring), "%s pegou toda sua Maconha no porta-malas do carro.", NomePlayer(playerid));
  1221. SendClientMessageInRange(30.0, playerid, thestring, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1222. setItenpmNome(playerid, 9, result);
  1223. return 1;
  1224. }
  1225. else
  1226. return SendClientMessage(playerid, COLOR_GRAD1, " Você não tem nenhuma droga para pegar no porta-malas.");
  1227. }
  1228. else if(Selected[playerid][2] == 10) {
  1229. if(vehTrunkMaterial[result] > 0) {
  1230.  
  1231. PlayerInfo[playerid][pMats] += vehTrunkMaterial[result];
  1232. vehTrunkMaterial[result] = 0;
  1233.  
  1234. format(thestring, sizeof(thestring), "%s pegou todo seus material no porta-malas do carro.", NomePlayer(playerid));
  1235. SendClientMessageInRange(30.0, playerid, thestring, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1236. setItenpmNome(playerid, 10, result);
  1237. return 1;
  1238. }
  1239. else
  1240. return SendClientMessage(playerid, COLOR_GRAD1, " Você não tem nenhum material para pegar no porta-malas.");
  1241. }
  1242. else if(Selected[playerid][0])
  1243. {
  1244. new string[85];
  1245.  
  1246. GivePlayerWeapon(playerid, Selected[playerid][0], Selected[playerid][1]);
  1247.  
  1248. format(string, sizeof string, "Você pegou uma arma %s com %d balas!",NomeArma(Selected[playerid][0]),vehTrunkAmmo[VeiculoPortaM[playerid]][Selected[playerid][2]]);
  1249. SendClientMessage(playerid, COLOR_R, string);
  1250. Sound(playerid, 36401, 30.0);
  1251. format(string, sizeof(string), "* %s pegou uma arma do Porta Malas", NomeArma(Selected[playerid][0]));
  1252. SendClientMessageInRange(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1253.  
  1254. vehTrunk[VeiculoPortaM[playerid]][Selected[playerid][2]] = 0;
  1255. vehTrunkAmmo[VeiculoPortaM[playerid]][Selected[playerid][2]] = 0;
  1256.  
  1257. atualizarPortaMala(playerid);
  1258.  
  1259. Selected[playerid][0] = 0;
  1260. Selected[playerid][1] = 0;
  1261. Selected[playerid][2] = 0;
  1262.  
  1263. setweaponpmNome(playerid, 0, 0);
  1264. }
  1265. else
  1266. {
  1267. SendClientMessage(playerid, COLOR_LIGHTRED, "* Você ainda não selecionou uma arma!");
  1268. PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
  1269. }
  1270. }
  1271.  
  1272. else if(playertextid == pmHelp[playerid]){
  1273.  
  1274. dialogHelp(playerid);
  1275. }
  1276.  
  1277. else if(playertextid == pmExit[playerid]){
  1278.  
  1279. HidePortaMala(playerid);
  1280. }
  1281. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement