Advertisement
Guest User

Sistema Ammu-Nation

a guest
Jan 24th, 2014
307
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 15.89 KB | None | 0 0
  1. /*CRÉDITOS: ZCMD: Zeex; A_SAMP: EQUIP SA-MP
  2.             PICKUP: http://weedarr.wikidot.com/
  3.             CORES: http://www.mxstudio.com.br/Conteudos/Dreamweaver/Cores.htm
  4.             AJUDA: JonathanFeitosa(tutorial de como usar dialog)
  5.                    iCasTiel(por corrigir um erro cometido por minha pessoa)
  6.                    Dolby(mostrando um pequeno erro cometido por minha pessoa)*/
  7.  
  8. //includes
  9. #include    < a_samp >
  10. #include    < zcmd >
  11.  
  12. //defines
  13. #define     COR_VERMELHOESCURO 0x8B0000
  14. #define     COR_VERDEESCURO 0x008B00
  15.  
  16. #define     DIALOG_MENU_DE_ARMAS 0
  17. #define     DIALOG_ARMAS_BRANCAS 1
  18. #define     DIALOG_PISTOLAS 2
  19. #define     DIALOG_ESCOPETAS 3
  20. #define     DIALOG_SUB_METRALHADORAS 4
  21. #define     DIALOG_RIFLES_DE_ALTO_CALIBRE 5
  22. #define     DIALOG_SNIPER 6
  23. #define     DIALOG_BOMBAS 7
  24. #define     DIALOG_UTILITARIOS 8
  25.  
  26. //new's
  27. new pickup_ammunation[5];
  28.  
  29. //publics
  30. public OnFilterScriptInit()
  31. {
  32.     pickup_ammunation[1] = CreatePickup(1239, 0, 1368.3351,-1279.8118,13.5469, -1); //entrada
  33.     pickup_ammunation[2] = CreatePickup(1239, 0, 285.4391,-41.4983,1001.5156, -1); //sair
  34.     pickup_ammunation[3] = CreatePickup(1239, 0, 295.8998,-38.5147,1001.5156, -1); //comprar arma
  35.     return true;
  36. }
  37.  
  38. public OnPlayerCommandText(playerid, cmdtext[])
  39. {
  40.     return SendClientMessage(playerid, COR_VERMELHOESCURO, "[ERRO] O comando digitado é inválido e/ou não existe.");
  41. }
  42.  
  43. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  44. {
  45.     if(dialogid == DIALOG_MENU_DE_ARMAS)
  46.     {
  47.         if(response)
  48.         {
  49.             if(listitem == 0)
  50.             {
  51.                 ShowPlayerDialog(dialogid, DIALOG_ARMAS_BRANCAS, DIALOG_STYLE_LIST, "Armas brancas", "Soco inglês/t$100,00/nFaca/t$50,00/nTaco de Baaseball/t$75,00", "Comprar", "Voltar");
  52.             }
  53.             if(listitem == 1)
  54.             {
  55.                 ShowPlayerDialog(dialogid, DIALOG_PISTOLAS, DIALOG_STYLE_LIST, "Pistolas", "9mm sem silenciador/t$1.500,00/n9mm com silenciador/t$2.000,00/nDesert Eagle/t$3.500,00", "Comprar", "Voltar");
  56.             }
  57.             if(listitem == 2)
  58.             {
  59.                 ShowPlayerDialog(dialogid, DIALOG_ESCOPETAS, DIALOG_STYLE_LIST, "Escopetas", "Escopeta calibre 12/t$5.000,00/nCombat Shotgun/t$4.000,00/nEscopeta de cano cerrado/t$4.500,00", "Comprar", "Voltar");
  60.             }
  61.             if(listitem == 3)
  62.             {
  63.                 ShowPlayerDialog(dialogid, DIALOG_SUB_METRALHADORAS, DIALOG_STYLE_LIST, "Sub-Metralhadoras", "TEC-9/t$3.500,00/nMP-5/t$4.500,00/nMicro SMG/Uzi/t$3.500,00", "Comprar", "Voltar");
  64.             }
  65.             if(listitem == 4)
  66.             {
  67.                 ShowPlayerDialog(dialogid, DIALOG_RIFLES_DE_ALTO_CALIBRE, DIALOG_STYLE_LIST, "Rifles de alto-calibre", "AK-47/t$7.000,00/nM4A1/t$6.500,00/n", "Comprar", "Voltar");
  68.             }
  69.             if(listitem == 5)
  70.             {
  71.                 ShowPlayerDialog(dialogid, DIALOG_SNIPER, DIALOG_STYLE_LIST, "Sniper", "Sniper Rifle/t$6.000,00/nCountry Rifle/t$6.500,00/n", "Comprar", "Voltar");
  72.             }
  73.             if(listitem == 6)
  74.             {
  75.                 ShowPlayerDialog(dialogid, DIALOG_BOMBAS, DIALOG_STYLE_LIST, "Bombas", "Granada/t$1.000,00/nBomba de lacrimogêneo/t$750,00/nMolotov Cocktail/t$1.500,00", "Comprar", "Voltar");
  76.             }
  77.             if(listitem == 7)
  78.             {
  79.                 ShowPlayerDialog(dialogid, DIALOG_UTILITARIOS, DIALOG_STYLE_LIST, "Utilitários", "Spray/t$150,00/nCamêra/t$100,00/nPara-quedas/t$200,00/nThermal Goggles/t$200,00/nNight Vis Goggles/t$200,00/n", "Comprar", "Voltar");
  80.             }
  81.         }
  82.         return 1;
  83.     }
  84.    
  85.     if(dialogid == DIALOG_ARMAS_BRANCAS)
  86.     {
  87.         if(response)
  88.         {
  89.             if(listitem == 0)
  90.             {
  91.                 if(GetPlayerMoney(playerid) < 100) return SendClientMessage(playerid, COR_VERMELHOESCURO, "[ERRO]: Você não possuí dinheiro suficiente para efetuar a compra.");
  92.                 GivePlayerWeapon(playerid, 1, 1);
  93.                 GivePlayerMoney(playerid, -100); return SendClientMessage(playerid, COR_VERDEESCURO, "[PARABÉNS]: Você acaba de comprar um soco inglês!");
  94.             }
  95.             if(listitem == 1)
  96.             {
  97.                 if(GetPlayerMoney(playerid) < 50) return SendClientMessage(playerid, COR_VERMELHOESCURO, "[ERRO]: Você não possuí dinheiro suficiente para efetuar a compra.");
  98.                 GivePlayerWeapon(playerid, 4, 1);
  99.                 GivePlayerMoney(playerid, -50); return SendClientMessage(playerid, COR_VERDEESCURO, "[PARABÉNS]: Você acaba de comprar uma faca!");
  100.             }
  101.             if(listitem == 1)
  102.             {
  103.             if(GetPlayerMoney(playerid) < 75) return SendClientMessage(playerid, COR_VERMELHOESCURO, "[ERRO]: Você não possuí dinheiro suficiente para efetuar a compra.");
  104.             GivePlayerWeapon(playerid, 5, 1);
  105.             GivePlayerMoney(playerid, -75); return SendClientMessage(playerid, COR_VERDEESCURO, "[PARABÉNS]: Você acaba de comprar um taco de baseball!");
  106.             }
  107.             if(listitem == 4)
  108.             {
  109.                 ShowPlayerDialog(playerid, DIALOG_MENU_DE_ARMAS, DIALOG_STYLE_LIST, "Menu de armas", "Armas branca/nPistolas/nEscopetas/nSub-Metralhadoras/nRifles de alto-calibre/nSnipers/nBombas/nUtilitários", "Abrir", "Sair");
  110.             }
  111.         }
  112.         return 1;
  113.     }
  114.    
  115.     if(dialogid == DIALOG_PISTOLAS)
  116.     {
  117.         if(response)
  118.         {
  119.             if(listitem == 0)
  120.             {
  121.                 if(GetPlayerMoney(playerid) < 1500) return SendClientMessage(playerid, COR_VERMELHOESCURO, "[ERRO]: Você não possui dinheiro suficiente para efetuar a compra.");
  122.                 GivePlayerWeapon(playerid, 22, 100);
  123.                 GivePlayerMoney(playerid, -1500); return SendClientMessage(playerid, COR_VERDEESCURO, "[PARABÉNS]: Você acaba de comprar uma 9mm sem silenciador!");
  124.             }
  125.             if(listitem == 1)
  126.             {
  127.                 if(GetPlayerMoney(playerid) < 2000) return SendClientMessage(playerid, COR_VERMELHOESCURO, "[ERRO]: Você não possui dinheiro suficiente para efetuar a compra.");
  128.                 GivePlayerWeapon(playerid, 23, 100);
  129.                 GivePlayerMoney(playerid, -2000); return SendClientMessage(playerid, COR_VERDEESCURO, "[PARABÉNS]: Você acaba de comprar uma 9mm com silenciador!");
  130.             }
  131.             if(listitem == 2)
  132.             {
  133.                 if(GetPlayerMoney(playerid) < 3500) return SendClientMessage(playerid, COR_VERMELHOESCURO, "[ERRO]: Você não possui dinheiro suficiente para efetuar a compra.");
  134.                 GivePlayerWeapon(playerid, 24, 77);
  135.                 GivePlayerMoney(playerid, -3500); return SendClientMessage(playerid, COR_VERDEESCURO, "[PARABÉNS]: Você acaba de comprar uma Desert Eagle!");
  136.             }
  137.             if(listitem == 4)
  138.             {
  139.                 ShowPlayerDialog(playerid, DIALOG_MENU_DE_ARMAS, DIALOG_STYLE_LIST, "Menu de armas", "Armas branca/nPistolas/nEscopetas/nSub-Metralhadoras/nRifles de alto-calibre/nSnipers/nBombas/nUtilitários", "Abrir", "Sair");
  140.             }
  141.         }
  142.         return 1;
  143.     }
  144.    
  145.     if(dialogid == DIALOG_ESCOPETAS)
  146.     {
  147.         if(response)
  148.         {
  149.             if(listitem == 0)
  150.             {
  151.                 if(GetPlayerMoney(playerid) < 5000) return SendClientMessage(playerid, COR_VERMELHOESCURO, "[ERRO]: Você não possui dinheiro suficiente para efetuar a compra.");
  152.                 GivePlayerWeapon(playerid, 25, 110);
  153.                 GivePlayerMoney(playerid, -5000); return SendClientMessage(playerid, COR_VERDEESCURO, "[PARABÉNS]: Você acaba de comprar uma Escopeta calibre .12!");
  154.             }
  155.             if(listitem == 1)
  156.             {
  157.                 if(GetPlayerMoney(playerid) < 4000) return SendClientMessage(playerid, COR_VERMELHOESCURO, "[ERRO]: Você não possui dinheiro suficiente para efetuar a compra.");
  158.                 GivePlayerWeapon(playerid, 27, 110);
  159.                 GivePlayerMoney(playerid, -4000); return SendClientMessage(playerid, COR_VERMELHOESCURO, "[PARABÉNS]: Você acaba de comprar uma Combat Shotgun!");
  160.             }
  161.             if(listitem == 2)
  162.             {
  163.                 if(GetPlayerMoney(playerid) < 4500) return SendClientMessage(playerid, COR_VERMELHOESCURO, "[ERRO]: Você não possui dinheiro suficiente para efetuar a compra.");
  164.                 GivePlayerWeapon(playerid, 26, 44);
  165.                 GivePlayerMoney(playerid, -4500); return SendClientMessage(playerid, COR_VERDEESCURO, "[PARABÉNS]: Você acaba de comprar uma Escopeta de cano serrado!");
  166.             }
  167.             if(listitem == 4)
  168.             {
  169.                 ShowPlayerDialog(playerid, DIALOG_MENU_DE_ARMAS, DIALOG_STYLE_LIST, "Menu de armas", "Armas branca/nPistolas/nEscopetas/nSub-Metralhadoras/nRifles de alto-calibre/nSnipers/nBombas/nUtilitários", "Abrir", "Sair");
  170.             }
  171.         }
  172.         return 1;
  173.     }
  174.    
  175.     if(dialogid == DIALOG_SUB_METRALHADORAS)
  176.     {
  177.         if(response)
  178.         {
  179.             if(listitem == 0)
  180.             {
  181.                 if(GetPlayerMoney(playerid) < 3500) return SendClientMessage(playerid, COR_VERMELHOESCURO, "[ERRO]: Você não possui dinheiro suficiente para efetuar a compra.");
  182.                 GivePlayerWeapon(playerid, 32, 550);
  183.                 GivePlayerMoney(playerid, -3500); return SendClientMessage(playerid, COR_VERDEESCURO, "[PARABÉNS]: Você acaba de comprar uma TEC-9!");
  184.             }
  185.             if(listitem == 1)
  186.             {
  187.                 if(GetPlayerMoney(playerid) < 4500) return SendClientMessage(playerid, COR_VERMELHOESCURO, "[ERRO]: Você não possui dinheiro suficiente para efetuar a compra.");
  188.                 GivePlayerWeapon(playerid, 29, 330);
  189.                 GivePlayerMoney(playerid, -4500); return SendClientMessage(playerid, COR_VERDEESCURO, "[PARABÉNS]: Você acaba de comprar uma MP-5!");
  190.             }
  191.             if(listitem == 2)
  192.             {
  193.                 if(GetPlayerMoney(playerid) < 3500) return SendClientMessage(playerid, COR_VERMELHOESCURO, "[ERRO]: Você não possui dinheiro suficiente para efetuar a compra.");
  194.                 GivePlayerWeapon(playerid, 28, 550);
  195.                 GivePlayerMoney(playerid, -3500); return SendClientMessage(playerid, COR_VERDEESCURO, "[PARABÉNS]: Você acaba de comprar uma Micro SMG/Uzi");
  196.             }
  197.             if(listitem == 3)
  198.             {
  199.                 ShowPlayerDialog(playerid, DIALOG_MENU_DE_ARMAS, DIALOG_STYLE_LIST, "Menu de armas", "Armas branca/nPistolas/nEscopetas/nSub-Metralhadoras/nRifles de alto-calibre/nSnipers/nBombas/nUtilitários", "Abrir", "Sair");
  200.             }
  201.         }
  202.         return 1;
  203.     }
  204.    
  205.     if(dialogid == DIALOG_RIFLES_DE_ALTO_CALIBRE)
  206.     {
  207.         if (response)
  208.         {
  209.             if (listitem == 0)
  210.             {
  211.                 if(GetPlayerMoney(playerid) < 7000) return SendClientMessage(playerid, COR_VERMELHOESCURO, "[ERRO]: Você não possui dinheiro suficiente para efetuar a compra.");
  212.                 GivePlayerWeapon(playerid, 30, 330);
  213.                 GivePlayerMoney(playerid, -7000); return SendClientMessage(playerid, COR_VERDEESCURO, "[PARABÉNS]: Você acaba de comprar uma AK-47");
  214.             }
  215.             if(listitem == 1)
  216.             {
  217.                 if(GetPlayerMoney(playerid) < 6500) return SendClientMessage(playerid, COR_VERMELHOESCURO, "[ERRO]: Você não possui dinheiro suficiente para efetuar a compra.");
  218.                 GivePlayerWeapon(playerid, 31, 550);
  219.                 GivePlayerMoney(playerid, -6500); return SendClientMessage(playerid, COR_VERDEESCURO, "[PARABÉNS]: Você acaba de comprar uma M4A1");
  220.             }
  221.             if(listitem == 2)
  222.             {
  223.                 ShowPlayerDialog(playerid, DIALOG_MENU_DE_ARMAS, DIALOG_STYLE_LIST, "Menu de armas", "Armas branca/nPistolas/nEscopetas/nSub-Metralhadoras/nRifles de alto-calibre/nSnipers/nBombas/nUtilitários", "Abrir", "Sair");
  224.             }
  225.         }
  226.         return 1;
  227.     }
  228.    
  229.     if(dialogid == DIALOG_SNIPER)
  230.     {
  231.         if(response)
  232.         {
  233.             if(listitem == 0)
  234.             {
  235.                 if(GetPlayerMoney(playerid) < 6000) return SendClientMessage(playerid, COR_VERMELHOESCURO, "[ERRO]: Você não possui dinheiro suficiente para efetuar a compra.");
  236.                 GivePlayerWeapon(playerid, 34, 100);
  237.                 GivePlayerMoney(playerid, -6000); return SendClientMessage(playerid, COR_VERDEESCURO, "[PARABÉNS]: Você acaba de comprar um Rifle Sniper!");
  238.             }
  239.             if(listitem == 1)
  240.             {
  241.                 if(GetPlayerMoney(playerid) < 6500) return SendClientMessage(playerid, COR_VERMELHOESCURO, "[ERRO]: Você não possui dinheiro suficiente para efetuar a compra.");
  242.                 GivePlayerWeapon(playerid, 33, 550);
  243.                 GivePlayerMoney(playerid, -6500); return SendClientMessage(playerid, COR_VERDEESCURO, "[PARABÉNS]: Você acaba de comprar um Rifle de caça!");
  244.             }
  245.             if(listitem == 2)
  246.             {
  247.                 ShowPlayerDialog(playerid, DIALOG_MENU_DE_ARMAS, DIALOG_STYLE_LIST, "Menu de armas", "Armas branca/nPistolas/nEscopetas/nSub-Metralhadoras/nRifles de alto-calibre/nSnipers/nBombas/nUtilitários", "Abrir", "Sair");
  248.             }
  249.         }
  250.         return 1;
  251.     }
  252.    
  253.     if(dialogid == DIALOG_BOMBAS)
  254.     {
  255.         if(response)
  256.         {
  257.             if(listitem == 0)
  258.             {
  259.                 if(GetPlayerMoney(playerid) < 1000) return SendClientMessage(playerid, COR_VERMELHOESCURO, "[ERRO]: Você não possui dinheiro suficiente para efetuar a compra.");
  260.                 GivePlayerWeapon(playerid, 16, 10);
  261.                 GivePlayerMoney(playerid, -1000); return SendClientMessage(playerid, COR_VERDEESCURO, "[PARABÉNS]: Você acaba de comprar uma Granada!");
  262.             }
  263.             if(listitem == 1)
  264.             {
  265.                 if(GetPlayerMoney(playerid) < 750) return SendClientMessage(playerid, COR_VERMELHOESCURO, "[ERRO]: Você não possui dinheiro suficiente para efetuar a compra.");
  266.                 GivePlayerWeapon(playerid, 17, 10);
  267.                 GivePlayerMoney(playerid, -750); return SendClientMessage(playerid, COR_VERDEESCURO, "[PARABÉNS]: Você acaba de comprar uma bomba de lacrimogêneo!");
  268.             }
  269.             if(listitem == 2)
  270.             {
  271.                 if(GetPlayerMoney(playerid) < 1500) return SendClientMessage(playerid, COR_VERMELHOESCURO, "[ERRO]: Você não possui dinheiro suficiente para efetuar a compra.");
  272.                 GivePlayerWeapon(playerid, 18, 10);
  273.                 GivePlayerMoney(playerid, -1500); return SendClientMessage(playerid, COR_VERDEESCURO, "[PARABÉNS]: Você acaba de comprar um Molotov Cocktail!");
  274.             }
  275.             if(listitem == 3)
  276.             {
  277.                 ShowPlayerDialog(playerid, DIALOG_MENU_DE_ARMAS, DIALOG_STYLE_LIST, "Menu de armas", "Armas branca/nPistolas/nEscopetas/nSub-Metralhadoras/nRifles de alto-calibre/nSnipers/nBombas/nUtilitários", "Abrir", "Sair");
  278.             }
  279.         }
  280.         return 1;
  281.     }
  282.    
  283.     if(dialogid == DIALOG_UTILITARIOS)
  284.     {
  285.         if(response)
  286.         {
  287.             if(listitem == 0)
  288.             {
  289.                 if(GetPlayerMoney(playerid) < 150) return SendClientMessage(playerid, COR_VERMELHOESCURO, "[ERRO]: Você não possui dinheiro suficiente para efetuar a compra.");
  290.                 GivePlayerWeapon(playerid, 41, 500);
  291.                 GivePlayerMoney(playerid, -150); return SendClientMessage(playerid, COR_VERDEESCURO, "[PARABÉNS]: Você acaba de comprar um Spray!");
  292.             }
  293.             if(listitem == 1)
  294.             {
  295.                 if(GetPlayerMoney(playerid) < 100) return SendClientMessage(playerid, COR_VERMELHOESCURO, "[ERRO]: Você não possui dinheiro suficiente para efetuar a compra.");
  296.                 GivePlayerWeapon(playerid, 43, 100);
  297.                 GivePlayerMoney(playerid, -100); return SendClientMessage(playerid, COR_VERDEESCURO, "[PARABÉNS]: Você acaba de comprar uma Camêra!");
  298.             }
  299.             if(listitem == 2)
  300.             {
  301.                 if(GetPlayerMoney(playerid) < 200) return SendClientMessage(playerid, COR_VERMELHOESCURO, "[ERRO]: Você não possui dinheiro suficiente para efetuar a compra.");
  302.                 GivePlayerWeapon(playerid, 46, 1);
  303.                 GivePlayerMoney(playerid, -200); return SendClientMessage(playerid, COR_VERDEESCURO, "[PARABÉNS]: Você acaba de comprar um Para-querdas!");
  304.             }
  305.             if(listitem == 3)
  306.             {
  307.                 if(GetPlayerMoney(playerid) < 200) return SendClientMessage(playerid, COR_VERMELHOESCURO, "[ERRO]: Você não possui dinheiro suficiente para efetuar a compra.");
  308.                 GivePlayerWeapon(playerid, 45, 1);
  309.                 GivePlayerMoney(playerid, -200); return SendClientMessage(playerid, COR_VERDEESCURO, "[PARABÉNS]: Você acaba de comprar um Thermal Goggles!");
  310.             }
  311.             if(listitem == 4)
  312.             {
  313.                 if(GetPlayerMoney(playerid) < 200) return SendClientMessage(playerid, COR_VERMELHOESCURO, "[ERRO]: Você não possui dinheiro suficiente para efetuar a compra.");
  314.                 GivePlayerWeapon(playerid, 44, 1);
  315.                 GivePlayerMoney(playerid, -200); return SendClientMessage(playerid, COR_VERDEESCURO, "[PARABÉNS]: Você acaba de comprar um Night Vis Goggles!");
  316.             }
  317.             if(listitem == 5)
  318.             {
  319.                 ShowPlayerDialog(playerid, DIALOG_MENU_DE_ARMAS, DIALOG_STYLE_LIST, "Menu de armas", "Armas branca/nPistolas/nEscopetas/nSub-Metralhadoras/nRifles de alto-calibre/nSnipers/nBombas/nUtilitários", "Abrir", "Sair");
  320.             }
  321.         }
  322.     }
  323.     return 1;
  324. }
  325.  
  326. //comandos
  327. COMMAND:entrar(playerid, params[])
  328. {
  329.     if(IsPlayerInRangeOfPoint(playerid, 1.0, 1368.3351,-1279.8118,13.5469))
  330.     {
  331.         SetPlayerInterior(playerid, 1);
  332.         SetPlayerPos(playerid, 285.4391,-41.4983,1001.5156);
  333.     }
  334.     return 1;
  335. }
  336.  
  337. COMMAND:sair(playerid, params[])
  338. {
  339.     if(IsPlayerInRangeOfPoint(playerid, 1.0, 285.4391,-41.4983,1001.5156))
  340.     {
  341.         SetPlayerInterior(playerid, 0);
  342.         SetPlayerPos(playerid, 1368.3351,-1279.8118,13.5469);
  343.     }
  344.     return 1;
  345. }
  346.  
  347. COMMAND:comprararma(playerid, params[])
  348. {
  349.     if(IsPlayerInRangeOfPoint(playerid, 1.0, 295.8998,-38.5147,1001.5156))
  350.     {
  351.         ShowPlayerDialog(playerid, DIALOG_MENU_DE_ARMAS, DIALOG_STYLE_LIST, "Menu de armas", "Armas branca/nPistolas/nEscopetas/nSub-Metralhadoras/nRifles de alto-calibre/nSnipers/nBombas/nUtilitários", "Abrir", "Sair");
  352.     }
  353.     return 1;
  354. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement