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

Can other people connect to your server? Use this tool to check:

http://nightly.mtasa.com/ports/

1484762903.png

Formerly known as Tank07.

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.

Can other people connect to your server? Use this tool to check:

http://nightly.mtasa.com/ports/

1484762903.png

Formerly known as Tank07.

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.

n-560x95_FFFFFF_FFFFFF_000000_000000.png

Posted
You mean like this: https://community.multitheftauto.com/index.php?p= ... ls&id=2002, maybe using a timer lol.

Yeah like that but I'd like the tracers to dissapear after they reach they're destination.. just like a bullet would like. But this resource is compiled, can't edit it.

im thinking

dxDrawLine3D 

https://wiki.multitheftauto.com/wiki/DxDrawLine3D

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.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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.

Posted

I wasn't trying to give him the full script, karlis, I'm trying to give him a code where to start of.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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