Hey Ich habe gestern mal versucht ein Handschellenscript zu implementieren. Nun häng ich beim civinteraktionmenu fest ich pack euch mal alle files hier rein. Vielleicht findet ihr den fehler
Code: fn_vInteractionMenu.sqf
#include "..\..\script_macros.hpp"
/*
File: fn_vInteractionMenu.sqf
Author: Bryan "Tonic" Boardwine
Description:
Replaces the mass addactions for various vehicle actions
*/
#define Btn1 37450
#define Btn2 37451
#define Btn3 37452
#define Btn4 37453
#define Btn5 37454
#define Btn6 37455
#define Title 37401
private["_display","_curTarget","_Btn1","_Btn2","_Btn3","_Btn4","_Btn5","_Btn6","_dlcVehicles"];
if(!dialog) then {
createDialog "vInteraction_Menu";
};
disableSerialization;
_curTarget = param [0,ObjNull,[ObjNull]];
if(isNull _curTarget) exitWith {closeDialog 0;}; //Bad target
_isVehicle = if((_curTarget isKindOf "landVehicle") OR (_curTarget isKindOf "Ship") OR (_curTarget isKindOf "Air")) then {true} else {false};
if(!_isVehicle) exitWith {closeDialog 0;};
_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;
life_vInact_curTarget = _curTarget;
_dlcVehicles = ["C_Kart_01_Blu_F","C_Kart_01_Red_F","C_Kart_01_Fuel_F","C_Kart_01_Vrana_F","B_Heli_Transport_03_F","B_Heli_Transport_03_unarmed_F","O_Heli_Transport_04_F","O_Heli_Transport_04_ammo_F","O_Heli_Transport_04_bench_F","O_Heli_Transport_04_box_F","O_Heli_Transport_04_covered_F","O_Heli_Transport_04_fuel_F","O_Heli_Transport_04_medevac_F","O_Heli_Transport_04_repair_F"];
//Set Repair Action
_Btn1 ctrlSetText localize "STR_vInAct_Repair";
_Btn1 buttonSetAction "[life_vInact_curTarget] spawn life_fnc_repairTruck;";
if("ToolKit" in (items player) && (damage _curTarget < 1)) then {_Btn1 ctrlEnable true;} else {_Btn1 ctrlEnable false;};
if(playerSide == west) then {
_Btn2 ctrlSetText localize "STR_vInAct_Registration";
_Btn2 buttonSetAction "[life_vInact_curTarget] spawn life_fnc_searchVehAction;";
_Btn3 ctrlSetText localize "STR_vInAct_SearchVehicle";
_Btn3 buttonSetAction "[life_vInact_curTarget] spawn life_fnc_vehInvSearch;";
_Btn4 ctrlSetText localize "STR_vInAct_PullOut";
_Btn4 buttonSetAction "[life_vInact_curTarget] spawn life_fnc_pulloutAction;";
if(count crew _curTarget == 0) then {_Btn4 ctrlEnable false;};
_Btn5 ctrlSetText localize "STR_vInAct_Impound";
_Btn5 buttonSetAction "[life_vInact_curTarget] spawn life_fnc_impoundAction;";
if(_curTarget isKindOf "Ship") then {
_Btn6 ctrlSetText localize "STR_vInAct_PushBoat";
_Btn6 buttonSetAction "[] spawn life_fnc_pushObject; closeDialog 0;";
if(_curTarget isKindOf "Ship" && {local _curTarget} && {count crew _curTarget == 0}) then { _Btn6 ctrlEnable true;} else {_Btn6 ctrlEnable false};
} else {
if((typeOf (_curTarget) in _dlcVehicles) && !(288520 in getDLCs 1)) then {
if(_curTarget isKindOf "Air") then {
_Btn6 ctrlSetText localize "STR_vInAct_GetInHeli";
} else {
_Btn6 ctrlSetText localize "STR_vInAct_GetInKart";
};
_Btn6 buttonSetAction "player moveInDriver life_vInact_curTarget; closeDialog 0;";
if(count crew _curTarget == 0 && {canMove _curTarget} && {locked _curTarget == 0}) then {_Btn6 ctrlEnable true;} else {_Btn6 ctrlEnable false};
} else {
_Btn6 ctrlSetText localize "STR_vInAct_Unflip";
_Btn6 buttonSetAction "life_vInact_curTarget setPos [getPos life_vInact_curTarget select 0, getPos life_vInact_curTarget select 1, (getPos life_vInact_curTarget select 2)+0.5]; closeDialog 0;";
if(count crew _curTarget == 0 && {canMove _curTarget}) then { _Btn6 ctrlEnable false;} else {_Btn6 ctrlEnable true;};
};
};
} else {
if(_curTarget isKindOf "Ship") then {
_Btn2 ctrlSetText localize "STR_vInAct_PushBoat";
_Btn2 buttonSetAction "[] spawn life_fnc_pushObject; closeDialog 0;";
if(_curTarget isKindOf "Ship" && {local _curTarget} && {count crew _curTarget == 0}) then { _Btn2 ctrlEnable true;} else {_Btn2 ctrlEnable false};
} else {
if((typeOf (_curTarget) in _dlcVehicles) && !(288520 in getDLCs 1)) then {
if(_curTarget isKindOf "Air") then {
_Btn2 ctrlSetText localize "STR_vInAct_GetInHeli";
} else {
_Btn2 ctrlSetText localize "STR_vInAct_GetInKart";
};
_Btn2 buttonSetAction "player moveInDriver life_vInact_curTarget; closeDialog 0;";
if(count crew _curTarget == 0 && {canMove _curTarget} && {locked _curTarget == 0}) then {_Btn2 ctrlEnable true;} else {_Btn2 ctrlEnable false};
} else {
_Btn2 ctrlSetText localize "STR_vInAct_Unflip";
_Btn2 buttonSetAction "life_vInact_curTarget setPos [getPos life_vInact_curTarget select 0, getPos life_vInact_curTarget select 1, (getPos life_vInact_curTarget select 2)+0.5]; closeDialog 0;";
if(count crew _curTarget == 0 && {canMove _curTarget}) then { _Btn2 ctrlEnable false;} else {_Btn2 ctrlEnable true;};
};
};
if(typeOf _curTarget == "O_Truck_03_device_F") then {
_Btn3 ctrlSetText localize "STR_vInAct_DeviceMine";
_Btn3 buttonSetAction "[life_vInact_curTarget] spawn life_fnc_deviceMine";
if(!isNil {(_curTarget getVariable "mining")} OR !local _curTarget && {_curTarget in life_vehicles}) then {
_Btn3 ctrlEnable false;
} else {
_Btn3 ctrlEnable true;
};
} else {
_Btn3 ctrlShow false;
};
if(license_civ_rebel) then {
_Btn4 ctrlSetText localize "STR_vInAct_PullOut";
_Btn4 buttonSetAction "[life_vInact_curTarget] spawn life_fnc_pulloutAction;";
if(count crew _curTarget == 0) then {_Btn4 ctrlEnable false;};
} else{
_Btn4 ctrlShow false;
};
_Btn5 ctrlShow false;
_Btn6 ctrlShow false;
};
Alles anzeigen
Code: fn_actionKeyHandler.sqf
if(isPlayer _curObject && _curObject isKindOf "Man") then {
if((_curObject getVariable ["restrained",false]) && !dialog && playerSide == west) then {
[_curObject] call life_fnc_copInteractionMenu;
};
if ((_curObject getVariable ["restrained",false]) && !dialog && playerSide == civilian) then {
[_curObject] call life_fnc_civInteractionMenu;
};
} else {
Code: fn_civInterationMenu.sqf
#include "..\..\script_macros.hpp"
/*
File: fn_civInteractionMenu.sqf
Author:
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 Btn9 37458
#define Title 37401
private["_display","_curTarget","_seizeRank","_Btn1","_Btn2","_Btn3","_Btn4","_Btn5","_Btn6","_Btn7","_Btn9"];
disableSerialization;
_curTarget = param [0,ObjNull,[ObjNull]];
if(isNull _curTarget) exitWith {closeDialog 0;}; //Bad target
if(!dialog) then {
createDialog "pInteraction_Menu";
};
if(!isPlayer _curTarget && side _curTarget == civilian) exitWith {closeDialog 0;}; //Bad side check?
if(player distance _curTarget > 5 ) exitWith {closeDialog 0;}; // Prevents menu accessing from far distances.
_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;
_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;";
//Set Escort Button
_Btn2 ctrlSetText localize "STR_pInAct_Escort";
_Btn2 buttonSetAction "[life_pInact_curTarget] call life_fnc_escortAction; closeDialog 0;";
_Btn3 ctrlSetText localize "STR_pInAct_StopEscort";
_Btn3 buttonSetAction "[life_pInact_curTarget] call life_fnc_stopEscorting; [life_pInact_curTarget] call life_fnc_civInteractionMenu;";
_Btn4 ctrlSetText localize "STR_pInAct_PutInCar";
_Btn4 buttonSetAction "[life_pInact_curTarget] call life_fnc_putInCar;";
Alles anzeigen
Code
#include "..\..\script_macros.hpp"
/*
File: fn_restrainAction.sqf
Author: Bryan "Tonic" Boardwine
Description:
Retrains the target.
*/
private["_unit"];
_unit = cursorObject;
if(isNull _unit) exitWith {}; //Not valid
if((player distance _unit > 3)) exitWith {};
if((_unit getVariable "restrained")) exitWith {};
if(side _unit isEqualTo west) exitWith {};
if(player isEqualTo _unit) exitWith {};
if (side player isEqualTo civilian) then {
if(life_inv_zipties < 1) exitWith { hintSilent "You dont have any zipties"; };
life_inv_zipties = life_inv_zipties - 1;
hintSilent "You have ziptied him";
};
if(!isPlayer _unit) exitWith {};
//Broadcast!
_unit setVariable["restrained",true,true];
[player] remoteExec ["life_fnc_restrain",_unit];
[0,"STR_NOTF_Restrained",true,[_unit getVariable["realname", name _unit], profileName]] remoteExecCall ["life_fnc_broadcast",west];
Alles anzeigen
Code: Config_vItems.hpp
class zipties {
variable = "zipties";
displayName = "STR_Item_ZipTies";
weight = 0;
buyPrice = 1200;
sellPrice = -1;
illegal = true;
edible = -1;
icon = "icons\ziptie.paa";
};
Code: fn_keyHandler.sqf
case 48: {
if(_shift) then {_handled = true;}; //This makes it so they have to hold shift + key(48) to work.
if(playerSide in [west,independent]) exitWith {};//Makes it so police and EMS cant zip tie people
if !(license_civ_rebel) exitWith { hintSilent "You need a rebel training!"; };//Add required license's. Remove the whole line if you dont want any checks
if(_shift && playerSide == civilian && !isNull cursorTarget && cursorTarget isKindOf "Man" && (isPlayer cursorTarget) && (side cursorTarget in [civilian,east]) && alive cursorTarget && cursorTarget distance player < 3.5 && !(cursorTarget getVariable "Escorting") && !(cursorTarget getVariable "restrained") && speed cursorTarget < 1) then
{
if([false,"zipties",1] call life_fnc_handleInv) then//Removes the zipties from the inventory
{
[] call life_fnc_RestrainAction;
hintSilent "You have cuffed him! ";
} else {
hintSilent "You don't have zipties";
};
};
Alles anzeigen