Jump to content

Bright Bullets (Like flares)


Benevolence

Recommended Posts

Attach 3 / 4 red Corona's to each other and make e'm move to it's destination. You could use Vik's laser resource for the aim stuff and put your scripted code in the code down here.

function fireFunc() 
end 
addEventHandler("onClientPlayerWeaponFire", getRootElement(), fireFunc) 

EDIT: I like the russian guy, he sounds badass ^^

Link to comment
local weaponsThatCantFireBullets = {[0] = true, [1] = true, [2] = true, [3] = true, [4] = true, [5] = true, [6] = true, [7] = true, [8] = true, [9] = true, [10] = true, [11] = true, [12] = true, [13] = true, [14] = true, [15] = true, [16] = true, [40] = true, [44] = true, [45] = true, [46] = true} 
local lines = {} 
  
  
function onClientPlayerWeaponFireFunc(weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement) 
    if weaponsThatCantFireBullets[weapon] then return end 
    local mx, my, mz = getPedWeaponMuzzlePosition(source) 
    lines[#lines +1] = {mx, my, mz, hitX, hitY, hitZ} 
end 
addEventHandler("onClientPlayerWeaponFire", root, onClientPlayerWeaponFireFunc) 
  
addEventHandler("onClientRender",root, 
function () 
    for index, line in pairs(lines) do 
        dxDrawLine3D(line[1],line[2],line[3],line[4],line[5],line[6],tocolor(255,0,0,255)) 
    end 
end) 

Should be enough for a start.

Link to comment
local weaponsThatCantFireBullets = {[0] = true, [1] = true, [2] = true, [3] = true, [4] = true, [5] = true, [6] = true, [7] = true, [8] = true, [9] = true, [10] = true, [11] = true, [12] = true, [13] = true, [14] = true, [15] = true, [16] = true, [40] = true, [44] = true, [45] = true, [46] = true} 
local lines = {} 
  
  
function onClientPlayerWeaponFireFunc(weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement) 
    if weaponsThatCantFireBullets[weapon] then return end 
    local mx, my, mz = getPedWeaponMuzzlePosition(source) 
    lines[#lines +1] = {mx, my, mz, hitX, hitY, hitZ} 
end 
addEventHandler("onClientPlayerWeaponFire", root, onClientPlayerWeaponFireFunc) 
  
addEventHandler("onClientRender",root, 
function () 
    for index, line in pairs(lines) do 
        dxDrawLine3D(line[1],line[2],line[3],line[4],line[5],line[6],tocolor(255,0,0,255)) 
    end 
end) 

Should be enough for a start.

they wont destroy.

u need to set timer to remove the subtable after a set ammount of time(imo 2sec would be good)

also fading out would be good, but i guess thats out of basic help.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...