rendered paste body///effect.sqf
COMMENT "privatisation des variables";
private
["_tracertaille","_tracercouleur","_pos","_size","_color","_vel"];
COMMENT "récupération des variables";
_tracertaille=_this select 0;
_tracercouleur=format["%1",_this select 1];
_pos=_this select 2;
_vel=_this select 3;
COMMENT "définition des variables";
SIZE_MOD = 1;
COMMENT "couleur tracer";
if(_tracercouleur=="red") then {_color=[[1,0.2,0.1,1],[1,0.2,0,1],[1,0.2,0,1]];};
COMMENT "taile tracer";
_size=[_tracertaille*SIZE_MOD];
_glowSize=[(_tracertaille*SIZE_MOD)/10];
_weight=80.0;
_volume=0.005;
_drag=0.00;
drop["\Ca\Data\kouleSvetlo", "", "Billboard", 10, 0.05, _pos, _vel, 0, _weight, _volume, _drag, _size, _color, [0, 1], 0, 0, "", "", ""];
drop["\Ca\Data\halfLight", "", "spaceObject", 10, 0.05, _pos, _vel, 0, _weight, _volume, _drag, _glowSize, _color, [0, 1], 0, 0, "", "", ""];
///fired.sqf
_rand = random 3
_rand_arrondi = _rand - (_rand mod 1)
? _rand_arrondi < 1 : exit
COMMENT "privatisation des variables";
private ["_M1A1","_ammo","_numrounds","_counter","_tracertaille","_tracercouleur","_projectile","_pos"];
COMMENT "définition des variables";
_M1A1=_this select 0;
_weapon=_this select 1;
_ammo=_this select 4;
_tracercouleur = "red";
_tracertaille=1.0;
? _ammo == "B_762x51_Ball" : goto "go"
exit
#go
CENT_RICOCHET_EFFECT = compile loadFile "\XAM_engine\M1A1\Tracers_1\effect.sqf";
_projectile=nearestObject[_M1A1,_ammo];
~0.10
[_projectile,_tracercouleur,_tracertaille] exec "\XAM_engine\M1A1\Tracers_1\tracer.sqs";
///tracer.sqf
;//récupération des variables
_projectile = _this select 0
_tracercouleur = _this select 1
_tracertaille = _this select 2
;// définition des variables
_speed = 10;
_dir_asal = direction _projectile;
;// détection de la position tu tracer
#loop
_pos=getpos _projectile
_dir = direction _projectile;
_vel=[((velocity _projectile select 0)+(sin _dir*_speed)),((velocity _projectile select 1)+(cos _dir*_speed)),(velocity _projectile select 2)]
[_tracertaille,_tracercouleur,_pos,_vel] call CENT_RICOCHET_EFFECT;
~0.001
?(alive _projectile) : goto "loop"
exit