Français Interaction Police sans avoir les menottes

  • Auteur de la discussion Auteur de la discussion I'm the Boss
  • Date de début Date de début

I'm the Boss

Leader
Membre du personnel
2/1/20
701
3
44
1 100
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;
2- Déclaration du script :

  • 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:
Bonjour,

Si on possède le Radial Menu ? Il n'y a pas une configuration qui nous permet de faire en sorte qu'il soit menotté ou non, on peut accéder au menu?

Merci d'avance!
 
Dans ton fn_actionKeyHandler.sqf, en dessous de :
Code:
if ((_curObject getVariable ["restrained",false]) && !dialog && playerSide isEqualTo west) then {
    ["cop_interaction"] spawn CBX_fnc_openInteraction;
};
ajoute :
Code:
if (!(_curObject getVariable ["restrained",false]) && !dialog && playerSide isEqualTo west) then {
    ["cop_interaction2"] spawn CBX_fnc_openInteraction;
};

Ensuite dans ton config_button.hpp de Radial Menu, en dessous de :
Code:
class interationCfg {
ajoute :
Code:
class cop_interaction2 {
    class button_1 {
        displayName = "STR_pInAct_checkLicenses";
        buttonAction = "[player] remoteExecCall [""life_fnc_licenseCheck"",cursorObject]; closeDialog 0;";
        buttonToolTip = "";
        side[] = {west};
        disable = false;
        condition = "";
    };

    class button_2 {
        displayName = "STR_pInAct_SearchPlayer";
        buttonAction = "[cursorObject] spawn life_fnc_searchAction; closeDialog 0;";
        buttonToolTip = "";
        side[] = {west};
        disable = false;
        condition = "";
    };

    class button_3 {
        displayName = "STR_pInAct_TicketBtn";
        buttonAction = "[cursorObject] call life_fnc_ticketAction;";
        buttonToolTip = "";
        side[] = {west};
        disable = false;
        condition = "";
    };

    class button_4 {
        displayName = "STR_pInAct_Seize";
        buttonAction = "[cursorObject] spawn life_fnc_seizePlayerAction; closeDialog 0;";
        buttonToolTip = "";
        side[] = {west};
        disable = false;
        condition = "call life_coplevel > getNumber (missionConfigFile >> 'Life_Settings' >> 'seize_minimum_rank')";
    };

    class button_5 {
        displayName = "Driving licence";
        buttonAction = "[] remoteExec ['max_permisPoints_fnc_getPermisInfo',cursorObject];"; 
        buttonToolTip = "";
        side[] = {west};
        disable = false;
        condition = "((getNumber (missionConfigFile >> ""The_Programmer_Settings_RadialMenu"" >> ""points_driving_license"")) isEqualTo 1)";
    };
};