Jump to content

Bright Bullets (Like flares)


Benevolence

Recommended Posts

Posted (edited)

How would I go on about making bullets more visible when they are shot? For example, bullets with flares. It's possible because I've seen it on a zombie server. Skip video to 1:47

Edited by Guest
Posted
I'm not really sure. Its probably a function on the Wiki or something.

Btw nice video.

Indeed. I respect FPSRussia for all his videos and because he's been paintballing to the place I always go :D .

On-Topic: I'd really like to know how to do this.

Posted

onClientPlayerWeaponFire(hitX, hitY, hitZ)--->x,y,z = getPedWeaponMuzzlePosition----> createMarker(corona, x,y,z)

MoveObject(marker, hitX,hitY,hitZ)

Something like that^^

You move a Marker very fast from your Muzzle Position to hit position.

Posted

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 ^^

Posted
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.

Posted
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.

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...