Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- [DA3F]Aroun LeBriCodeur.
- fn_daf_speed.sqf
- */
- /*
- à mettre dans fn_useItem.sqf :
- case (_item isEqualTo "DA3F_item_carC4"): {
- [vehicle cursorTarget]call life_fnc_daf_speed;
- };
- Créer un item virtuel :
- class DA3F_item_carC4 {
- variable = "carC4";
- displayName = "STR_Item_DA3F_Item_carC4";
- weight = 1;
- buyPrice = 1250000;
- sellPrice = 350;
- illegal = false;
- edible = -1;
- icon = "";
- };
- pense à la stringTable !!
- Maintenant tu fais utiliser sur ton item face à une voiture et tu attends :D !
- */
- #include "..\..\script_macros.hpp"
- _this spawn {
- private["_vehTarget","_handle","_carc4"];
- _vehTarget = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_param;
- if(isNull _vehTarget) exitWith {};
- if(!(_vehTarget isKindOf "AllVehicles")) exitWith {hint "Vous ne pouvez pas piéger la voiture ici!"};
- if(player distance _vehTarget > 7) exitWith {hint "Vous devez vous mettre plus près du véhicule!"};
- if(!([false,"DA3F_item_carC4",1] call life_fnc_handleInv)) exitWith {};
- closeDialog 0;
- life_action_inUse = true;
- disableSerialization;
- titleText["Sabotage du moteur...","PLAIN"];
- _realName = getText (configFile / "CfgVehicles" / (typeof _vehTarget) / "displayName");
- _title = format ["Pose sur %1", _realName];
- 5 cutRsc ["Life_progress","PLAIN"];
- _ui = uiNamespace getVariable "Life_progress";
- _progressBar = _ui displayCtrl 38201;
- _titleText = _ui displayCtrl 38202;
- _titleText ctrlSetText format["%2 (1%1)","%",_title];
- _progressBar progressSetPosition 0.01;
- _cP = 0.01;
- _cpRate = 0.0085;
- _exit = false;
- while {true} do {
- if (animationState player != "AinvPknlMstpSnonWnonDnon_medic_1") then {
- [player,"AinvPknlMstpSnonWnonDnon_medic_1",true] remoteExecCall ["life_fnc_animSync",-2];
- player switchMove "AinvPknlMstpSnonWnonDnon_medic_1";
- player playMoveNow "AinvPknlMstpSnonWnonDnon_medic_1";
- };
- sleep 0.08;
- if(isNull _ui) then {
- 5 cutRsc ["Life_progress","PLAIN"];
- _ui = uiNamespace getVariable "Life_progress";
- _progressBar = _ui displayCtrl 38201;
- _titleText = _ui displayCtrl 38202;
- };
- _cP = _cP + _cpRate;
- _progressBar progressSetPosition _cP;
- _titleText ctrlSetStructuredText parseText format["<t size='1px' color='#FA320A'>%3 </t><t size='0.8px' color='#A2FA0A'>(%1%2)...</t>",round(_cP * 100),"%",_title];
- // _titleText ctrlSetText format["%3 (%1%2)...",round(_cP * 100),"%",_title];
- if(_cP >= 1 OR !alive player) exitWith {};
- if(life_istazed) exitWith {};
- if(life_isknocked) exitWith {};
- if(life_interrupted) exitWith {};
- if((speed _vehTarget)>=3) exitWith {_exit = true; sleep 1.5; hint "Ta cible ne dois pas bouger";
- };
- };
- 5 cutText ["","PLAIN"];
- player playActionNow "stop";
- if (_exit) exitWith {hint "Ta cible ne dois pas bouger";};
- life_action_inUse = false;
- titleText["Vous avez saboté le véhicule.","PLAIN",2];
- _vehTarget setVariable["Vehpiege",true,true];
- waitUntil {sleep 0.3;((speed _vehTarget) > 20) && (_vehTarget getVariable "Vehpiege");};
- titleText ["!!!!! BOMBE ACTIVÉ !!!!!","PLAIN"];
- waitUntil {sleep 0.3;hintSilent parseText format ["<t size='1.1' color='#00FF00'>Vitesse de la cible :<t/><br/><t size='1.3' color='#FF0000'>%1 Km/h<t/>", round (speed _vehTarget)]; ((speed _vehTarget) <= 3) && (_vehTarget getVariable "Vehpiege");};
- titleText ["La cible est au point mort... BOOM","PLAIN"];
- hintSilent parseText format ["<t size='1.1' color='#00FF00'>Votre cible est...<t/><br/><t size='1.3' color='#FF0000'>MORTE<t/>",false];
- sleep 0.1 + random 0.4;
- _carc4 = "Bo_Mk82" createVehicle [0,0,9999];
- _carc4 setPos (getPos _vehTarget);
- _carc4 setVelocity [100,0,0];
- {
- _x setDamage 1;
- } forEach [_carc4,_vehTarget];
- sleep (4+random 5);
- [[1],format["Un attentat vient d'avoir lieux à la voiture piégé...\nTriste destin...",false]] remoteExecCall ["life_fnc_broadcast",RCLIENT];
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement