Ce tutoriel vous permettra de faire "Windows" en tant que policier sur les civils non menotté...
1 - Création du fichier fn_copInteractionMenu2.sqf :
- Allez dans votre dossier Altis_Life.Altis\core\cop
- Ajouter un fichier nommer fn_copInteractionMenu2.sqf
- Copier/Coller le code ci-dessous dans le fichier :
Code:
#include "..\..\script_macros.hpp"
/*
File: fn_copInteractionMenu.sqf
Author: Bryan "Tonic" Boardwine
Description:
Replaces the mass addactions for various cop actions towards another player.
*/
#define Btn1 37450
#define Btn2 37451
#define Btn3 37452
#define Btn4 37453
#define Btn5 37454
#define Btn6 37455
#define Btn7 37456
#define Btn8 37457
#define Title 37401
private ["_display","_curTarget","_seizeRank","_Btn1","_Btn2","_Btn3","_Btn4","_Btn5","_Btn6","_Btn7","_Btn8"];
disableSerialization;
_curTarget = param [0,objNull,[objNull]];
_seizeRank = LIFE_SETTINGS(getNumber,"seize_minimum_rank");
if (player getVariable ["Escorting", false]) then {
if (isNull _curTarget) exitWith {closeDialog 0;}; //Bad target
if (!isPlayer _curTarget && side _curTarget isEqualTo civilian) exitWith {closeDialog 0;}; //Bad side check?
if (player distance _curTarget > 4 ) exitWith {closeDialog 0;}; // Prevents menu accessing from far distances.
};
if (!dialog) then {
createDialog "pInteraction_Menu";
};
_display = findDisplay 37400;
_Btn1 = _display displayCtrl Btn1;
_Btn2 = _display displayCtrl Btn2;
_Btn3 = _display displayCtrl Btn3;
_Btn4 = _display displayCtrl Btn4;
_Btn5 = _display displayCtrl Btn5;
_Btn6 = _display displayCtrl Btn6;
_Btn7 = _display displayCtrl Btn7;
_Btn8 = _display displayCtrl Btn8;
life_pInact_curTarget = _curTarget;
// Vérification des papiers
_Btn1 ctrlSetText localize "STR_pInAct_checkLicenses";
_Btn1 buttonSetAction "[player] remoteExecCall [""life_fnc_licenseCheck"",life_pInact_curTarget]; closeDialog 0;";
// Fouille du joueur
_Btn2 ctrlSetText localize "STR_pInAct_SearchPlayer";
_Btn2 buttonSetAction "[life_pInact_curTarget] spawn life_fnc_searchAction; closeDialog 0;";
// Amendes
_Btn3 ctrlSetText localize "STR_pInAct_TicketBtn";
_Btn3 buttonSetAction "[life_pInact_curTarget] call life_fnc_ticketAction;";
// Saisie armes
_Btn4 ctrlSetText localize "STR_pInAct_Seize";
_Btn4 buttonSetAction "[life_pInact_curTarget] spawn life_fnc_seizePlayerAction; closeDialog 0;";
// Boutons Libre
_Btn5 ctrlShow false;
_Btn6 ctrlShow false;
_Btn7 ctrlShow false;
_Btn8 ctrlShow false;
- Rendez-vous dans Altis_Life.Altis\Functions.hpp
- Cherchez dans le Functions.hpp :
Code:
class copInteractionMenu {};
- Et ajoutez en-dessous :
Code:
class copInteractionMenu2 {};
3 - Mise en place de l'action :
- Ouvrez le fichier Altis_Life.Altis\core\functions\fn_actionKeyHandler.sqf
- Cherchez : (Ligne 94 de base)
Code:
if ((_curObject getVariable ["restrained",false]) && !dialog && playerSide isEqualTo west) then {
[_curObject] call life_fnc_copInteractionMenu;
};
- Et ajoutez en-dessous :
Code:
if (!(_curObject getVariable["restrained",false]) && !dialog && playerSide isEqualTo west) then {
[_curObject] call life_fnc_copInteractionMenu2;
};
Voilà le script se termine là ! En espérant qu'il vous aura aidé
Dernière édition par un modérateur: