Advertisement
Guest User

Untitled

a guest
Mar 18th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.68 KB | None | 0 0
  1. #include "..\..\script_macros.hpp"
  2. /*
  3.     File: fn_copInteractionMenu.sqf
  4.     Author: Bryan "Tonic" Boardwine
  5.  
  6.     Description:
  7.     Replaces the mass addactions for various cop actions towards another player.
  8. */
  9. #define Btn1 37450
  10. #define Btn2 37451
  11. #define Btn3 37452
  12. #define Btn4 37453
  13. #define Btn5 37454
  14. #define Btn6 37455
  15. #define Btn7 37456
  16. #define Btn8 37457
  17. #define Btn9 37458
  18. #define Btn10 37459
  19. #define Title 37401
  20.  
  21. private ["_display","_curTarget","_seizeRank","_Btn1","_Btn2","_Btn3","_Btn4","_Btn5","_Btn6","_Btn7","_Btn8","_Btn9","_Btn10"];
  22.  
  23. disableSerialization;
  24. _curTarget = param [0,objNull,[objNull]];
  25. _seizeRank = LIFE_SETTINGS(getNumber,"seize_minimum_rank");
  26.  
  27. if (player getVariable ["Escorting", false]) then {
  28.     if (isNull _curTarget) exitWith {closeDialog 0;}; //Bad target
  29.     if (!isPlayer _curTarget && side _curTarget isEqualTo civilian) exitWith {closeDialog 0;}; //Bad side check?
  30.     if (player distance _curTarget > 4 ) exitWith {closeDialog 0;}; // Prevents menu accessing from far distances.
  31. };
  32.  
  33. if (!dialog) then {
  34.     createDialog "pInteraction_Menu";
  35. };
  36.  
  37. _display = findDisplay 37400;
  38. _Btn1 = _display displayCtrl Btn1;
  39. _Btn2 = _display displayCtrl Btn2;
  40. _Btn3 = _display displayCtrl Btn3;
  41. _Btn4 = _display displayCtrl Btn4;
  42. _Btn5 = _display displayCtrl Btn5;
  43. _Btn6 = _display displayCtrl Btn6;
  44. _Btn7 = _display displayCtrl Btn7;
  45. _Btn8 = _display displayCtrl Btn8;
  46. life_pInact_curTarget = _curTarget;
  47.  
  48. if (player getVariable ["isEscorting",false]) then {
  49.     { _x ctrlShow false; } forEach [_Btn1,_Btn2,_Btn3,_Btn5,_Btn6,_Btn7,_Btn8];
  50. };
  51.  
  52. //Set Unrestrain Button
  53. _Btn1 ctrlSetText localize "STR_pInAct_Unrestrain";
  54. _Btn1 buttonSetAction "[life_pInact_curTarget] call life_fnc_unrestrain; closeDialog 0;";
  55.  
  56. //Set Check Licenses Button
  57. _Btn2 ctrlSetText localize "STR_pInAct_checkLicenses";
  58. _Btn2 buttonSetAction "[player] remoteExecCall [""life_fnc_licenseCheck"",life_pInact_curTarget]; closeDialog 0;";
  59.  
  60. //Set Search Button
  61. _Btn3 ctrlSetText localize "STR_pInAct_SearchPlayer";
  62. _Btn3 buttonSetAction "[life_pInact_curTarget] spawn life_fnc_searchAction; closeDialog 0;";
  63.  
  64. //Set Escort Button
  65. if (player getVariable ["isEscorting",false]) then {
  66.     _Btn4 ctrlSetText localize "STR_pInAct_StopEscort";
  67.     _Btn4 buttonSetAction "[] call life_fnc_stopEscorting; closeDialog 0;";
  68. } else {
  69.     _Btn4 ctrlSetText localize "STR_pInAct_Escort";
  70.     _Btn4 buttonSetAction "[life_pInact_curTarget] call life_fnc_escortAction; closeDialog 0;";
  71. };
  72.  
  73. //Set Ticket Button
  74. _Btn5 ctrlSetText localize "STR_pInAct_TicketBtn";
  75. _Btn5 buttonSetAction "[life_pInact_curTarget] call life_fnc_ticketAction;";
  76.  
  77. _Btn6 ctrlSetText localize "STR_pInAct_Arrest";
  78. _Btn6 buttonSetAction "[life_pInact_curTarget] call life_fnc_arrestAction; closeDialog 0;";
  79. _Btn6 ctrlEnable false;
  80.  
  81. _Btn7 ctrlSetText localize "STR_pInAct_PutInCar";
  82. _Btn7 buttonSetAction "[life_pInact_curTarget] call life_fnc_putInCar; closeDialog 0;";
  83.  
  84. //SeizeWeapons Button
  85. _Btn8 ctrlSetText localize "STR_pInAct_Seize";
  86. _Btn8 buttonSetAction "[life_pInact_curTarget] spawn life_fnc_seizePlayerAction; closeDialog 0;";
  87.  
  88. if (FETCH_CONST(life_coplevel) < _seizeRank) then {_Btn8 ctrlEnable false;};
  89.  
  90. {
  91.     if ((player distance (getMarkerPos _x) <30)) exitWith { _Btn6 ctrlEnable true;};
  92. } forEach LIFE_SETTINGS(getArray,"sendtoJail_locations");
  93.  
  94. //Sit Suspect
  95. _Btn9 ctrlSetText localize "STR_Sit_Suspect";  
  96. _Btn9 buttonSetAction "[player] remoteExecCall [""life_fnc_copSit"",life_pInact_curTarget]; closeDialog 0;";
  97.  
  98. //Stand Suspect
  99. _Btn10 ctrlSetText localize "STR_Stand_Suspect";
  100. _Btn10 buttonSetAction "[player] remoteExecCall [""life_fnc_copStand"",life_pInact_curTarget]; closeDialog 0;";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement