Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*FilterScript Simples Criado Por Mim Mega_Style*/
- /*Esse FilterScript Adicona Alguns Mercados 24/7 Por Los Santos*/
- /*Tambem Adiciona Algumas Lojas de Armas*/
- /*Nos Mercados 24/7 Vende:*/
- /*Ferramentas(Com Elas é Possível Reparar Carros)*/
- /*Capacete(Com Ele é Possível Colocar/Tirar o Capacete)*/
- /*Hamburguer(Com Ele é Possível Recuperar 50 HP)*/
- /*Nas Lojas de Armas Vende:*/
- /*Desert Eagle(R$ 2000)*/
- /*Mp5(R$ 3000)*/
- /*Shotgun(R$ 3500)*/
- /*M4(R$ 4000)*/
- /*AK-47(R$ 4000)*/
- /*Sniper Rifle(R$ 5000)*/
- /*OBS: Não Adicionei mais armas porque muitos GameModes tem Anti-Weapon Hack Então Coloquei as Padrões*/
- /* INCLUDE */
- #include <a_samp>
- #include < zcmd >
- #include < dof2 >
- /* CORES */
- #define BRANCO 0xFFFFFFFF
- #define AMARELO 0xFFFF00AA
- #define CINZA 0xC0C0C0AA
- #define VERMELHO 0xFF0D0DAA
- /* DEFINES */
- #define Msg SendClientMessage
- #define PATH "Armas"
- /* DIALOGS */
- #define DIALOG_MERCADO 997
- #define DIALOG_ARMAS 998
- #define DIALOG_GPS 999
- /* VARIÁVEIS */
- enum mInfo
- {
- bool:pCapacete,
- bool:pFerramentas
- };
- static MercadoInfo[MAX_PLAYERS][mInfo];
- static Capacete[MAX_PLAYERS];
- static bool:ArmasEntregue[MAX_PLAYERS];
- static bool:GPSPos[MAX_PLAYERS];
- public OnFilterScriptInit()
- {
- DisableInteriorEnterExits();
- /* PICKUPS */
- AddStaticPickup(1318,23,1368.8413,-1279.8389,13.5469);// Entrada Ammu Nation (1)
- AddStaticPickup(1318,23,1257.3035,-1584.7076,13.5469);// Entrada Ammu Nation (2)
- AddStaticPickup(1318,23,1070.8396,-1868.4392,13.5469);// Entrada Ammu Nation (3)
- AddStaticPickup(1318,23,285.4731,-41.8047,1001.5156);// Saida Ammu Nation (1)
- AddStaticPickup(1318,23,285.8652,-86.7746,1001.5229);// Saida Ammu Nation (2)
- AddStaticPickup(1318,23,296.919983,-108.071999,1001.569946);// Saida Ammu Nation (3)
- AddStaticPickup(351,23,295.9408,-38.5125,1001.5156);// Menu Armas Ammu Nation (1)
- AddStaticPickup(351,23,295.5753,-80.8056,1001.5156);// Menu Armas Ammu Nation (2)
- AddStaticPickup(351,23,291.5666,-106.3043,1001.5156);// Menu Armas Ammu Nation (3)
- AddStaticPickup(1239,23,-28.0183,-89.9501,1003.5469);// Menu Mercado 24/7 (1)
- AddStaticPickup(1239,23,-23.2907,-55.6403,1003.5469);// Menu Mercado 24/7 (2)
- AddStaticPickup(1239,23,-22.0060,-138.6284,1003.5469);// Menu Mercado 24/7 (3)
- AddStaticPickup(1318,23,1352.3535,-1759.2533,13.5078); // Entrada Mercado 24/7 (1)
- AddStaticPickup(1318,23,1928.5914,-1776.3573,13.5469); // Entrada Mercado 24/7 (2)
- AddStaticPickup(1318,23,2424.2417,-1742.7839,13.5459); // Entrada Mercado 24/7 (3)
- AddStaticPickup(1318,23,-30.9630,-92.0112,1003.5469); // Saida Mercado 24/7 (1)
- AddStaticPickup(1318,23,-27.5302,-58.2646,1003.5469); // Saida Mercado 24/7 (2)
- AddStaticPickup(1318,23,-25.8544,-141.5577,1003.5469); // Saida Mercado 24/7 (3)
- /* 3D TEXTS */
- Create3DTextLabel("{FFFFFF}Loja de Armas\nAperte {00FFFF}'F' {FFFFFF}Para Entrar",BRANCO,1368.8413,-1279.8389,13.5469,15,0);// Entrada Ammu Nation (1)
- Create3DTextLabel("{FFFFFF}Loja de Armas\nAperte {00FFFF}'F' {FFFFFF}Para Entrar",BRANCO,1257.3035,-1584.7076,13.5469,15,0);// Entrada Ammu Nation (2)
- Create3DTextLabel("{FFFFFF}Loja de Armas\nAperte {00FFFF}'F' {FFFFFF}Para Entrar",BRANCO,1070.8396,-1868.4392,13.5469,15,0);// Entrada Ammu Nation (3)
- Create3DTextLabel("{FFFFFF}Loja de Armas\nAperte {00FFFF}'F' {FFFFFF}Para Sair",BRANCO,285.4731,-41.8047,1001.5156,15,0);// Saida Ammu Nation (1)
- Create3DTextLabel("{FFFFFF}Loja de Armas\nAperte {00FFFF}'F' {FFFFFF}Para Sair",BRANCO,285.8652,-86.7746,1001.5229,15,0);// Saida Ammu Nation (2)
- Create3DTextLabel("{FFFFFF}Loja de Armas\nAperte {00FFFF}'F' {FFFFFF}Para Sair",BRANCO,296.919983,-108.071999,1001.569946,15,0);// Saida Ammu Nation (3)
- 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)
- 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)
- 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)
- 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)
- 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)
- 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)
- 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)
- 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)
- 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)
- 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)
- 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)
- 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)
- return 1;
- }
- public OnFilterScriptExit()
- {
- DOF2_Exit();
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- ArmasEntregue[playerid] = false;
- CarregarLoja(playerid);
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- SalvarLoja(playerid);
- SaveWeaponsToFile(playerid);
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- if(ArmasEntregue[playerid] == false)SetTimerEx("LoadArmasToFile",250,false,"i",playerid);
- return 1;
- }
- public OnPlayerKeyStateChange(playerid,newkeys,oldkeys)
- {
- if(newkeys == 16 && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
- {
- cmd_entrarlojas(playerid);
- cmd_sairlojas(playerid);
- cmd_armas(playerid);
- cmd_mercado(playerid);
- }
- return 1;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- if(GPSPos[playerid] == true)
- {
- GameTextForPlayer(playerid, "~b~~h~Chegou Ao Seu Destino", 1000, 1);
- GPSPos[playerid] = false;
- DisablePlayerCheckpoint(playerid);
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == DIALOG_MERCADO)
- {
- if(response)
- {
- if(listitem == 0)
- {
- if(GetPlayerMoney(playerid) < 1000) return Msg(playerid,CINZA,"Você não possui R$ 1000 para comprar!");
- GivePlayerMoney(playerid, -1000);
- MercadoInfo[playerid][pFerramentas] = true;
- Msg(playerid, AMARELO ,"Agora você pode usar o comando /concertar para reparar seu veiculo.");
- }
- if(listitem == 1)
- {
- if(GetPlayerMoney(playerid) < 500) return Msg(playerid,CINZA,"Você não possui R$ 500 para comprar!");
- GivePlayerMoney(playerid, -500);
- MercadoInfo[playerid][pCapacete] = true;
- Msg(playerid, AMARELO ,"Agora você pode usar o comando /capacete e /tirarcapacete.");
- }
- if(listitem == 2)
- {
- if(GetPlayerMoney(playerid) < 100) return Msg(playerid,CINZA,"Você não possui R$ 100 para comprar!");
- GivePlayerMoney(playerid, -100);
- static Float:vida;
- GetPlayerHealth(playerid, vida);
- SetPlayerHealth(playerid, vida+50);
- Msg(playerid, AMARELO ,"Você comeu um Hamburguer e recuperou 50 HP.");
- }
- return 1;
- }
- }
- if(dialogid == DIALOG_ARMAS)
- {
- if(response)
- {
- if(listitem == 0)
- {
- if(GetPlayerMoney(playerid) < 1000) return Msg(playerid,CINZA,"Você não possui R$ 1000 para comprar!");
- GivePlayerMoney(playerid, -1000);
- GivePlayerWeapon(playerid, 24 , 300);
- Msg(playerid, AMARELO , "Você comprou uma Desert Eagle com 300 Balas.");
- }
- if(listitem == 1)
- {
- if(GetPlayerMoney(playerid) < 2000) return Msg(playerid,CINZA,"Você não possui R$ 2000 para comprar!");
- GivePlayerMoney(playerid, -2000);
- GivePlayerWeapon(playerid, 29 , 300);
- Msg(playerid, AMARELO , "Você comprou uma MP5 com 300 Balas.");
- }
- if(listitem == 2)
- {
- if(GetPlayerMoney(playerid) < 3000) return Msg(playerid,CINZA,"Você não possui R$ 3000 para comprar!");
- GivePlayerMoney(playerid, -3000);
- GivePlayerWeapon(playerid, 25 , 150);
- Msg(playerid, AMARELO , "Você comprou uma Shotgun com 150 Balas.");
- }
- if(listitem == 3)
- {
- if(GetPlayerMoney(playerid) < 4000) return Msg(playerid,CINZA,"Você não possui R$ 4000 para comprar!");
- GivePlayerMoney(playerid, -4000);
- GivePlayerWeapon(playerid, 31 , 500);
- Msg(playerid, AMARELO , "Você comprou uma M4 com 500 Balas.");
- }
- if(listitem == 4)
- {
- if(GetPlayerMoney(playerid) < 4000) return Msg(playerid,CINZA,"Você não possui R$ 4000 para comprar!");
- GivePlayerMoney(playerid, -4000);
- GivePlayerWeapon(playerid, 30 , 500);
- Msg(playerid, AMARELO , "Você comprou uma AK-47 com 500 Balas.");
- }
- if(listitem == 5)
- {
- if(GetPlayerMoney(playerid) < 5000) return Msg(playerid,CINZA,"Você não possui R$ 5000 para comprar!");
- GivePlayerMoney(playerid, -5000);
- GivePlayerWeapon(playerid, 34 , 50);
- Msg(playerid, AMARELO , "Você comprou uma Sniper Rifle com 50 Balas.");
- }
- return 1;
- }
- }
- if(dialogid == DIALOG_GPS)
- {
- if(response)
- {
- if(listitem == 0)
- {
- 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");
- }
- if(listitem == 1)
- {
- 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");
- }
- return 1;
- }
- }
- if(dialogid == DIALOG_GPS+1)
- {
- if(response)
- {
- if(listitem == 0)
- {
- SetPlayerCheckpoint(playerid,1363.2206,-1280.5405,13.5469,8.0);
- Msg(playerid,AMARELO,"Lugar Marcado no Mapa: Loja de Armas 1");
- GPSPos[playerid] = true;
- }
- if(listitem == 1)
- {
- SetPlayerCheckpoint(playerid,1067.0222,-1868.3098,13.5469,8.0);
- Msg(playerid,AMARELO,"Lugar Marcado no Mapa: Loja de Armas 2");
- GPSPos[playerid] = true;
- }
- if(listitem == 2)
- {
- SetPlayerCheckpoint(playerid,1256.9873,-1580.2556,13.5469,8.0);
- Msg(playerid,AMARELO,"Lugar Marcado no Mapa: Loja de Armas 3");
- GPSPos[playerid] = true;
- }
- return 1;
- }
- }
- if(dialogid == DIALOG_GPS+2)
- {
- if(response)
- {
- if(listitem == 0)
- {
- SetPlayerCheckpoint(playerid,1352.3535,-1759.2533,13.5078,8.0);
- Msg(playerid,AMARELO,"Lugar Marcado no Mapa: Mercado 24/7 1");
- GPSPos[playerid] = true;
- }
- if(listitem == 1)
- {
- SetPlayerCheckpoint(playerid,1928.5914,-1776.3573,13.5469,8.0);
- Msg(playerid,AMARELO,"Lugar Marcado no Mapa: Mercado 24/7 2");
- GPSPos[playerid] = true;
- }
- if(listitem == 2)
- {
- SetPlayerCheckpoint(playerid,2424.2417,-1742.7839,13.5459,8.0);
- Msg(playerid,AMARELO,"Lugar Marcado no Mapa: Mercado 24/7 3");
- GPSPos[playerid] = true;
- }
- return 1;
- }
- }
- return 1;
- }
- CMD:gps(playerid)
- {
- if(!IsPlayerConnected(playerid))return Msg(playerid, CINZA, "Você não está conectado!");
- ShowPlayerDialog(playerid, DIALOG_GPS ,DIALOG_STYLE_LIST,"GPS","{0000FF}L{FFFFFF}ojas de Armas\n{0000FF}M{FFFFFF}ercados 24/7", "Selecionar" , "Cancelar");
- return 1;
- }
- CMD:entrarlojas(playerid)
- {
- if(!IsPlayerConnected(playerid))return Msg(playerid, CINZA, "Você não está conectado!");
- if (PlayerToPoint(1.0, playerid,1368.8413,-1279.8389,13.5469))//Ammu Nation 1 - Entrada
- {
- SetPlayerInterior(playerid,1);
- SetPlayerVirtualWorld(playerid, 0);
- SetPlayerPos(playerid,286.148987,-40.644398,1001.569946);
- GameTextForPlayer(playerid, "~b~~h~Ammu Nation 1", 1000, 1);
- }
- if(PlayerToPoint(1.0, playerid,1257.3035,-1584.7076,13.5469))//Ammu Nation 2 - Entrada
- {
- SetPlayerInterior(playerid, 4);
- SetPlayerVirtualWorld(playerid, 0);
- SetPlayerPos(playerid, 286.800995,-82.547600,1001.539978);
- GameTextForPlayer(playerid, "~g~~h~Ammu Nation 2", 1000, 1);
- }
- if(PlayerToPoint(1.0, playerid,1070.8396,-1868.4392,13.5469))//Ammu Nation 3 - Entrada
- {
- SetPlayerInterior(playerid, 6);
- SetPlayerVirtualWorld(playerid, 0);
- SetPlayerPos(playerid, 296.919983,-108.071999,1001.569946);
- GameTextForPlayer(playerid, "~r~~h~Ammu Nation 3", 1000, 1);
- }
- if(PlayerToPoint(1.0, playerid,1352.3535,-1759.2533,13.5078))//Mercado 24/7 1 - Entrada
- {
- SetPlayerInterior(playerid, 18);
- SetPlayerVirtualWorld(playerid, 0);
- SetPlayerPos(playerid,-30.9467,-89.6096,1003.5469);
- GameTextForPlayer(playerid, "~p~~h~Mercado 24/7 1", 1000, 1);
- }
- if(PlayerToPoint(1.0, playerid,1928.5914,-1776.3573,13.5469))//Mercado 24/7 2 - Entrada
- {
- SetPlayerInterior(playerid, 6);
- SetPlayerVirtualWorld(playerid, 0);
- SetPlayerPos(playerid, -27.5302,-58.2646,1003.5469);
- GameTextForPlayer(playerid, "~y~~h~Mercado 24/7 2", 1000, 1);
- }
- if(PlayerToPoint(1.0, playerid,2424.2417,-1742.7839,13.5459))//Mercado 24/7 3 - Entrada
- {
- SetPlayerInterior(playerid, 16);
- SetPlayerVirtualWorld(playerid, 0);
- SetPlayerPos(playerid, -25.1326,-139.0670,1003.5469);
- GameTextForPlayer(playerid, "~w~Mercado 24/7 3", 1000, 1);
- }
- return 1;
- }
- CMD:sairlojas(playerid)
- {
- if(!IsPlayerConnected(playerid)) return Msg(playerid, CINZA, "Você não está conectado!");
- if (PlayerToPoint(1.0, playerid, 285.4731,-41.8047,1001.5156))// Ammu Nation 1 - Saida
- {
- SetPlayerInterior(playerid,0);
- SetPlayerPos(playerid,1368.8413,-1279.8389,13.5469);
- SetPlayerVirtualWorld(playerid, 0);
- }
- if (PlayerToPoint(1.0, playerid, 285.8652,-86.7746,1001.5229))// Ammu Nation 2 - Saida
- {
- SetPlayerInterior(playerid,0);
- SetPlayerPos(playerid, 1257.3035,-1584.7076,13.5469);
- SetPlayerVirtualWorld(playerid, 0);
- }
- if (PlayerToPoint(1.0, playerid, 296.919983,-108.071999,1001.569946))// Ammu Nation 3 - Saida
- {
- SetPlayerInterior(playerid,0);
- SetPlayerPos(playerid, 1070.8396,-1868.4392,13.5469);
- SetPlayerVirtualWorld(playerid, 0);
- }
- if (PlayerToPoint(1.0, playerid, -30.9630,-92.0112,1003.5469))// Mercado 24/7 1 - Saida
- {
- SetPlayerInterior(playerid,0);
- SetPlayerPos(playerid, 1352.3535,-1759.2533,13.5078);
- SetPlayerVirtualWorld(playerid, 0);
- }
- if (PlayerToPoint(1.0, playerid, -27.5302,-58.2646,1003.5469))// Mercado 24/7 2 - Saida
- {
- SetPlayerInterior(playerid,0);
- SetPlayerPos(playerid, 1928.5914,-1776.3573,13.5469);
- SetPlayerVirtualWorld(playerid, 1);
- }
- if (PlayerToPoint(1.0, playerid, -25.8544,-141.5577,1003.5469))// Mercado 24/7 3 - Saida
- {
- SetPlayerInterior(playerid,0);
- SetPlayerPos(playerid, 2424.2417,-1742.7839,13.5459);
- SetPlayerVirtualWorld(playerid, 0);
- }
- return 1;
- }
- CMD:mercado(playerid)
- {
- if(!IsPlayerConnected(playerid))return Msg(playerid, CINZA ,"Você não esta conectado.");
- if(PlayerToPoint(1.0, playerid, -28.0183,-89.9501,1003.5469) || PlayerToPoint(1.0, playerid, -23.2907,-55.6403,1003.5469))
- {
- 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");
- }
- return 1;
- }
- CMD:armas(playerid)
- {
- if(!IsPlayerConnected(playerid))return Msg(playerid, CINZA ,"Você não esta conectado.");
- 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))
- {
- 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");
- }
- return 1;
- }
- CMD:capacete(playerid)
- {
- if(!IsPlayerInAnyVehicle(playerid))return Msg(playerid, AMARELO ,"Você não está em um veiculo!");
- if(MercadoInfo[playerid][pCapacete] == true )
- {
- Capacete[playerid] = 1;
- SetPlayerAttachedObject(playerid,1,18645,2,0.07,0,0,88,75,0);
- Msg(playerid,AMARELO,"Você Colocou o Capacete Agora Você Pode Dirigir Com Segurança!");
- Msg(playerid,CINZA,"Para Tirar o Capacete Use: /tirarcapacete");
- }
- else
- {
- Msg(playerid,VERMELHO,"[AVISO] Você não possui um Capacete.");
- }
- return 1;
- }
- CMD:tirarcapacete(playerid)
- {
- if(Capacete[playerid] == 1)
- {
- Capacete[playerid] = 0;
- RemovePlayerAttachedObject(playerid, 1);
- }
- else
- {
- Msg(playerid, VERMELHO ,"[AVISO] Você já está sem Capacete!");
- }
- return 1;
- }
- CMD:concertar(playerid)
- {
- if(!IsPlayerInAnyVehicle(playerid))return Msg(playerid, AMARELO ,"Você não está em um veiculo!");
- if(MercadoInfo[playerid][pFerramentas] == true )
- {
- SetVehicleHealth(playerid, 100);
- Msg(playerid, AMARELO ,"Seu veiculo foi reparado com sucesso.");
- }
- else
- {
- Msg(playerid, VERMELHO ,"[AVISO] Você não possui Ferramentas.");
- }
- return 1;
- }
- /* STOCKS */
- stock RetornaMercado(playerid)
- {
- static File[156],Name[MAX_PLAYER_NAME];
- GetPlayerName(playerid,Name,sizeof(Name));
- format(File,sizeof(File),"Mercado/%s.txt",Name);
- return File;
- }
- stock SalvarLoja(playerid)
- {
- if(DOF2_FileExists(RetornaMercado(playerid)))
- {
- DOF2_SetBool(RetornaMercado(playerid),"Ferramentas",MercadoInfo[playerid][pFerramentas]);
- DOF2_SetBool(RetornaMercado(playerid),"Capacete",MercadoInfo[playerid][pCapacete]);
- DOF2_SaveFile();
- }
- }
- stock CarregarLoja(playerid)
- {
- if(DOF2_FileExists(RetornaMercado(playerid)))
- {
- MercadoInfo[playerid][pFerramentas] = DOF2_GetBool(RetornaMercado(playerid),"Ferramentas");
- MercadoInfo[playerid][pCapacete] = DOF2_GetBool(RetornaMercado(playerid),"Capacete");
- }
- }
- SaveWeaponsToFile(playerid)
- {
- new i, path[50], string[128], weaponid, ammo;
- path = GetPlayerFormattedName(playerid);
- if (!DOF2_FileExists(path)) DOF2_CreateFile(path);
- for (i=0; i<13; i++)
- {
- GetPlayerWeaponData(playerid,i,weaponid,ammo);
- format(string,sizeof(string),"Arma - %d",i);
- DOF2_SetInt(path,string,weaponid);
- format(string,sizeof(string),"Municao - %d",i);
- DOF2_SetInt(path,string,ammo == 65535 ? 0 : ammo);
- }
- }
- forward LoadArmasToFile(playerid);
- public LoadArmasToFile(playerid)
- {
- new i, path[50], string[128], weaponid, ammo;
- path = GetPlayerFormattedName(playerid);
- ResetPlayerWeapons(playerid);
- for (i=0; i<13; i++)
- {
- format(string,sizeof(string),"Arma - %d",i);
- weaponid = DOF2_GetInt(path,string);
- format(string,sizeof(string),"Municao - %d",i);
- ammo = DOF2_GetInt(path,string);
- GivePlayerWeapon(playerid,weaponid,ammo);
- }
- ArmasEntregue[playerid] = true;
- }
- GetPlayerFormattedName(playerid)
- {
- new name[24], full[50];
- GetPlayerName(playerid,name,sizeof(name));
- format(full,sizeof(full),"%s/%s.txt",PATH,name);
- return full;
- }
- forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
- public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
- {
- if(IsPlayerConnected(playerid))
- {
- new Float:oldposx, Float:oldposy, Float:oldposz;
- new Float:tempposx, Float:tempposy, Float:tempposz;
- GetPlayerPos(playerid, oldposx, oldposy, oldposz);
- tempposx = (oldposx -x);
- tempposy = (oldposy -y);
- tempposz = (oldposz -z);
- if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
- {
- return true;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement