Postado Dezembro 22, 2015 9 anos Olá pessoal! MONTAR DO 0 ~~ Venho por meio deste, pedir a qualquer um que possa me ajudar um sistema de armas onde dê para configurar: - exaust de tiros - quantos tiros da por vez - capacidade de munição por arma - recarregar as armas para atirar - chance de headshot (com hit elevado, configurável) - hit configurável de cada arma - SE POSSÍVEL: alcance de cada arma ps: para atirar, é com o use with mesmo do tíbia e.e INCREMENTAR SISTEMA ~~ O que venho pedir é um sistema de armas realista que estou necessitando, tenho algo parecido mas não há capacidade de armas e como recarregar ;x Se preferirem, aqui está meu atual sistema; o que falta nele é: - capacidade de munição por arma - recarregar as armas para atirar - SE POSSÍVEL: alcance de cada arma Spoiler local names = { -- Zombies com chance de hit kill: [nome] = chance em %, ["Zombie"] = 100, ["Zombie1"] = 100, ["Armor Plaga"] = 30, ["Zombie2"] = 100, ["Ganado"] = 30, } local barrels = {3981, 10946} -- ID dos barris local barrel_min = 3800 -- Mínimo de dano da explosão do barril local barrel_max = 6000 -- Máximo de dano da explosão do barril local barrel_effect = 23 -- Efeito da explosão local explosion_area = createCombatArea{ -- Área da explosão do barril {0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 1, 0, 0, 0}, {0, 0, 1, 1, 1, 0, 0}, {0, 1, 1, 3, 1, 1, 0}, {0, 0, 1, 1, 1, 0, 0}, {0, 0, 0, 1, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0} } local b_id -- Não altere function doPlayerShoot(cid, target, times, delay, min, max, effect, dist_effect, hs, hsmin, hsmax, exhaust, rounds) if rounds == nil then rounds = 1 end if not isCreature(target) then return true end if getPlayerStorageValue(cid, 42070) == 1 then min = min*1.1 max = max*1.1 hsmin = hsmin*1.1 hsmax = hsmax*1.1 hs = hs*1.1 end if math.random(1, 100) <= hs then doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -hsmin, -hsmax, effect) if isCreature(target) and names[getCreatureName(target)] then if math.random(1, 100) <= names[getCreatureName(target)] then doSendAnimatedText(getCreaturePosition(target), "HEAD SHOT", TEXTCOLOR_BLACK) doCreatureAddHealth(target, -getCreatureHealth(target)) end end end exhaustion.set(cid, 57193, exhaust) doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -min, -max, effect) doSendDistanceShoot(getCreaturePosition(cid), getCreaturePosition(target), dist_effect) if rounds == times then return true end addEvent(doPlayerShoot, delay, cid, target, times, delay, min, max, effect, dist_effect, hs, hsmin, hsmax, exhaust, rounds+1) end local function explodeBarrel(cid, pos, min, max, effect) doRemoveItem(getTileItemById(pos, b_id).uid, 1) doAreaCombatHealth(cid, COMBAT_FIREDAMAGE, pos, explosion_area, -min, -max, effect) return true end function doShootBarrel(cid, target, times, delay, dist_effect, exhaust) if not getThing(target) then return true end exhaustion.set(cid, 57193, exhaust) doSendDistanceShoot(getCreaturePosition(cid), getThingPos(target), dist_effect) doCreateItem(1492, 1, getThingPos(target)) addEvent(explodeBarrel, 3000, cid, getThingPos(target), barrel_min, barrel_max, barrel_effect) return true end function onUse(cid, item, fromPosition, itemEx, toPosition) local weapons = { -- [ID da arma] = {tiros, delay_dos_tiros, ammo, dano_min, dano_max, efeito, distance_effect, headshot_chance, dano_hs_min, dano_hs_max, exhaustion}, -- Handgun -- [2377] = {shots = 1, shots_delay = 50, ammo = 11389, min = 250, max = 450, dist_effect = 2, hs = 20, hsmin = 700, hsmax = 1260, exha = 0.9}, --glock 18 [2383] = {shots = 1, shots_delay = 200, ammo = 11389, min = 900, max = 1100, effect = 3, dist_effect = 2, hs = 35, hsmin = 1600, hsmax = 1850, exha = 0.4}, --glock 21 [2409] = {shots = 1, shots_delay = 50, ammo = 11389, min = 200, max = 750, effect = 3, dist_effect = 2, hs = 30, hsmin = 300, hsmax = 1060, exha = 0.0}, -- taurus pt92 -- Magnum-- [2426] = {shots = 1, shots_delay = 180, ammo = 11389, min = 1200, max = 2200, effect = 21, dist_effect = 5, hs = 20, hsmin = 1800, hsmax = 2460, exha = 0.3}, --golden desert eagle [2398] = {shots = 1, shots_delay = 180, ammo = 11389, min = 450, max = 650, dist_effect = 5, hs = 20, hsmin = 1000, hsmax = 1600, exha = 0.3}, --desert eagle [7451] = {shots = 1, shots_delay = 50, ammo = 11390, min = 80000, max = 102750, effect = 3, dist_effect = 2, hs = 20, hsmin = 81000, hsmax = 105060, exha = 0.0}, [2431] = {shots = 2, shots_delay = 180, ammo = 11390, min = 1200, max = 2200, effect = 21, dist_effect = 5, hs = 20, hsmin = 1800, hsmax = 2460, exha = 0.3}, [2413] = {shots = 2, shots_delay = 180, ammo = 11390, min = 1200, max = 2200, effect = 21, dist_effect = 5, hs = 20, hsmin = 1800, hsmax = 2460, exha = 0.3}, [2418] = {shots = 2, shots_delay = 180, ammo = 11390, min = 1200, max = 2200, effect = 21, dist_effect = 5, hs = 20, hsmin = 1800, hsmax = 2460, exha = 0.3}, [2405] = {shots = 2, shots_delay = 180, ammo = 11390, min = 1200, max = 2200, effect = 21, dist_effect = 5, hs = 20, hsmin = 1800, hsmax = 2460, exha = 0.3}, [2412] = {shots = 2, shots_delay = 180, ammo = 11390, min = 1200, max = 2200, effect = 21, dist_effect = 5, hs = 20, hsmin = 1800, hsmax = 2460, exha = 0.3}, -- Shotgun -- [2430] = {shots = 1, shots_delay = 180, ammo = 11391, min = 800, max = 1000, effect = 39, dist_effect = 2, hs = 12, hsmin = 2900, hsmax = 4600, exha = 1.7}, [7456] = {shots = 1, shots_delay = 180, ammo = 11391, min = 1000, max = 1500, effect = 39, dist_effect = 2, hs = 12, hsmin = 3600, hsmax = 6500, exha = 0.6}, [2429] = {shots = 1, shots_delay = 180, ammo = 11391, min = 3600, max = 6500, effect = 39, dist_effect = 2, hs = 12, hsmin = 13000, hsmax = 16000, exha = 0.7}, [2407] = {shots = 1, shots_delay = 180, ammo = 11391, min = 4800, max = 8900, effect = 39, dist_effect = 2, hs = 12, hsmin = 12500, hsmax = 22500, exha = 3.8}, [2421] = {shots = 1, shots_delay = 0, ammo = 11391, min = 6200, max = 9600, effect = 39, dist_effect = 2, hs = 12, hsmin = 13000, hsmax = 18000, exha = 0.7}, [2435] = {shots = 1, shots_delay = 50, ammo = 11391, min = 3000, max = 3000, effect = 39, dist_effect = 2, hs = 12, hsmin = 8600, hsmax = 12000, exha = 1.3}, [2422] = {shots = 1, shots_delay = 180, ammo = 11391, min = 9900, max = 11200, effect = 39, dist_effect = 2, hs = 12, hsmin = 34000, hsmax = 48000, exha = 0.4}, [2432] = {shots = 1, shots_delay = 180, ammo = 11391, min = 1000, max = 1500, effect = 39, dist_effect = 2, hs = 12, hsmin = 3600, hsmax = 6500, exha = 1.0}, [2428] = {shots = 1, shots_delay = 180, ammo = 11391, min = 9600, max = 12200, effect = 39, dist_effect = 2, hs = 12, hsmin = 15000, hsmax = 25000, exha = 0.7}, [2439] = {shots = 1, shots_delay = 50, ammo = 11391, min = 18000, max = 26000, effect = 39, dist_effect = 2, hs = 12, hsmin = 48000, hsmax = 86000, exha = 0.4}, [2427] = {shots = 1, shots_delay = 180, ammo = 11391, min = 12500, max = 16350, effect = 39, dist_effect = 2, hs = 12, hsmin = 1800, hsmax = 2460, exha = 0.4}, -- Rifle/Sniper -- [7452] = {shots = 1, shots_delay = 400, ammo = 11392, min = 5600, max = 12800, effect = 39, dist_effect = 5, hs = 20, hsmin = 15600, hsmax = 32600, exha = 2.0}, [2438] = {shots = 1, shots_delay = 400, ammo = 11392, min = 8900, max = 16000, effect = 39, dist_effect = 5, hs = 20, hsmin = 32500, hsmax = 46000, exha = 2.0}, -- Machine Gun / SUBMACHINE Gun / Assault rifle -- [2381] = {shots = 2, shots_delay = 180, ammo = 11394, min = 1200, max = 2200, effect = 0, dist_effect = 5, hs = 5, hsmin = 1800, hsmax = 2460, exha = 0.3}, [2434] = {shots = 6, shots_delay = 180, ammo = 11394, min = 1200, max = 2200, effect = 0, dist_effect = 5, hs = 5, hsmin = 1800, hsmax = 2460, exha = 0.3}, [2448] = {shots = 2, shots_delay = 180, ammo = 11394, min = 1200, max = 2200, effect = 0, dist_effect = 5, hs = 5, hsmin = 1800, hsmax = 2460, exha = 0.3}, [2450] = {shots = 2, shots_delay = 180, ammo = 11394, min = 1200, max = 2200, effect = 0, dist_effect = 5, hs = 5, hsmin = 1800, hsmax = 2460, exha = 0.3}, [2378] = {shots = 2, shots_delay = 50, ammo = 11394, min = 3000, max = 3000, effect = 0, dist_effect = 2, hs = 5, hsmin = 3800, hsmax = 3900, exha = 0.0}, [2408] = {shots = 3, shots_delay = 90, ammo = 11394, min = 2260, max = 3080, effect = 0, dist_effect = 8, hs = 5, hsmin = 2500, hsmax = 3500, exha = 0.4}, [2423] = {shots = 2, shots_delay = 180, ammo = 11394, min = 1200, max = 2200, effect = 0, dist_effect = 5, hs = 5, hsmin = 1800, hsmax = 2460, exha = 0.3}, [2424] = {shots = 2, shots_delay = 180, ammo = 11394, min = 1200, max = 2200, effect = 0, dist_effect = 5, hs = 5, hsmin = 1800, hsmax = 2460, exha = 0.3}, [2384] = {shots = 2, shots_delay = 180, ammo = 11394, min = 1200, max = 2200, effect = 0, dist_effect = 5, hs = 5, hsmin = 1800, hsmax = 2460, exha = 0.3}, [2397] = {shots = 2, shots_delay = 180, ammo = 11394, min = 1200, max = 2200, effect = 0, dist_effect = 5, hs = 5, hsmin = 1800, hsmax = 2460, exha = 0.3}, [2376] = {shots = 3, shots_delay = 130, ammo = 11394, min = 1600, max = 2190, effect = 0, dist_effect = 8, hs = 5, hsmin = 1880, hsmax = 2400, exha = 0.5}, [2417] = {shots = 3, shots_delay = 50, ammo = 11394, min = 600, max = 900, effect = 0, dist_effect = 2, hs = 5, hsmin = 680, hsmax = 950, exha = 0.8}, [2425] = {shots = 2, shots_delay = 180, ammo = 11394, min = 1200, max = 2200, effect = 0, dist_effect = 5, hs = 5, hsmin = 1800, hsmax = 2460, exha = 0.3}, [2382] = {shots = 2, shots_delay = 180, ammo = 11394, min = 1200, max = 2200, effect = 0, dist_effect = 5, hs = 5, hsmin = 1800, hsmax = 2460, exha = 0.3}, [2550] = {shots = 2, shots_delay = 180, ammo = 11394, min = 1200, max = 2200, effect = 0, dist_effect = 5, hs = 5, hsmin = 1800, hsmax = 2460, exha = 0.3}, [2395] = {shots = 10, shots_delay = 50, ammo = 11394, min = 5000, max = 7500, effect = 21, dist_effect = 8, hs = 5, hsmin = 6000, hsmax = 10260, exha = 0.5}, -- Atira Moedas ALICE -- [2451] = {shots = 2, shots_delay = 0, ammo = 2148, min = 8080, max = 9550, effect = 2, dist_effect = 37, hs = 40, hsmin = 8080, hsmax = 9550, exha = 0.9}, -- Lança-chamas -- [6528] = {shots = 4, shots_delay = 180, ammo = 10599, min = 1200, max = 2200, effect = 21, dist_effect = 5, hs = 20, hsmin = 1800, hsmax = 2460, exha = 0.3}, } local gun = weapons[item.itemid] if getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid ~= item.itemid and getPlayerSlotItem(cid, CONST_SLOT_RIGHT).itemid ~= item.itemid then doPlayerSendCancel(cid, "A arma deve estar equipada em uma de suas mãos.") return true elseif not isCreature(itemEx.uid) and not isInArray(barrels, itemEx.itemid) then doPlayerSendCancel(cid, "Você precisa selecionar um alvo válido.") return true elseif getPlayerStorageValue(cid, 18391) == 1 then doPlayerSendCancel(cid, "Você não pode atirar enquanto dirige.") return true elseif getPlayerStorageValue(cid, 18393) == 1 then doPlayerSendCancel(cid, "Você não pode atirar com o capacete.") return true elseif getPlayerStorageValue(cid, 41078) == 1 then doPlayerSendCancel(cid, "Você não pode atirar enquanto descansa.") return true elseif exhaustion.check(cid, 57193) then doPlayerSendCancel(cid, "Você está exausto.") return true elseif not isInArray(barrels, itemEx.itemid) and not doPlayerRemoveItem(cid, gun.ammo, gun.shots) or isInArray(barrels, itemEx.itemid) and not doPlayerRemoveItem(cid, gun.ammo, 1) then doPlayerSendCancel(cid, "Você não possui munição.") return true end if isInArray(barrels, itemEx.itemid) then b_id = itemEx.itemid doShootBarrel(cid, itemEx.uid, gun.shots, gun.shots_delay, gun.dist_effect, gun.exha) else doPlayerShoot(cid, itemEx.uid, gun.shots, gun.shots_delay, gun.min, gun.max, gun.effect, gun.dist_effect, gun.hs, gun.hsmin, gun.hsmax, gun.exha) end return true end grato desde já!
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.