Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "..\..\script_macros.hpp"
- /*
- File: fn_civInteractionMenu.sqf
- Author: Bryan "Tonic" Boardwine
- Description:
- Replaces the mass addactions for various cop actions towards another player.
- */
- if(playerSide != civilian) exitWith {};
- #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 Btn9 37458
- #define Title 37401
- private["_display","_curTarget","_Btn1","_Btn2","_Btn3","_Btn4","_Btn5","_Btn6","_Btn7","_Btn8","_Btn9","_dis","_currplayer"];
- if(!dialog) then {
- createDialog "pInteraction_Menu";
- };
- disableSerialization;
- _curTarget = [_this,0,ObjNull,[ObjNull]] call BIS_fnc_param;
- if(isNull _curTarget) exitWith {closeDialog 0;}; //Bad target
- _currplayer = _curtarget;
- if(!isPlayer _curTarget && side _curTarget == civilian) exitWith {closeDialog 0;}; //Bad side check?
- _display = findDisplay 37400;
- _dis = 8;
- _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;
- _Btn9 = _display displayCtrl Btn9;
- life_pInact_curTarget = _curTarget;
- //Set Unrestrain Button
- _Btn1 ctrlSetText localize "STR_pInAct_Unrestrain";
- _Btn1 buttonSetAction "[life_pInact_curTarget] call life_fnc_unrestrain; closeDialog 0;";
- if((_curTarget getVariable["Escorting",true])) then {_Btn1 ctrlEnable false;};
- if(_currplayer distance player > _dis) then {_Btn1 ctrlEnable false;};
- //Set Escort Button
- if (player getVariable ["isEscorting",false]) then {
- _Btn2 ctrlSetText localize "STR_pInAct_StopEscort";
- _Btn2 buttonSetAction "[] call life_fnc_stopEscorting; closeDialog 0;";
- } else {
- _Btn2 ctrlSetText localize "STR_pInAct_Escort";
- _Btn2 buttonSetAction "[life_pInact_curTarget] call life_fnc_escortAction; closeDialog 0;";
- };
- /*if((_curTarget getVariable["Escorting",false])) then {
- _Btn2 ctrlSetText localize "STR_pInAct_StopEscort";
- _Btn2 buttonSetAction "[life_pInact_curTarget] call life_fnc_stopEscorting; [life_pInact_curTarget] call life_fnc_civInteractionMenu;";
- if(_currplayer distance player > _dis) then {_Btn2 ctrlEnable false;};
- } else {
- _Btn2 ctrlSetText localize "STR_pInAct_Escort";
- _Btn2 buttonSetAction "[life_pInact_curTarget] call life_fnc_escortAction; closeDialog 0;";
- if(_currplayer distance player > _dis) then {_Btn2 ctrlEnable false;};
- };*/
- //Put in Car Button
- _Btn3 ctrlSetText localize "STR_pInAct_PutInCar";
- _Btn3 buttonSetAction "[life_pInact_curTarget] call life_fnc_putInCar; closeDialog 0;";
- if(_currplayer distance player > _dis) then {_Btn3 ctrlEnable false;};
- //Pat Down Button
- _Btn4 ctrlSetText localize "STR_pInAct_PatDown";
- _Btn4 buttonSetAction "[life_pInact_curTarget] call life_fnc_patdown; closeDialog 0;";
- if(_currplayer distance player > _dis) then {_Btn4 ctrlEnable false;};
- _Btn5 ctrlShow false;
- _Btn6 ctrlShow false;
- _Btn7 ctrlShow false;
- _Btn8 ctrlShow false;
- _Btn9 ctrlShow false;
Advertisement
Add Comment
Please, Sign In to add comment