Advertisement
Guest User

FiterScript Mercado 24/7 e Loja de Armas

a guest
Dec 18th, 2012
1,036
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 20.97 KB | None | 0 0
  1. /*FilterScript Simples Criado Por Mim Mega_Style*/
  2. /*Esse FilterScript Adicona Alguns Mercados 24/7 Por Los Santos*/
  3. /*Tambem Adiciona Algumas Lojas de Armas*/
  4. /*Nos Mercados 24/7 Vende:*/
  5.  
  6. /*Ferramentas(Com Elas é Possível Reparar Carros)*/
  7. /*Capacete(Com Ele é Possível Colocar/Tirar o Capacete)*/
  8. /*Hamburguer(Com Ele é Possível Recuperar 50 HP)*/
  9.  
  10. /*Nas Lojas de Armas Vende:*/
  11.  
  12. /*Desert Eagle(R$ 2000)*/
  13. /*Mp5(R$ 3000)*/
  14. /*Shotgun(R$ 3500)*/
  15. /*M4(R$ 4000)*/
  16. /*AK-47(R$ 4000)*/
  17. /*Sniper Rifle(R$ 5000)*/
  18.  
  19. /*OBS: Não Adicionei mais armas porque muitos GameModes tem Anti-Weapon Hack Então Coloquei as Padrões*/
  20.  
  21. /*       INCLUDE       */
  22. #include <a_samp>
  23. #include < zcmd >
  24. #include < dof2 >
  25. /*       CORES       */
  26. #define BRANCO       0xFFFFFFFF
  27. #define AMARELO      0xFFFF00AA
  28. #define CINZA        0xC0C0C0AA
  29. #define VERMELHO     0xFF0D0DAA
  30. /*       DEFINES       */
  31. #define Msg  SendClientMessage
  32. #define PATH "Armas"
  33. /*       DIALOGS       */
  34. #define DIALOG_MERCADO     997
  35. #define DIALOG_ARMAS       998
  36. #define DIALOG_GPS         999
  37. /*      VARIÁVEIS      */
  38. enum mInfo
  39. {
  40. bool:pCapacete,
  41. bool:pFerramentas
  42. };
  43. static MercadoInfo[MAX_PLAYERS][mInfo];
  44. static Capacete[MAX_PLAYERS];
  45. static bool:ArmasEntregue[MAX_PLAYERS];
  46. static bool:GPSPos[MAX_PLAYERS];
  47.  
  48. public OnFilterScriptInit()
  49. {
  50.     DisableInteriorEnterExits();
  51.                         /*              PICKUPS              */
  52.     AddStaticPickup(1318,23,1368.8413,-1279.8389,13.5469);// Entrada Ammu Nation       (1)
  53.     AddStaticPickup(1318,23,1257.3035,-1584.7076,13.5469);// Entrada Ammu Nation       (2)
  54.     AddStaticPickup(1318,23,1070.8396,-1868.4392,13.5469);// Entrada Ammu Nation       (3)
  55.  
  56.     AddStaticPickup(1318,23,285.4731,-41.8047,1001.5156);// Saida Ammu Nation          (1)
  57.     AddStaticPickup(1318,23,285.8652,-86.7746,1001.5229);// Saida Ammu Nation          (2)
  58.     AddStaticPickup(1318,23,296.919983,-108.071999,1001.569946);// Saida Ammu Nation   (3)
  59.  
  60.     AddStaticPickup(351,23,295.9408,-38.5125,1001.5156);// Menu Armas Ammu Nation      (1)
  61.     AddStaticPickup(351,23,295.5753,-80.8056,1001.5156);// Menu Armas Ammu Nation      (2)
  62.     AddStaticPickup(351,23,291.5666,-106.3043,1001.5156);// Menu Armas Ammu Nation     (3)
  63.  
  64.     AddStaticPickup(1239,23,-28.0183,-89.9501,1003.5469);// Menu Mercado 24/7          (1)
  65.     AddStaticPickup(1239,23,-23.2907,-55.6403,1003.5469);// Menu Mercado 24/7          (2)
  66.     AddStaticPickup(1239,23,-22.0060,-138.6284,1003.5469);// Menu Mercado 24/7         (3)
  67.  
  68.     AddStaticPickup(1318,23,1352.3535,-1759.2533,13.5078); // Entrada Mercado 24/7     (1)
  69.     AddStaticPickup(1318,23,1928.5914,-1776.3573,13.5469); // Entrada Mercado 24/7     (2)
  70.     AddStaticPickup(1318,23,2424.2417,-1742.7839,13.5459); // Entrada Mercado 24/7     (3)
  71.  
  72.     AddStaticPickup(1318,23,-30.9630,-92.0112,1003.5469); // Saida Mercado 24/7        (1)
  73.     AddStaticPickup(1318,23,-27.5302,-58.2646,1003.5469); // Saida Mercado 24/7        (2)
  74.     AddStaticPickup(1318,23,-25.8544,-141.5577,1003.5469); // Saida Mercado 24/7       (3)
  75.                        /*              3D TEXTS              */
  76.     Create3DTextLabel("{FFFFFF}Loja de Armas\nAperte {00FFFF}'F' {FFFFFF}Para Entrar",BRANCO,1368.8413,-1279.8389,13.5469,15,0);// Entrada Ammu Nation             (1)
  77.     Create3DTextLabel("{FFFFFF}Loja de Armas\nAperte {00FFFF}'F' {FFFFFF}Para Entrar",BRANCO,1257.3035,-1584.7076,13.5469,15,0);// Entrada Ammu Nation             (2)
  78.     Create3DTextLabel("{FFFFFF}Loja de Armas\nAperte {00FFFF}'F' {FFFFFF}Para Entrar",BRANCO,1070.8396,-1868.4392,13.5469,15,0);// Entrada Ammu Nation             (3)
  79.  
  80.     Create3DTextLabel("{FFFFFF}Loja de Armas\nAperte {00FFFF}'F' {FFFFFF}Para Sair",BRANCO,285.4731,-41.8047,1001.5156,15,0);// Saida Ammu Nation                  (1)
  81.     Create3DTextLabel("{FFFFFF}Loja de Armas\nAperte {00FFFF}'F' {FFFFFF}Para Sair",BRANCO,285.8652,-86.7746,1001.5229,15,0);// Saida Ammu Nation                  (2)
  82.     Create3DTextLabel("{FFFFFF}Loja de Armas\nAperte {00FFFF}'F' {FFFFFF}Para Sair",BRANCO,296.919983,-108.071999,1001.569946,15,0);// Saida Ammu Nation           (3)
  83.  
  84.     Create3DTextLabel("{FFFFFF}Menu de Armas\nAperte {00FFFF}'F' {FFFFFF}Para Comprar",BRANCO,295.9408,-38.5125,1001.5156,15,0);// Menu de Armas Ammu Nation       (1)
  85.     Create3DTextLabel("{FFFFFF}Menu de Armas\nAperte {00FFFF}'F' {FFFFFF}Para Comprar",BRANCO,295.5753,-80.8056,1001.5156,15,0);// Menu de Armas Ammu Nation       (2)
  86.     Create3DTextLabel("{FFFFFF}Menu de Armas\nAperte {00FFFF}'F' {FFFFFF}Para Comprar",BRANCO,291.5666,-106.3043,1001.5156,15,0);// Menu de Armas Ammu Nation      (3)
  87.  
  88.     Create3DTextLabel("{FFFFFF}Menu do Mercado 24/7\nAperte {00FFFF}'F' {FFFFFF}Para Comprar",BRANCO,-28.0183,-89.9501,1003.5469,20,0);// Menu do Mercado 24/7     (1)
  89.     Create3DTextLabel("{FFFFFF}Menu do Mercado 24/7\nAperte {00FFFF}'F' {FFFFFF}Para Comprar",BRANCO,-23.2907,-55.6403,1003.5469,20,0);// Menu de Mercado 24/7     (2)
  90.     Create3DTextLabel("{FFFFFF}Menu do Mercado 24/7\nAperte {00FFFF}'F' {FFFFFF}Para Comprar",BRANCO,-22.0060,-138.6284,1003.5469,20,0);// Menu do Mercado 24/7    (3)
  91.  
  92.     Create3DTextLabel("{FFFFFF}Mercado 24/7\nAperte {00FFFF}'F' {FFFFFF}Para Entrar",BRANCO,1352.3535,-1759.2533,13.5078,20,0); // Entrada Mercado 24/7            (1)
  93.     Create3DTextLabel("{FFFFFF}Mercado 24/7\nAperte {00FFFF}'F' {FFFFFF}Para Entrar",BRANCO,1928.5914,-1776.3573,13.5469,20,0); // Entrada Mercado 24/7            (2)
  94.     Create3DTextLabel("{FFFFFF}Mercado 24/7\nAperte {00FFFF}'F' {FFFFFF}Para Entrar",BRANCO,2424.2417,-1742.7839,13.5459,20,0); // Entrada Mercado 24/7            (3)
  95.  
  96.     Create3DTextLabel("{FFFFFF}Mercado 24/7\nAperte {00FFFF}'F' {FFFFFF}Para Sair",BRANCO,-30.9630,-92.0112,1003.5469,20,0); // Saida Mercado 24/7                 (1)
  97.     Create3DTextLabel("{FFFFFF}Mercado 24/7\nAperte {00FFFF}'F' {FFFFFF}Para Sair",BRANCO,-27.5302,-58.2646,1003.5469,20,0); // Saida Mercado 24/7                 (2)
  98.     Create3DTextLabel("{FFFFFF}Mercado 24/7\nAperte {00FFFF}'F' {FFFFFF}Para Sair",BRANCO,-25.8544,-141.5577,1003.5469,20,0); // Saida Mercado 24/7                 (3)
  99.     return 1;
  100. }
  101.  
  102. public OnFilterScriptExit()
  103. {
  104.     DOF2_Exit();
  105.     return 1;
  106. }
  107.  
  108. public OnPlayerConnect(playerid)
  109. {
  110.     ArmasEntregue[playerid] = false;
  111.     CarregarLoja(playerid);
  112.     return 1;
  113. }
  114.  
  115. public OnPlayerDisconnect(playerid, reason)
  116. {
  117.     SalvarLoja(playerid);
  118.     SaveWeaponsToFile(playerid);
  119.     return 1;
  120. }
  121.  
  122. public OnPlayerSpawn(playerid)
  123. {
  124.     if(ArmasEntregue[playerid] == false)SetTimerEx("LoadArmasToFile",250,false,"i",playerid);
  125.     return 1;
  126. }
  127.  
  128. public OnPlayerKeyStateChange(playerid,newkeys,oldkeys)
  129. {
  130.     if(newkeys == 16 && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
  131.     {
  132.         cmd_entrarlojas(playerid);
  133.         cmd_sairlojas(playerid);
  134.         cmd_armas(playerid);
  135.         cmd_mercado(playerid);
  136.     }
  137.     return 1;
  138. }
  139.  
  140. public OnPlayerEnterCheckpoint(playerid)
  141. {
  142.     if(GPSPos[playerid] == true)
  143.     {
  144.         GameTextForPlayer(playerid, "~b~~h~Chegou Ao Seu Destino", 1000, 1);
  145.         GPSPos[playerid] = false;
  146.         DisablePlayerCheckpoint(playerid);
  147.     }
  148.     return 1;
  149. }
  150.  
  151. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  152. {
  153.     if(dialogid == DIALOG_MERCADO)
  154.     {
  155.     if(response)
  156.     {
  157.     if(listitem == 0)
  158.     {
  159.         if(GetPlayerMoney(playerid) < 1000) return Msg(playerid,CINZA,"Você não possui R$ 1000 para comprar!");
  160.         GivePlayerMoney(playerid, -1000);
  161.         MercadoInfo[playerid][pFerramentas] = true;
  162.         Msg(playerid, AMARELO ,"Agora você pode usar o comando /concertar para reparar seu veiculo.");
  163.     }
  164.     if(listitem == 1)
  165.     {
  166.         if(GetPlayerMoney(playerid) < 500) return Msg(playerid,CINZA,"Você não possui R$ 500 para comprar!");
  167.         GivePlayerMoney(playerid, -500);
  168.         MercadoInfo[playerid][pCapacete] = true;
  169.         Msg(playerid, AMARELO ,"Agora você pode usar o comando /capacete e /tirarcapacete.");
  170.     }
  171.     if(listitem == 2)
  172.     {
  173.         if(GetPlayerMoney(playerid) < 100) return Msg(playerid,CINZA,"Você não possui R$ 100 para comprar!");
  174.         GivePlayerMoney(playerid, -100);
  175.         static Float:vida;
  176.         GetPlayerHealth(playerid, vida);
  177.         SetPlayerHealth(playerid, vida+50);
  178.         Msg(playerid, AMARELO ,"Você comeu um Hamburguer e recuperou 50 HP.");
  179.     }
  180.     return 1;
  181.     }
  182. }
  183.  
  184.     if(dialogid == DIALOG_ARMAS)
  185.     {
  186.     if(response)
  187.     {
  188.     if(listitem == 0)
  189.     {
  190.         if(GetPlayerMoney(playerid) < 1000) return Msg(playerid,CINZA,"Você não possui R$ 1000 para comprar!");
  191.         GivePlayerMoney(playerid, -1000);
  192.         GivePlayerWeapon(playerid, 24 , 300);
  193.         Msg(playerid, AMARELO , "Você comprou uma Desert Eagle com 300 Balas.");
  194.     }
  195.     if(listitem == 1)
  196.     {
  197.         if(GetPlayerMoney(playerid) < 2000) return Msg(playerid,CINZA,"Você não possui R$ 2000 para comprar!");
  198.         GivePlayerMoney(playerid, -2000);
  199.         GivePlayerWeapon(playerid, 29 , 300);
  200.         Msg(playerid, AMARELO , "Você comprou uma MP5 com 300 Balas.");
  201.     }
  202.     if(listitem == 2)
  203.     {
  204.         if(GetPlayerMoney(playerid) < 3000) return Msg(playerid,CINZA,"Você não possui R$ 3000 para comprar!");
  205.         GivePlayerMoney(playerid, -3000);
  206.         GivePlayerWeapon(playerid, 25 , 150);
  207.         Msg(playerid, AMARELO , "Você comprou uma Shotgun com 150 Balas.");
  208.     }
  209.     if(listitem == 3)
  210.     {
  211.         if(GetPlayerMoney(playerid) < 4000) return Msg(playerid,CINZA,"Você não possui R$ 4000 para comprar!");
  212.         GivePlayerMoney(playerid, -4000);
  213.         GivePlayerWeapon(playerid, 31 , 500);
  214.         Msg(playerid, AMARELO , "Você comprou uma M4 com 500 Balas.");
  215.     }
  216.     if(listitem == 4)
  217.     {
  218.         if(GetPlayerMoney(playerid) < 4000) return Msg(playerid,CINZA,"Você não possui R$ 4000 para comprar!");
  219.         GivePlayerMoney(playerid, -4000);
  220.         GivePlayerWeapon(playerid, 30 , 500);
  221.         Msg(playerid, AMARELO , "Você comprou uma AK-47 com 500 Balas.");
  222.     }
  223.     if(listitem == 5)
  224.     {
  225.         if(GetPlayerMoney(playerid) < 5000) return Msg(playerid,CINZA,"Você não possui R$ 5000 para comprar!");
  226.         GivePlayerMoney(playerid, -5000);
  227.         GivePlayerWeapon(playerid, 34 , 50);
  228.         Msg(playerid, AMARELO , "Você comprou uma Sniper Rifle com 50 Balas.");
  229.     }
  230.     return 1;
  231.     }
  232. }
  233.  
  234.     if(dialogid == DIALOG_GPS)
  235.     {
  236.     if(response)
  237.     {
  238.     if(listitem == 0)
  239.     {
  240.         ShowPlayerDialog(playerid, DIALOG_GPS+1 ,DIALOG_STYLE_LIST,"GPS","{0000FF}L{FFFFFF}ojas de Armas 1\n{0000FF}L{FFFFFF}oja de Armas 2\n{0000FF}L{FFFFFF}oja de Armas 3", "Selecionar" , "Cancelar");
  241.     }
  242.     if(listitem == 1)
  243.     {
  244.         ShowPlayerDialog(playerid, DIALOG_GPS+2 ,DIALOG_STYLE_LIST,"GPS","{0000FF}M{FFFFFF}ercado 24/7 1\n{0000FF}M{FFFFFF}ercado 24/7 2\n{0000FF}M{FFFFFF}ercado 24/7 3", "Selecionar" , "Cancelar");
  245.     }
  246.     return 1;
  247.     }
  248. }
  249.  
  250.     if(dialogid == DIALOG_GPS+1)
  251.     {
  252.     if(response)
  253.     {
  254.     if(listitem == 0)
  255.     {
  256.         SetPlayerCheckpoint(playerid,1363.2206,-1280.5405,13.5469,8.0);
  257.         Msg(playerid,AMARELO,"Lugar Marcado no Mapa: Loja de Armas 1");
  258.         GPSPos[playerid] = true;
  259.     }
  260.     if(listitem == 1)
  261.     {
  262.         SetPlayerCheckpoint(playerid,1067.0222,-1868.3098,13.5469,8.0);
  263.         Msg(playerid,AMARELO,"Lugar Marcado no Mapa: Loja de Armas 2");
  264.         GPSPos[playerid] = true;
  265.     }
  266.     if(listitem == 2)
  267.     {
  268.         SetPlayerCheckpoint(playerid,1256.9873,-1580.2556,13.5469,8.0);
  269.         Msg(playerid,AMARELO,"Lugar Marcado no Mapa: Loja de Armas 3");
  270.         GPSPos[playerid] = true;
  271.     }
  272.     return 1;
  273.     }
  274. }
  275.  
  276.     if(dialogid == DIALOG_GPS+2)
  277.     {
  278.     if(response)
  279.     {
  280.     if(listitem == 0)
  281.     {
  282.         SetPlayerCheckpoint(playerid,1352.3535,-1759.2533,13.5078,8.0);
  283.         Msg(playerid,AMARELO,"Lugar Marcado no Mapa: Mercado 24/7 1");
  284.         GPSPos[playerid] = true;
  285.     }
  286.     if(listitem == 1)
  287.     {
  288.         SetPlayerCheckpoint(playerid,1928.5914,-1776.3573,13.5469,8.0);
  289.         Msg(playerid,AMARELO,"Lugar Marcado no Mapa: Mercado 24/7 2");
  290.         GPSPos[playerid] = true;
  291.     }
  292.     if(listitem == 2)
  293.     {
  294.         SetPlayerCheckpoint(playerid,2424.2417,-1742.7839,13.5459,8.0);
  295.         Msg(playerid,AMARELO,"Lugar Marcado no Mapa: Mercado 24/7 3");
  296.         GPSPos[playerid] = true;
  297.     }
  298.     return 1;
  299.     }
  300. }
  301.     return 1;
  302. }
  303.  
  304. CMD:gps(playerid)
  305. {
  306.     if(!IsPlayerConnected(playerid))return Msg(playerid, CINZA, "Você não está conectado!");
  307.     ShowPlayerDialog(playerid, DIALOG_GPS ,DIALOG_STYLE_LIST,"GPS","{0000FF}L{FFFFFF}ojas de Armas\n{0000FF}M{FFFFFF}ercados 24/7", "Selecionar" , "Cancelar");
  308.     return 1;
  309. }
  310. CMD:entrarlojas(playerid)
  311. {
  312.     if(!IsPlayerConnected(playerid))return Msg(playerid, CINZA, "Você não está conectado!");
  313.     if (PlayerToPoint(1.0, playerid,1368.8413,-1279.8389,13.5469))//Ammu Nation 1 - Entrada
  314.     {
  315.         SetPlayerInterior(playerid,1);
  316.         SetPlayerVirtualWorld(playerid, 0);
  317.         SetPlayerPos(playerid,286.148987,-40.644398,1001.569946);
  318.         GameTextForPlayer(playerid, "~b~~h~Ammu Nation 1", 1000, 1);
  319.     }
  320.     if(PlayerToPoint(1.0, playerid,1257.3035,-1584.7076,13.5469))//Ammu Nation 2 - Entrada
  321.     {
  322.         SetPlayerInterior(playerid, 4);
  323.         SetPlayerVirtualWorld(playerid, 0);
  324.         SetPlayerPos(playerid, 286.800995,-82.547600,1001.539978);
  325.         GameTextForPlayer(playerid, "~g~~h~Ammu Nation 2", 1000, 1);
  326.     }
  327.     if(PlayerToPoint(1.0, playerid,1070.8396,-1868.4392,13.5469))//Ammu Nation 3 - Entrada
  328.     {
  329.         SetPlayerInterior(playerid, 6);
  330.         SetPlayerVirtualWorld(playerid, 0);
  331.         SetPlayerPos(playerid, 296.919983,-108.071999,1001.569946);
  332.         GameTextForPlayer(playerid, "~r~~h~Ammu Nation 3", 1000, 1);
  333.     }
  334.  
  335.     if(PlayerToPoint(1.0, playerid,1352.3535,-1759.2533,13.5078))//Mercado 24/7 1 - Entrada
  336.     {
  337.         SetPlayerInterior(playerid, 18);
  338.         SetPlayerVirtualWorld(playerid, 0);
  339.         SetPlayerPos(playerid,-30.9467,-89.6096,1003.5469);
  340.         GameTextForPlayer(playerid, "~p~~h~Mercado 24/7 1", 1000, 1);
  341.     }
  342.     if(PlayerToPoint(1.0, playerid,1928.5914,-1776.3573,13.5469))//Mercado 24/7 2 - Entrada
  343.     {
  344.         SetPlayerInterior(playerid, 6);
  345.         SetPlayerVirtualWorld(playerid, 0);
  346.         SetPlayerPos(playerid, -27.5302,-58.2646,1003.5469);
  347.         GameTextForPlayer(playerid, "~y~~h~Mercado 24/7 2", 1000, 1);
  348.     }
  349.     if(PlayerToPoint(1.0, playerid,2424.2417,-1742.7839,13.5459))//Mercado 24/7 3 - Entrada
  350.     {
  351.         SetPlayerInterior(playerid, 16);
  352.         SetPlayerVirtualWorld(playerid, 0);
  353.         SetPlayerPos(playerid, -25.1326,-139.0670,1003.5469);
  354.         GameTextForPlayer(playerid, "~w~Mercado 24/7 3", 1000, 1);
  355.     }
  356.     return 1;
  357. }
  358.  
  359. CMD:sairlojas(playerid)
  360. {
  361.     if(!IsPlayerConnected(playerid)) return Msg(playerid, CINZA, "Você não está conectado!");
  362.     if (PlayerToPoint(1.0, playerid, 285.4731,-41.8047,1001.5156))// Ammu Nation 1 - Saida
  363.     {
  364.         SetPlayerInterior(playerid,0);
  365.         SetPlayerPos(playerid,1368.8413,-1279.8389,13.5469);
  366.         SetPlayerVirtualWorld(playerid, 0);
  367.     }
  368.     if (PlayerToPoint(1.0, playerid, 285.8652,-86.7746,1001.5229))// Ammu Nation 2 - Saida
  369.     {
  370.         SetPlayerInterior(playerid,0);
  371.         SetPlayerPos(playerid, 1257.3035,-1584.7076,13.5469);
  372.         SetPlayerVirtualWorld(playerid, 0);
  373.     }
  374.     if (PlayerToPoint(1.0, playerid, 296.919983,-108.071999,1001.569946))// Ammu Nation 3 - Saida
  375.     {
  376.         SetPlayerInterior(playerid,0);
  377.         SetPlayerPos(playerid, 1070.8396,-1868.4392,13.5469);
  378.         SetPlayerVirtualWorld(playerid, 0);
  379.     }
  380.     if (PlayerToPoint(1.0, playerid, -30.9630,-92.0112,1003.5469))// Mercado 24/7 1 - Saida
  381.     {
  382.         SetPlayerInterior(playerid,0);
  383.         SetPlayerPos(playerid, 1352.3535,-1759.2533,13.5078);
  384.         SetPlayerVirtualWorld(playerid, 0);
  385.     }
  386.     if (PlayerToPoint(1.0, playerid, -27.5302,-58.2646,1003.5469))// Mercado 24/7 2 - Saida
  387.     {
  388.         SetPlayerInterior(playerid,0);
  389.         SetPlayerPos(playerid, 1928.5914,-1776.3573,13.5469);
  390.         SetPlayerVirtualWorld(playerid, 1);
  391.     }
  392.     if (PlayerToPoint(1.0, playerid, -25.8544,-141.5577,1003.5469))// Mercado 24/7 3 - Saida
  393.     {
  394.         SetPlayerInterior(playerid,0);
  395.         SetPlayerPos(playerid, 2424.2417,-1742.7839,13.5459);
  396.         SetPlayerVirtualWorld(playerid, 0);
  397.     }
  398.     return 1;
  399. }
  400.  
  401. CMD:mercado(playerid)
  402. {
  403.    if(!IsPlayerConnected(playerid))return Msg(playerid, CINZA ,"Você não esta conectado.");
  404.    if(PlayerToPoint(1.0, playerid, -28.0183,-89.9501,1003.5469) || PlayerToPoint(1.0, playerid, -23.2907,-55.6403,1003.5469))
  405.    {
  406.    ShowPlayerDialog(playerid, DIALOG_MERCADO ,DIALOG_STYLE_LIST,"Mercado 24/7","{FFFFFF}Ferramentas - {0000FF}R$ 1000\n{FFFFFF}Capacete - {0000FF}R$ 500\n{FFFFFF}Hamburguer - {0000FF}R$ 100", "Comprar" , "Sair");
  407.    }
  408.    return 1;
  409. }
  410.  
  411. CMD:armas(playerid)
  412. {
  413.    if(!IsPlayerConnected(playerid))return Msg(playerid, CINZA ,"Você não esta conectado.");
  414.    if(PlayerToPoint(2.0, playerid, 291.5666,-106.3043,1001.5156) || PlayerToPoint(2.0, playerid, 295.5753,-80.8056,1001.5156) || PlayerToPoint(2.0, playerid,295.9408,-38.5125,1001.5156))
  415.    {
  416.    ShowPlayerDialog(playerid, DIALOG_ARMAS ,DIALOG_STYLE_LIST,"Loja de Armas","{FFFFFF}Desert Eagle - {0000FF}R$ 2000\n{FFFFFF}MP5 - {0000FF}R$ 3000\n{FFFFFF}Shotgun - {0000FF}R$ 3500\n{FFFFFF}M4 - {0000FF}R$ 4000\n{FFFFFF}AK-47 - {0000FF}R$ 4000\n{FFFFFF}Sniper Rifle - {0000FF}R$ 5000", "Comprar" , "Sair");
  417.    }
  418.    return 1;
  419. }
  420.  
  421. CMD:capacete(playerid)
  422. {
  423.     if(!IsPlayerInAnyVehicle(playerid))return Msg(playerid, AMARELO ,"Você não está em um veiculo!");
  424.     if(MercadoInfo[playerid][pCapacete] == true )
  425.     {
  426.     Capacete[playerid] = 1;
  427.     SetPlayerAttachedObject(playerid,1,18645,2,0.07,0,0,88,75,0);
  428.     Msg(playerid,AMARELO,"Você Colocou o Capacete Agora Você Pode Dirigir Com Segurança!");
  429.     Msg(playerid,CINZA,"Para Tirar o Capacete Use: /tirarcapacete");
  430.     }
  431.     else
  432.     {
  433.     Msg(playerid,VERMELHO,"[AVISO] Você não possui um Capacete.");
  434.     }
  435.     return 1;
  436. }
  437.  
  438. CMD:tirarcapacete(playerid)
  439. {
  440.     if(Capacete[playerid] == 1)
  441.     {
  442.     Capacete[playerid] = 0;
  443.     RemovePlayerAttachedObject(playerid, 1);
  444.     }
  445.     else
  446.     {
  447.     Msg(playerid, VERMELHO ,"[AVISO] Você já está sem Capacete!");
  448.     }
  449.     return 1;
  450. }
  451.  
  452. CMD:concertar(playerid)
  453. {
  454.     if(!IsPlayerInAnyVehicle(playerid))return Msg(playerid, AMARELO ,"Você não está em um veiculo!");
  455.     if(MercadoInfo[playerid][pFerramentas] == true )
  456.     {
  457.     SetVehicleHealth(playerid, 100);
  458.     Msg(playerid, AMARELO ,"Seu veiculo foi reparado com sucesso.");
  459.     }
  460.     else
  461.     {
  462.     Msg(playerid, VERMELHO ,"[AVISO] Você não possui Ferramentas.");
  463.     }
  464.     return 1;
  465. }
  466. /*       STOCKS        */
  467. stock RetornaMercado(playerid)
  468. {
  469.     static File[156],Name[MAX_PLAYER_NAME];
  470.     GetPlayerName(playerid,Name,sizeof(Name));
  471.     format(File,sizeof(File),"Mercado/%s.txt",Name);
  472.     return File;
  473. }
  474.  
  475. stock SalvarLoja(playerid)
  476. {
  477.     if(DOF2_FileExists(RetornaMercado(playerid)))
  478.     {
  479.     DOF2_SetBool(RetornaMercado(playerid),"Ferramentas",MercadoInfo[playerid][pFerramentas]);
  480.     DOF2_SetBool(RetornaMercado(playerid),"Capacete",MercadoInfo[playerid][pCapacete]);
  481.     DOF2_SaveFile();
  482.     }
  483. }
  484.  
  485. stock CarregarLoja(playerid)
  486. {
  487.     if(DOF2_FileExists(RetornaMercado(playerid)))
  488.     {
  489.     MercadoInfo[playerid][pFerramentas] = DOF2_GetBool(RetornaMercado(playerid),"Ferramentas");
  490.     MercadoInfo[playerid][pCapacete] = DOF2_GetBool(RetornaMercado(playerid),"Capacete");
  491.     }
  492. }
  493.  
  494. SaveWeaponsToFile(playerid)
  495. {
  496.     new i, path[50], string[128], weaponid, ammo;
  497.     path = GetPlayerFormattedName(playerid);
  498.     if (!DOF2_FileExists(path)) DOF2_CreateFile(path);
  499.     for (i=0; i<13; i++)
  500.     {
  501.     GetPlayerWeaponData(playerid,i,weaponid,ammo);
  502.     format(string,sizeof(string),"Arma - %d",i);
  503.     DOF2_SetInt(path,string,weaponid);
  504.     format(string,sizeof(string),"Municao - %d",i);
  505.     DOF2_SetInt(path,string,ammo == 65535 ? 0 : ammo);
  506.     }
  507. }
  508.  
  509. forward LoadArmasToFile(playerid);
  510. public LoadArmasToFile(playerid)
  511. {
  512.     new i, path[50], string[128], weaponid, ammo;
  513.     path = GetPlayerFormattedName(playerid);
  514.     ResetPlayerWeapons(playerid);
  515.     for (i=0; i<13; i++)
  516.     {
  517.     format(string,sizeof(string),"Arma - %d",i);
  518.     weaponid = DOF2_GetInt(path,string);
  519.     format(string,sizeof(string),"Municao - %d",i);
  520.     ammo = DOF2_GetInt(path,string);
  521.     GivePlayerWeapon(playerid,weaponid,ammo);
  522.     }
  523.     ArmasEntregue[playerid] = true;
  524. }
  525.  
  526. GetPlayerFormattedName(playerid)
  527. {
  528.     new name[24], full[50];
  529.     GetPlayerName(playerid,name,sizeof(name));
  530.     format(full,sizeof(full),"%s/%s.txt",PATH,name);
  531.     return full;
  532. }
  533.  
  534. forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
  535. public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
  536. {
  537.     if(IsPlayerConnected(playerid))
  538.     {
  539.         new Float:oldposx, Float:oldposy, Float:oldposz;
  540.         new Float:tempposx, Float:tempposy, Float:tempposz;
  541.         GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  542.         tempposx = (oldposx -x);
  543.         tempposy = (oldposy -y);
  544.         tempposz = (oldposz -z);
  545.         if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  546.         {
  547.             return true;
  548.         }
  549.     }
  550.     return 0;
  551. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement