Guest User

[FS] Farmacias em LS - Por: HeyHoLetsGo

a guest
Dec 19th, 2012
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 10.09 KB | None | 0 0
  1. //=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  2. //FS de Farmacias em LS Criado por HeyHoLetsGo (Felipe_Chierice)|
  3. //Esse foi meu primeiro FilterScript, espero que gostem ! ^_^'  |
  4. //Se for usar em seu Server, favor manter os creditos !         |
  5. //Se encontrar algum Bug, relatem pra min no Forum SA-MP! Vlws! |
  6. //=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  7.  
  8. #include <a_samp>
  9.  
  10. #define COR_AMARELO         0xFFFF00AA
  11. #define COR_VERMELHO        0xFF0000FF
  12. #define COR_VERDE           0xB6FC69FF
  13. #define COR_3DLABEL         0xF68E00F6
  14. #define farmacia            999
  15. #define creditosfarmacia    998
  16. #define                     FILTERSCRIPT
  17.  
  18. new BandAID[MAX_PLAYERS];
  19. new Remedio[MAX_PLAYERS];
  20. new KitMedico[MAX_PLAYERS];
  21. new Float:playerExPos[MAX_PLAYERS][3];
  22. new Float:health[MAX_PLAYERS];
  23.  
  24. #if defined FILTERSCRIPT
  25.  
  26. public OnFilterScriptInit()
  27. {
  28.     print("\n--------------------------------------");
  29.     print(" Kit Medico BY: HeyHoLetsGo - LIGADO! v1.0");
  30.     print("--------------------------------------\n");
  31.  
  32.     //=-=-=-=-=-=-=-=-=-=[PICKUPS]=-=-=-=-=-=-=-=-=-=
  33.     AddStaticPickup(1241,23,-25.132598,-139.066986,1003.546875); // Saida Farmacia
  34.     AddStaticPickup(1274,23,-21.0467,-138.6313,1003.5469); // Pickup Compra Farmacia
  35.     AddStaticPickup(1241,23,1172.5511,-1323.6270,15.4036); // Entrada Farmacia 1
  36.     AddStaticPickup(1241,23,1325.9927,-1741.3862,13.5469); // Entrada Farmacia 2
  37.     AddStaticPickup(1241,23,2467.0535,-1743.6769,13.5469); // Entrada Farmacia 3
  38.     AddStaticPickup(1241,23,2048.3816,-1091.4099,24.5985); // Entrada Farmacia 4
  39.     AddStaticPickup(1241,23,1641.4440,-1171.5991,24.0781); // Entrada Farmacia 5
  40.     AddStaticPickup(1241,23,1445.2292,-1303.5032,13.5469); // Entrada Farmacia 6
  41.     AddStaticPickup(1241,23,1366.6169,-1383.2607,13.6742); // Entrada Farmacia 7
  42.     AddStaticPickup(1241,23,1057.2535,-1131.3278,23.8281); // Entrada Farmacia 8
  43.     AddStaticPickup(1241,23,370.3190,-1601.5806,31.6027); // Entrada Farmacia 9
  44.     AddStaticPickup(1241,23,2070.6038,-1785.2797,13.5595); // Entrada Farmacia 10
  45.     //=-=-=-=-=-=-=-=-=-=[3DTEXTS]=-=-=-=-=-=-=-=-=-=
  46.     Create3DTextLabel("Farmacia\nF para sair", COR_3DLABEL, -25.132598,-139.066986,1003.546875, 7, 0); // Texto Saida
  47.     Create3DTextLabel("Farmacia\nUse /farmacia", COR_3DLABEL, -21.0467,-138.6313,1003.5469, 7, 0); // Pickup  Compra
  48.     Create3DTextLabel("Farmacia\nF para entrar", COR_3DLABEL, 1172.5511,-1323.6270,15.4036, 7, 0); // Texto Entrada 1
  49.     Create3DTextLabel("Farmacia\nF para entrar", COR_3DLABEL, 1325.9927,-1741.3862,13.5469, 7, 0); // Texto Entrada 2
  50.     Create3DTextLabel("Farmacia\nF para entrar", COR_3DLABEL, 2467.0535,-1743.6769,13.5469, 7, 0); // Texto Entrada 3
  51.     Create3DTextLabel("Farmacia\nF para entrar", COR_3DLABEL, 2048.3816,-1091.4099,24.5985, 7, 0); // Texto Entrada 4
  52.     Create3DTextLabel("Farmacia\nF para entrar", COR_3DLABEL, 1641.4440,-1171.5991,24.0781, 7, 0); // Texto Entrada 5
  53.     Create3DTextLabel("Farmacia\nF para entrar", COR_3DLABEL, 1445.2292,-1303.5032,13.5469, 7, 0); // Texto Entrada 6
  54.     Create3DTextLabel("Farmacia\nF para entrar", COR_3DLABEL, 1366.6169,-1383.2607,13.6742, 7, 0); // Texto Entrada 7
  55.     Create3DTextLabel("Farmacia\nF para entrar", COR_3DLABEL, 1057.2535,-1131.3278,23.8281, 7, 0); // Texto Entrada 8
  56.     Create3DTextLabel("Farmacia\nF para entrar", COR_3DLABEL, 370.3190,-1601.5806,31.6027, 7, 0); // Texto Entrada 9
  57.     Create3DTextLabel("Farmacia\nF para entrar", COR_3DLABEL, 2070.6038,-1785.2797,13.5595, 7, 0); // Texto Entrada 10
  58.     return 1;
  59. }
  60.  
  61. public OnPlayerCommandText(playerid, cmdtext[])
  62. {
  63.     if(strcmp(cmdtext, "/farmacia", true) == 0)
  64.     {
  65.         if(IsPlayerInRangeOfPoint(playerid,1.0,-21.0467,-138.6313,1003.5469))
  66.         {
  67.             ShowPlayerDialog(playerid,farmacia,DIALOG_STYLE_LIST,"{FF0000}Farmacia LS - SELECIONE UM MEDICAMENTO", "{FFFFFF}Band-AID | {FFFF00}(20 Saúde) {FFFFFF}| {FFFFFF}Maximo Porte: 5 {B6FC69}- R$20\n{FFFFFF}Remédio | {FFFF00}(50 Saúde) {FFFFFF}| {FFFFFF}Maximo Porte: 2 {B6FC69}- R$50\n{FFFFFF}Kit Médico | {FFFF00}(100 Saúde) {FFFFFF}| {FFFFFF}Maximo Porte: 1 {B6FC69}- R$100\n \n \n \n \n \n \n \n \n{FFFF00}CRÉDITOS Por: {FFFFFF}HeyHoLetsGo", "Comprar", "Sair");
  68.         }
  69.     }
  70.     if(strcmp(cmdtext, "/meusmedicamentos", true) == 0)
  71.     {
  72.         new Fstring[150];
  73.         format(Fstring, 150, "{FF0000}MEDICAMENTOS{FFFFFF} - | Band-AID: {FFFF00}%d/5{FFFFFF} | Remedio: {FFFF00}%d/2{FFFFFF} | Kit Médico: {FFFF00}%d/1 {FFFFFF}|",BandAID,Remedio,KitMedico);
  74.         SendClientMessage(playerid, -1, Fstring);
  75.     }
  76.     if(strcmp(cmdtext, "/entrandofarmacia", true) == 0)
  77.     {
  78.         if(IsPlayerInRangeOfPoint(playerid,2.0,1172.5511,-1323.6270,15.4036) || IsPlayerInRangeOfPoint(playerid,2.0,1325.9927,-1741.3862,13.5469) || IsPlayerInRangeOfPoint(playerid,2.0,2467.0535,-1743.6769,13.5469) || IsPlayerInRangeOfPoint(playerid,2.0,2048.3816,-1091.4099,24.5985) || IsPlayerInRangeOfPoint(playerid,2.0,1641.4440,
  79.         -1171.5991,24.0781) || IsPlayerInRangeOfPoint(playerid,2.0,1445.2292,-1303.5032,13.5469) || IsPlayerInRangeOfPoint(playerid,2.0,1366.6169,-1383.2607,13.6742) || IsPlayerInRangeOfPoint(playerid,2.0,1057.2535,-1131.3278,23.8281) || IsPlayerInRangeOfPoint(playerid,2.0,370.3190,-1601.5806,31.6027) || IsPlayerInRangeOfPoint(playerid,2.0,2070.6038,-1785.2797,13.5595))
  80.         {
  81.             GetPlayerPos(playerid, playerExPos[playerid][0], playerExPos[playerid][1], playerExPos[playerid][2]);
  82.             SetPlayerInterior(playerid, 16);
  83.             SetPlayerPos(playerid,-25.132598,-139.066986,1003.546875);
  84.         }
  85.     }
  86.     if(strcmp(cmdtext, "/saindofarmacia", true) == 0)
  87.     {
  88.         if(IsPlayerInRangeOfPoint(playerid,1.0,-25.132598,-139.066986,1003.546875))
  89.         {
  90.             SetPlayerInterior(playerid, 0);
  91.             SetPlayerPos(playerid, playerExPos[playerid][0], playerExPos[playerid][1], playerExPos[playerid][2]);
  92.         }
  93.     }
  94.     if(strcmp(cmdtext, "/usarbandaid", true) == 0)
  95.     {
  96.         if(BandAID[playerid] == 0)
  97.         {
  98.             SendClientMessage(playerid,COR_VERMELHO,"[ ! ] Você não tem um Band-AID, compre um nem alguma farmacia!");
  99.         }
  100.         else
  101.         {
  102.             SendClientMessage(playerid,COR_VERDE,"[ ! ] Você usou um Band-AID e recuperou 20 de saúde!");
  103.             GetPlayerHealth(playerid, health[playerid]);
  104.             SetPlayerHealth(playerid, health[playerid]+20);
  105.             PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
  106.             BandAID[playerid] -= 1;
  107.         }
  108.     }
  109.     if(strcmp(cmdtext, "/usarremedio", true) == 0)
  110.     {
  111.         if(Remedio[playerid] == 0)
  112.         {
  113.             SendClientMessage(playerid,COR_VERMELHO,"[ ! ] Você não tem um Remédio, compre um em alguma farmacia!");
  114.         }
  115.         else
  116.         {
  117.             SendClientMessage(playerid,COR_VERDE,"[ ! ] Você usou um Remédio e recuperou 50 de saúde!");
  118.             GetPlayerHealth(playerid,health[playerid]);
  119.             SetPlayerHealth(playerid,health[playerid]+50);
  120.             PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
  121.             Remedio[playerid] -= 1;
  122.         }
  123.     }
  124.     if(strcmp(cmdtext, "/usarkitmedico", true) == 0)
  125.     {
  126.         if(KitMedico[playerid] == 0)
  127.         {
  128.             SendClientMessage(playerid,COR_VERMELHO,"[ ! ] Você não tem um Remédio, compre um em alguma farmacia!");
  129.         }
  130.         else
  131.         {
  132.             SendClientMessage(playerid,COR_VERDE,"[ ! ] Você usou um Kit Médico e recuperou 100 de saúde!");
  133.             GetPlayerHealth(playerid,health[playerid]);
  134.             SetPlayerHealth(playerid,health[playerid]+100);
  135.             PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
  136.             KitMedico[playerid] -= 1;
  137.         }
  138.     }
  139.     return 1;
  140. }
  141. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  142. {
  143.     if(dialogid == farmacia)
  144.     {
  145.         if(response)
  146.         {
  147.             if(listitem == 0)
  148.             {
  149.                 if(BandAID[playerid] == 5)
  150.                 {
  151.                     SendClientMessage(playerid,COR_VERMELHO,"[ ! ] Você já tem o máximo de Band-AID! (5/5) - Use: /usarbandaid");
  152.                 }
  153.                 if(BandAID[playerid] < 5)
  154.                 {
  155.                     if(GetPlayerMoney(playerid) >= 20)
  156.                     {
  157.                         SendClientMessage(playerid,COR_AMARELO,"[ ! ] Você comprou um Band-AID! Use: /usarbandaid");
  158.                         GivePlayerMoney(playerid, -20);
  159.                         PlayerPlaySound(playerid,1054,0.0,0.0,0.0);
  160.                         BandAID[playerid] += 1;
  161.                     }
  162.                     else
  163.                     {
  164.                         SendClientMessage(playerid,COR_VERMELHO,"[ ! ] Você não tem dinheiro o suficiente para comprar o Band-AID!");
  165.                     }
  166.                 }
  167.             }
  168.             if(listitem == 1)
  169.             {
  170.                 if(Remedio[playerid] == 2)
  171.                 {
  172.                     SendClientMessage(playerid,COR_VERMELHO,"[ ! ] Você já tem o máximo de Remédio! (2/2) - Use: /usarremedio");
  173.                 }
  174.                 if(Remedio[playerid] < 2)
  175.                 {
  176.                     if(GetPlayerMoney(playerid) >= 50)
  177.                     {
  178.                         SendClientMessage(playerid,COR_AMARELO,"[ ! ] Você comprou um Remédio! Use: /usarremedio");
  179.                         GivePlayerMoney(playerid,-50);
  180.                         PlayerPlaySound(playerid,1054,0.0,0.0,0.0);
  181.                         Remedio[playerid] += 1;
  182.                     }
  183.                     else
  184.                     {
  185.                         SendClientMessage(playerid,COR_VERMELHO,"[ ! ] Você não tem dinheiro o suficiente para comprar o Remédio!");
  186.                     }
  187.                 }
  188.             }
  189.             if(listitem == 2)
  190.             {
  191.                 if(KitMedico[playerid] == 1)
  192.                 {
  193.                     SendClientMessage(playerid,COR_VERMELHO,"[ ! ] Você já tem o máximo de Kit Médico! (1/1) - Use: /usarkitmedico");
  194.                 }
  195.                 if(KitMedico[playerid] < 1)
  196.                 {
  197.                     if(GetPlayerMoney(playerid) >= 100)
  198.                     {
  199.                         SendClientMessage(playerid,COR_AMARELO,"[ ! ] Você comprou um Remédio! Use: /usarkitmedico");
  200.                         GivePlayerMoney(playerid,-100);
  201.                         PlayerPlaySound(playerid,1054,0.0,0.0,0.0);
  202.                         KitMedico[playerid] += 1;
  203.                     }
  204.                     else
  205.                     {
  206.                         SendClientMessage(playerid,COR_VERMELHO,"[ ! ] Você não tem dinheiro o suficiente para comprar o Kit Médico!");
  207.                     }
  208.                 }
  209.             }
  210.             if(listitem == 11)
  211.             {
  212.                 ShowPlayerDialog(playerid,creditosfarmacia,DIALOG_STYLE_MSGBOX,"{FF0000}Farmacias LS {FFFFFF}- {FFFF00}CRÉDITOS","\n{FF0000}[FS] Farmacias de LS\n\n{B6FC69}Criado e Postado por:\n{FFFFFF}HeyHoLetsGo - http://forum.sa-mp.com","OK","Fechar");
  213.             }
  214.         }
  215.         else
  216.         {
  217.         }
  218.     }
  219.     return 1;
  220. }
  221. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  222. {
  223.     if ((newkeys==KEY_SECONDARY_ATTACK))
  224.     {
  225.         OnPlayerCommandText(playerid,"/entrandofarmacia");
  226.         OnPlayerCommandText(playerid,"/saindofarmacia");
  227.         OnPlayerCommandText(playerid,"/farmacia");
  228.     }
  229. }
  230.  
  231. #endif
Advertisement
Add Comment
Please, Sign In to add comment