i just took parts of different scripts and made them into one. its dumb though. you cant see the bullet fly, only hear it. (you can also try to run circles around it, but you'll die if you run into it
) i'll edit this post and add the whole script i got a bit later.
ok the following code is a mess, i'll give you that much, but it works. And as you can see there's a lot of useless extra lines commented out. you can delete them freely. there's also an explosion and smoke trail effect added to anything fired out of your gun.
;script written by Igor Drukov (igordrukov@noos.fr)
;an actual compilation of original BIS and Vektorboson scripts. grenade
;_man=_this select 0
;_object=nearestobject [_man,"grenade"]
_object = nearestObject [vehicle(player), _this select 4]
;_Missile = nearestObject [vehicle(player), _this select 4]
;? isNull _Missile : exit
;_Missile setVelocity [(.01 ), (.01 ), (.01 )]
;_object setvelocity [random(100)-50,0,random(2)+2]
;#turbo
;?(_n >= 25): _driver groupchat "NOS has worn off"; nosp1 = car1 addaction ["NOS", "turbo1.sqs"];Exit
; get the current velocity of the vehicle
_xvel = velocity _object select 0
_yvel = velocity _object select 1
_zvel = velocity _object select 2
;_xvel = _xvel*.001
;_yvel = _yvel*.001
;_zvel = _zvel
; now set the new velocity
;_object setVelocity [(_xvel ), (_yvel ), (_zvel )]
;_n = _n + 1
;~0.1
;goto "turbo"
_pos=getpos _object
_lifeTime =35
_delay = 0.001
_velocity=[0,0,1]
_lifeTicks = _lifeTime / _delay
_lifeTick = _lifeTicks
#Begin
_n = _n +1
_zvel = velocity _object select 2
_object setVelocity [(_xvel*.5 ), (_yvel*.5 ), ( _zvel)]
_cx=getpos _object select 0
_cy=getpos _object select 1
_cz=getpos _object select 2
_pos=getpos _object
_bomb=drop ["cl_fire", "", "Billboard", 1, 2, _pos, [random 0.3, random 0.3, 0], 1, 0.004, 0.004, 0.1, [1.5*(0.1 + 0.2 * _lifeTick/_lifeTicks), 1.5*(0.1 + 0.5 * _lifeTick/_lifeTicks), 1.5*(0.1 + 0.1 * _lifeTick/_lifeTicks)], [[1,1,1,0], [1,1,1,1], [1,1,1,0.6], [0,0,1,0]], [0,1,0], 0.5, 0.05, "", "", ""]
_smoke=drop ["cl_basic", "", "Billboard", 1, 2, _pos, [random 0.3, random 0.3, 0], 1, 0.004, 0.004, 0.1, [1.5*(0.1 + 0.2 * _lifeTick/_lifeTicks), 1.55*(0.1 + 0.5 * _lifeTick/_lifeTicks), 1.5*(0.1 + 0.1 * _lifeTick/_lifeTicks)], [[1,1,1,0], [1,1,1,1], [1,1,1,0.6], [0,0,1,0]], [0,1,0], 0.5, 0.05, "", "", ""]
~0.001*_delay
? _cz<0.5 :goto "explo"
_lifeTick = _lifeTick - 1
?_lifeTick > 0 : goto "Begin"
#explo
_Unit = _object
_Explosion = GetPos _Unit
_cx = _Explosion select 0
_cy = _Explosion select 1
_cz = _Explosion select 2
_c = 50
_color = [[0.35,0.35,0.3,0], [0.2, 0.2, 0.1, 0.5],[0.2, 0.27, 0.15, 0]]
_size = [2, 5]
_size1 = [2, 15]
_lifetime = 2
_step = 360 / _c
_i = 0
;Vektorboson again... always him !
#l1
_vel = [sin(_i * _step)*15, cos(_i * _step)*15,0]
_vel0 = [sin(_i * _step)*100, cos(_i * _step)*100, random 75-random 150]
_vel1 = [sin(_i * _step)*15, cos(_i * _step)*15,random 15-random 30]
?_cz<1:drop ["cl_basic", "", "Billboard", _lifetime, _lifetime, [_cx, _cy, _cz], _vel, 0, 0.2, 0.157, 0.001, _size, _color, [0], 0.1, 0.2, "", "", ""]
?_cz>=1:drop ["cl_basic", "", "Billboard", _lifetime, _lifetime, [_cx, _cy, _cz], _vel1, 0, 0.2, 0.157, 0.001, [5,15,25], _color, [0], 0.1, 0.2, "", "", ""]
drop ["cl_fire", "", "Billboard", 1, 0.75, [_cx, _cy, _cz], _vel0,1, 0.004, 0.004, 0.1, [random 5,random 15], [[1,1,1,0], [1,1,1,1], [1,1,1,0.6], [1,1,1,0]], [0,1,0], 0.5, 0.05, "", "", ""]
_i = _i + 1
?_i < _c: goto "l1"
_tempobj = objNull
_pos=getpos _object
_lifeTime =0.001
_delay = 0.001
_velocity=[0,0,1]
_lifeTicks = _lifeTime / _delay
_lifeTick = _lifeTicks
#Begin0
_object exec "Destroyed.sqs"
drop ["cl_basic", "", "Billboard", 1, 1, [_cx,_cy,_cz], [random 0.3, random 0.3, random 0.3], 1, 0.004, 0.004, 0.1, [5*(0.1 + 0.2 * _lifeTick/_lifeTicks), 2.5*(0.1 + 0.5 * _lifeTick/_lifeTicks), 2.5*(0.1 + 0.1 * _lifeTick/_lifeTicks)], [[0,0,0,1], [0,0,0,1], [0,0,0,1], [0,0,0,1]], [0,1,0], 0.5, 0.05, "", "", ""]
drop ["cl_fire", "", "Billboard", 1, 1, [_cx,_cy,_cz], [random 0.3, random 0.3, random 0.3], 1, 0.004, 0.004, 0.1, [75*(0.1 + 0.2 * _lifeTick/_lifeTicks), 25*(0.1 + 0.5 * _lifeTick/_lifeTicks), 25*(0.1 + 0.1 * _lifeTick/_lifeTicks)], [[1,1,1,0], [1,1,1,1], [1,1,1,0.6], [1,1,1,0]], [0,1,0], 0.5, 0.05, "", "", ""]
~_delay
_object setdammage _i
_i=_i*1.1
_lifeTick = _lifeTick - 1
?_lifeTick > 0 : goto "Begin0"
exit
Attached is also the .sqs file of this code. your going to need to add the following the init field to get it to work:
this addeventHandler [""fired"", {_this exec ""grenadefire.sqs""} ]
thats it, hope someone finds it useful