Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <zcmd>
- #pragma tabsize 0
- //Variáveis
- new Bomb[MAX_PLAYERS];
- new FBTimer;
- new CountTime;
- new Counting;
- new BagTime;
- new BagCounting;
- new VanMoved;
- new SMoney;
- new DetonateBomb[MAX_PLAYERS];
- new SecurityVanID[MAX_PLAYERS];
- new SVBeingRobbed[MAX_VEHICLES];
- new FullBag[MAX_PLAYERS];
- new MoneyLeft[MAX_VEHICLES];
- new Float:VanX,Float:VanY,Float:VanZ;
- //Forwards
- forward VanMovedTimer(playerid,Float:X,Float:Y,Float:Z);
- forward FillingBags(playerid);
- forward SecureMoney(playerid);
- //Publics
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print("System roubo ao carro forte - Traduzido por Menor. [By TonyII]");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- if(FullBag[playerid] == 1)
- {
- GivePlayerMoney(playerid, -100000);
- KillTimer(SMoney);
- FullBag[playerid] = 0;
- SendClientMessage(playerid, 0xFF0000FF,"Erro: Seu assalto deu errado, você morreu.");
- }
- return 1;
- }
- public VanMovedTimer(playerid)
- {
- new Float:X,Float:Y,Float:Z;
- if(!Counting)
- {
- KillTimer(VanMoved);
- Bomb[playerid] = 0;
- DetonateBomb[playerid] = 1;
- SendClientMessage(playerid, 0xFFFF00FF,"Tudo pronto, a bomba esta plantada. Saia de perto e use /detonarbomba");
- ClearAnimations(playerid);
- }
- else
- {
- new SVID = SecurityVanID[playerid];
- GetVehiclePos(SVID, X,Y,Z);
- if(X == VanX && Y == VanY && Z == VanZ)
- {
- new string[128];
- format(string,sizeof(string),"%i",CountTime);
- GameTextForPlayer(playerid,string,1000,5);
- CountTime --;
- if(CountTime == 0)
- {
- Counting = 0;
- }
- }
- else
- {
- KillTimer(VanMoved);
- SendClientMessage(playerid, 0xFF0000FF,"Erro: Você saiu de perto do carro-forte ao plantar a bomba!");
- }
- }
- return 1;
- }
- public SecureMoney(playerid)
- {
- SendClientMessage(playerid, 0xFFFF00FF,"O Dinheiro esta seguro agora.");
- FullBag[playerid] = 0;
- KillTimer(SMoney);
- return 1;
- }
- public FillingBags(playerid)
- {
- if(!BagCounting)
- {
- KillTimer(FBTimer);
- FullBag[playerid] = 1;
- GivePlayerMoney(playerid, 100000);
- SendClientMessage(playerid, 0xFFFF00FF,"Você encheu a mala, a mala contém $100,000 Dólares.");
- SendClientMessage(playerid, 0xFFFF00FF,"Deixe a área, se você morrer, você perde o dinheiro!");
- ClearAnimations(playerid);
- SMoney = SetTimerEx("SecureMoney",600000,false,"i",playerid);
- }
- else
- {
- new string[128];
- format(string,sizeof(string),"%i",BagTime);
- GameTextForPlayer(playerid,string,1000,5);
- BagTime --;
- if(BagTime == 0)
- {
- BagCounting = 0;
- }
- }
- return 1;
- }
- //Stocks
- stock SecurityVan(vehicleid)
- {
- switch(GetVehicleModel(vehicleid))
- {
- case 428: return 1;
- }
- return 0;
- }
- stock GetDistanceToCar(playerid, veh, Float: posX = 0.0, Float: posY = 0.0, Float: posZ = 0.0)
- {
- new Float: Floats[2][3];
- if(posX == 0.0 && posY == 0.0 && posZ == 0.0)
- {
- if(!IsPlayerInAnyVehicle(playerid)) GetPlayerPos(playerid, Floats[0][0], Floats[0][1], Floats[0][2]);
- else GetVehiclePos(GetPlayerVehicleID(playerid), Floats[0][0], Floats[0][1], Floats[0][2]);
- }
- else
- {
- Floats[0][0] = posX;
- Floats[0][1] = posY;
- Floats[0][2] = posZ;
- }
- GetVehiclePos(veh, Floats[1][0], Floats[1][1], Floats[1][2]);
- return floatround(floatsqroot((Floats[1][0] - Floats[0][0]) * (Floats[1][0] - Floats[0][0]) + (Floats[1][1] - Floats[0][1]) * (Floats[1][1] - Floats[0][1]) + (Floats[1][2] - Floats[0][2]) * (Floats[1][2] - Floats[0][2])));
- }
- stock GetClosestCar(playerid, exception = INVALID_VEHICLE_ID)
- {
- new Float: Distance,target = -1,Float: vPos[3];
- if(!IsPlayerInAnyVehicle(playerid)) GetPlayerPos(playerid, vPos[0], vPos[1], vPos[2]);
- else GetVehiclePos(GetPlayerVehicleID(playerid), vPos[0], vPos[1], vPos[2]);
- for(new v; v < MAX_VEHICLES; v++) if(GetVehicleModel(v) >= 400)
- {
- if(v != exception && (target < 0 || Distance > GetDistanceToCar(playerid, v, vPos[0], vPos[1], vPos[2])))
- {
- target = v;
- Distance = GetDistanceToCar(playerid, v, vPos[0], vPos[1], vPos[2]);
- }
- }
- return target;
- }
- //Comandos
- CMD:comprarbomba(playerid, params[])
- {
- if(GetPlayerMoney(playerid) <= 10000) return SendClientMessage(playerid, 0xFF0000FF,"Erro: Dinheiro insuficiente.");
- if(Bomb[playerid] == 1) return SendClientMessage(playerid, 0xFF0000FF,"Erro: Você já tem uma bomba.");
- Bomb[playerid] = 1;
- ApplyAnimation(playerid,"PED","fucku",4.0,0,0,0,0,0);
- SendClientMessage(playerid, 0xFFFF00FF,"Você comprou com sucesso uma bomba.");
- SendClientMessage(playerid, 0xFFFF00FF,"Aproxime-se de um carro-forte e plante nas portas traseiras. /Plantarbomba");
- GivePlayerMoney(playerid, -100000);
- return 1;
- }
- CMD:plantarbomba(playerid, params[])
- {
- new ClosestCar = GetClosestCar(playerid);
- GetVehiclePos(ClosestCar, VanX,VanY,VanZ);
- if(Bomb[playerid] == 0) return SendClientMessage(playerid, 0xFF0000FF,"Erro: Você não tem uma bomba.");
- if(IsPlayerInRangeOfPoint(playerid, 7.0, VanX,VanY,VanZ))
- {
- if(SecurityVan(ClosestCar))
- {
- SecurityVanID[playerid] = ClosestCar;
- VanMoved = SetTimerEx("VanMovedTimer",1000,true,"i",playerid);
- CountTime = 5;
- Counting = 1;
- SendClientMessage(playerid, 0xFFFF00FF,"Você está plantando a bomba!");
- ApplyAnimation(playerid, "BOMBER","BOM_Plant_Loop",4.0,1,0,0,1,0);
- }
- else return SendClientMessage(playerid, 0xFF0000FF,"Erro: Esse veículo não é um carro-forte!");
- }
- else return SendClientMessage(playerid, 0xFF0000FF,"Erro: Não há nenhum carro-forte por perto.");
- return 1;
- }
- CMD:detonarbomba(playerid, params[])
- {
- new Float:X,Float:Y,Float:Z;
- if(DetonateBomb[playerid] == 1)
- {
- new SVID = SecurityVanID[playerid];
- GetVehiclePos(SVID, X,Y,Z);
- CreateExplosion(X, Y, Z, 7, 10);
- SetVehicleHealth(SVID, 350);
- SVBeingRobbed[SVID] = 1;
- DetonateBomb[playerid] = 0;
- MoneyLeft[SVID] = 5;
- SetPlayerWantedLevel(playerid,4);
- SendClientMessage(playerid, 0xFFFF00FF,"A bomba explodiu, encha as malas e saia daqui. Use /enchermala");
- SendClientMessage(playerid, 0xFF0000FF,"A polícia esta na sua cola, agora você é um procurado!");
- }
- else return SendClientMessage(playerid, 0xFF0000FF,"Erro: Você não tem uma bomba plantada aqui.");
- return 1;
- }
- CMD:enchermala(playerid, params[])
- {
- static Ladrao[MAX_PLAYER_NAME], sStr[70];
- GetPlayerName(playerid, Ladrao, sizeof(Ladrao));
- new ClosestCar = GetClosestCar(playerid);
- if(BagCounting == 1) return SendClientMessage(playerid, 0xFF0000FF,"Erro: Você já está enchendo suas malas!");
- if(GetPlayerWeapon(playerid) == 46) return SendClientMessage(playerid, 0xFF0000FF, "Erro: Você não tem uma mochila ! ");
- if(MoneyLeft[ClosestCar] == 0) return SendClientMessage(playerid, 0xFF0000FF,"Este carro está vazio!");
- if(FullBag[playerid] == 1) return SendClientMessage(playerid, 0xFF0000FF,"Erro: Suas malas estão cheias, gaste o dinheiro do roubo anterior!");
- if(SVBeingRobbed[ClosestCar] == 1)
- {
- SendClientMessage(playerid, 0xFFFF00FF,"Aguarde, você está enchendo suas malas com dinheiro.");
- FBTimer = SetTimerEx("FillingBags",1000,true,"i",playerid);
- BagTime = 5;
- BagCounting = 1;
- MoneyLeft[ClosestCar] -= 1;
- ApplyAnimation(playerid, "BOMBER","BOM_Plant_Loop",4.0,1,0,0,1,0);
- format(sStr, sizeof(sStr), "ATENÇÃO! %s[%d] está roubando o Banco!", Ladrao, playerid);
- SendClientMessageToAll(0xE31919FF, sStr);
- }
- else return SendClientMessage(playerid, 0xFF0000FF,"Erro: Este carro não está sendo roubado.");
- return 1;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement