Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ////////////////////////////////////////////////////////////////////////////////
- //
- //
- // #### ######## ###### ######## ######## ### ## ##
- // ## ## ## ## ## ## ## ## ## ### ###
- // ## ## ## ## ## ## ## ## #### ####
- // ## ######## ###### ## ###### ## ## ## ### ##
- // ## ## ## ## ## ######### ## ##
- // ## ## ## ## ## ## ## ## ## ##
- // #### ## ###### ## ######## ## ## ## ##
- //
- //
- // Explosão de Caixas Eletronicos v2.1
- //
- /* ______ ______ _
- // | ___ \ | ___ \ | |
- // | |_/ /_ _ | |_/ /_ _ _ _| | ___
- // | ___ \ | | | | __/ _` | | | | |/ _ \
- // | |_/ / |_| |_ | | | (_| | |_| | | (_) |
- // \____/ \__, (_) \_| \__,_|\__,_|_|\___/
- // __/ |
- // |___/
- */
- //
- // !!! Simule a vida real expldindo os Caixas Eletronicos pela cidade !!!
- //
- // [iPs]TeaM soluções de programação em geral (agora com cursos)
- //
- // http://ips-team.forumeiros.com/ (contate-nos)
- //
- /////////////////////////////////////////////////////////////////////////////////
- #include <a_samp>
- #include <bcmd>
- #define MAX_CAIXAS 50
- #define Function%0(%1) forward%0(%1); public%0(%1)
- new Caixa[5];
- new bool: CaixaExplodido[MAX_CAIXAS];
- new bool: VaiExplodir[MAX_CAIXAS];
- new Float: EfX[MAX_CAIXAS] = { 1155.27, 377.80, 1508.32, 2243.00, 1833.20 };
- new Float: EfY[MAX_CAIXAS] = { -1463.80, -2056.45, -1676.96, -1665.09, -1840.21 };
- new Float: EfZ[MAX_CAIXAS] = { 15.42, 7.66, 13.70, 15.14, 13.24 };
- new Float: EfrX[MAX_CAIXAS] = { 0.00, 0.00, 0.00, 0.00, 0.00 };
- new Float: EfrY[MAX_CAIXAS] = { 0.00, 0.00, 0.00, 0.00, 0.00 };
- new Float: EfrZ[MAX_CAIXAS] = { -69.00, 180.00, 113.00, 164.00, 270.00 };
- new Pickup[MAX_CAIXAS] = {0xFFFF, ...};
- public OnFilterScriptInit()
- {
- print("\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-");
- print("| |");
- print("| » Explodir Caixas By. Paulo_TerroR « |");
- print("| |");
- print("=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n");
- for(new i = (sizeof(Caixa) - 1); i > -1; --i) Caixa[i] = CreateObject(2942, EfX[i], EfY[i], EfZ[i], EfrX[i], EfrY[i], EfrZ[i]);
- return 1;
- }
- public OnFilterScriptExit()
- {
- print("\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-");
- print("| |");
- print("| » Explodir Caixas By. Paulo_TerroR « |");
- print("| |");
- print("=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n");
- for(new i = (sizeof(Caixa) - 1); i > -1; --i) DestroyObject(Caixa[i]);
- return 1;
- }
- public OnPlayerPickUpPickup(playerid, pickupid) {
- new ExpID = GetProxExp(playerid);
- if(Pickup[ExpID] == pickupid) {
- new GranaExp = randomEx(500, 1000), Str[55];
- format(Str, 55, "INFO: Você recebeu R$ %i,00 pela Explosão do Caixa!", GranaExp);
- SendClientMessage(playerid, 0x33AA33AA, Str);
- GivePlayerMoney(playerid, GranaExp);
- DestroyPickup(Pickup[ExpID]);
- Pickup[ExpID] = 0xFFFF;
- }
- return 1;
- }
- Function ConstruirCaixa(ExpID) {
- DestroyObject(Caixa[ExpID]);
- CaixaExplodido[ExpID] = false;
- Caixa[ExpID] = CreateObject(2942, EfX[ExpID], EfY[ExpID], EfZ[ExpID], EfrX[ExpID], EfrY[ExpID], EfrZ[ExpID]);
- return 1;
- }
- Function InfoCaixas(playerid, Float: fX, Float: fY, Float: fZ, Obj, ExpID) {
- CreateExplosion(fX, fY, fZ, 10, 2000.0);
- DestroyObject(Obj);
- DestroyObject(Caixa[ExpID]);
- Caixa[ExpID] = CreateObject(2943, EfX[ExpID], EfY[ExpID], EfZ[ExpID], EfrX[ExpID], EfrY[ExpID], EfrZ[ExpID]);
- SetTimerEx("ConstruirCaixa", (15 * 60000), false, "i", ExpID);
- if(IsPlayerInRangeOfPoint(playerid, 30.0, EfX[ExpID], EfY[ExpID], EfZ[ExpID])) {
- SendClientMessage(playerid, 0x33AA33AA, "[SUCESSO] Você explodiu o caixa, vá até ele e pegue sua Recompensa!");
- CaixaExplodido[ExpID] = true;
- VaiExplodir[ExpID] = false;
- Pickup[ExpID] = CreatePickup(1279, 1, fX, (fY + 0.4), (fZ - 0.55));
- } else {
- SendClientMessage(playerid, 0xAA3333AA,"[ERRO] Você se distanciou do caixa!.");
- CaixaExplodido[ExpID] = true;
- VaiExplodir[ExpID] = false;
- }
- return 1;
- }
- GetProxExp(playerid) {
- for(new i = (sizeof(Caixa) - 1); i > -1; --i) if(IsPlayerInRangeOfPoint(playerid, 5.0, EfX[i], EfY[i], EfZ[i])) return i;
- return 0xFFFF;
- }
- randomEx(Min, Max) return (random(((Max - Min) + 1)) + Min);
- bCMD[explodircaixa]>(playerid : params[] : help) {
- new Float: pfX, Float: pfY, Float: pfZ;
- for(new i = (sizeof(Caixa) - 1); i > -1; --i) {
- if(IsPlayerInRangeOfPoint(playerid, 2.0, EfX[i], EfY[i], EfZ[i])) {
- if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xAA3333AA, "[ERRO] Você não pode usar esse comando em um veiculo!.");
- if(CaixaExplodido[i]) return SendClientMessage(playerid, 0xAA3333AA, "[ERRO] O caixa foi explodido a pouco tempo.");
- if(VaiExplodir[i]) return SendClientMessage(playerid, 0xAA3333AA, "[ERRO] O caixa já vai explodir.");
- GetPlayerPos(playerid, pfX, pfY, pfZ);
- SetTimerEx("InfoCaixas", 10000, false, "ifffii", playerid, pfX, pfY, pfZ, CreateObject(1654, pfX, (pfY + 0.4), (pfZ - 0.8), 0, 0, 0), i);
- SendClientMessage(playerid, 0xFFFF00AA, "Você armou a dinamite! Saia de perto rápido!!");
- SetPlayerWantedLevel(playerid, (GetPlayerWantedLevel(playerid) + 1));
- VaiExplodir[i] = true;
- return ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
- }
- }
- return SendClientMessage(playerid, 0xAA3333AA, "[ERRO] Você não está em nenhum perto de um caixa eletronico.");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement