Mettre du nitro
-
<p style="margin:0px;padding:0px;color:rgb(40,40,40);font-family:helvetica, arial, sans-serif;line-height:22.4px;text-align:center;"><span style="font-family:georgia, serif;"><span style="font-size:24px;">Mettre du nitro </span></span></p><p style="margin-top:0px;margin-right:0px;margin-left:0px;padding:0px;color:rgb(40,40,40);font-family:helvetica, arial, sans-serif;line-height:22.4px;text-align:center;"><span style="font-size:18px;">Adapter pour la version 3.1.4.8 (La dernière de itsyuka)</span></p><p style="margin:0px;padding:0px;color:rgb(40,40,40);font-family:helvetica, arial, sans-serif;line-height:22.4px;">Pour commencer on va créée l'item "nitro" :</p><p style="margin-top:0px;margin-right:0px;margin-left:0px;padding:0px;color:rgb(40,40,40);font-family:helvetica, arial, sans-serif;line-height:22.4px;">Vous aller dans le fichier fn_VarHandle.sqf pour y rajoutez dans la case 0 dans le switch</p><pre class="ipsCode prettyprint">case 0:
{
switch (_mode) do
{
case 0:
{
switch (_var) do
{
case "nitro": {"life_inv_nitro"};
};
};</pre><p><span style="color:rgb(40,40,40);font-family:georgia, serif;line-height:22.4px;">Maintenant vous aller juste en bas dans case 1</span></p><pre class="ipsCode prettyprint">case 1:
{
switch (_var) do
{
case "life_inv_nitro": {"nitro"};
};
};
};</pre><p style="margin:0px;padding:0px;color:rgb(40,40,40);font-family:helvetica, arial, sans-serif;line-height:22.4px;"><span style="font-family:georgia, serif;">Voila maintenant l'items créer on va le configurer pour ça il faut aller dans le fichier Config_Master.hpp</span></p><p style="margin-top:0px;margin-right:0px;margin-left:0px;padding:0px;color:rgb(40,40,40);font-family:helvetica, arial, sans-serif;line-height:22.4px;"><span style="font-family:georgia, serif;">puis aller dans la class VirtuelItems </span></p><pre class="ipsCode prettyprint">//Virtual Items
class VirtualItems {
VITEMMACRO(nitro,"Nitro",nitro,5,1500,0,-1,false,-1,"")
}; </pre><p style="margin:0px;padding:0px;color:rgb(40,40,40);font-family:helvetica, arial, sans-serif;line-height:22.4px;"><span style="font-family:georgia, serif;">Voila vous rajouter ça puis vous pouvez configurer le poids le prix ... </span></p><p style="margin:0px;padding:0px;color:rgb(40,40,40);font-family:helvetica, arial, sans-serif;line-height:22.4px;"><span style="font-family:georgia, serif;">et pour terminer la config il faut aller dans le fichier fn_useItem.sqf</span></p><p style="margin-top:0px;margin-right:0px;margin-left:0px;padding:0px;color:rgb(40,40,40);font-family:helvetica, arial, sans-serif;line-height:22.4px;"><span style="font-family:georgia, serif;">Vous rajouter ça a la fin avant Default </span> </p><pre class="ipsCode prettyprint">case (EQUAL(_item,"nitro")): {
if(vehicle player != player) exitWith {hint "Nitro Activer"};
[] spawn life_fnc_nitroUse;
else {
hint format ["Il faut etre dans un vehicule pour utiliser %1",player ]
}
}; </pre><p style="margin:0px;padding:0px;color:rgb(40,40,40);font-family:helvetica, arial, sans-serif;line-height:22.4px;"><span style="font-family:georgia, serif;">Puis vous allez dans le fichier de configuration des touches fn_KeyHandler.sqf</span></p><p style="margin-top:0px;margin-right:0px;margin-left:0px;padding:0px;color:rgb(40,40,40);font-family:helvetica, arial, sans-serif;line-height:22.4px;"><span style="font-family:georgia, serif;">vous rajouter ça ou vous voulez de façon logique bien sur ^^ </span></p><pre class="ipsCode prettyprint">//N Touche Nitro
case 49:
if([false,"nitro",1] call life_fnc_handleInv) then
{
[] spawn life_fnc_nitroUse;
}
}</pre><p><span style="color:rgb(40,40,40);font-family:georgia, serif;line-height:22.4px;">Pour finir vous créer un fichier fn_nitroUse.sqf dans \Altis-Life-master\extDB-Build\Altis_Life.Altis\core\items</span></p><pre class="ipsCode prettyprint">/*fn_nitroUse.sqf
Adapter pour altis life par HamzaDams
By: Hellop 2008
Copyright: Released to the Public Domain. It would be cool if you gave me credit in your mission if you use it.
Purpose: Simulate Nitrous Oxide speed-boost for vehicles. Sets global variable on client computer, cli_nitroLock
so that the nitro can't be engaged more than once at at time.Pre: 1. Global var: cli_nitroLock = true;
2. Player's vehicle has an action menu item enabled that runs this script. e.g. in the initline of a car/tank:
this addEventHandler ["getin", {
if ((_this select 1) == "driver") then {
actionIDNitro = _this select 0 addAction ["Nitro", "client\action\fn_nitroUse.sqf"];
};
}];
this addEventHandler ["getout", {_this select 0 removeAction actionIDNitro;}];Post: cli_nitroLock is set to true;
Testing: 5 min. reverse doesn't work. Would be nice if it worked dynamically from vehicle weight/maxspeed.
Air Vehicles not tested.
*/private ["_obj", "_vel", "_tmrInterval", "_dir", "_maxSpeed"];
_actionID = _this select 2;
_obj = vehicle player;
//Tanks and stuff get less nitro.
_tmrInterval = .1;
_maxSpeed = 120;
_speedMultiplier = .4; //2 is good for cars, too much for tanks
_nitroDuration = 5;if ((typeOf _obj) isKindOf "Car") then {
_tmrInterval = .02;
_maxSpeed = 180;
_speedMultiplier = 1.5;
};if ((typeOf _obj) isKindOf "Air") then {
_tmrInterval = .02;
_maxSpeed = 500; //What is best val here?
_speedMultiplier = .3;
};if ((typeOf _obj) isKindOf "Motorcycle") then {
_tmrInterval = .02;
_maxSpeed = 140; //What is best val here?
_speedMultiplier = .2;
};//Initialize vars;
_vel = 0;
_velX = 0;
_velY = 0;
_velZ =0;
_dir = 0;
_sinDir = 0;
_cosDir = 0;
_previousVel = velocity _obj;
_previousSpeed = speed _obj;
_curSpeed = 0;
if ((speed _obj) <= 3) then {
player sideChat format ["Vous devez être en mouvement pour activer Nitro."];
}
else {
if (cli_nitroLock) then {
cli_nitroLock = false;
player sideChat format ["Nitro engagé."];
//player globalchat format["Time: %1, Vehicle Type: %2, MaxSpeed: %3", time, typeOf _obj, _maxSpeed];
_startTime = time;
_tmpSpeedMultiplier = _speedMultiplier;
while {(time - _startTime) < _nitroDuration} do {
sleep _tmrInterval;
_vel = velocity _obj;
_curSpeed = (speed _obj);
if (((abs _curSpeed) - (abs _previousSpeed)) > 30) then {_vel = _previousVel}; //To prevent getting thrown far in collisions
_velX = _vel select 0;
_velY = _vel select 1;
_velZ = _vel select 2;
_dir = getdir _obj;
//player globalChat format ["Speed: %1", speed _obj];
if ((speed _obj) > _maxSpeed) then {_tmpSpeedMultiplier = 0} else {_tmpSpeedMultiplier = _speedMultiplier};
_sinDir = _tmpSpeedMultiplier*(sin _dir);
_cosDir = _tmpSpeedMultiplier*(cos _dir);
_obj setvelocity [_velX + _sinDir, _velY + _cosDir, _velZ -.1]; //Keep Z vector moving with gravity
_previousSpeed = _curSpeed;
_previousVel = _vel;
};
cli_nitroLock = true;
player sideChat format ["Test Nitro Fait ! Vel: %1. Dir: %2, Speed: %3", velocity _obj, direction _obj, speed _obj];
};
};</pre><p><span style="color:rgb(40,40,40);font-family:helvetica, arial, sans-serif;line-height:22.4px;">Voila j’espère ça marchera pour tout le monde et que j'ai été le plus claire ^^ Faite moi des retour</span></p>
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login