Hay, ich brauch mal euren Rat, und zwar habe ich den Civ interaktionsmenu eingebaut, damit diese alles über das Interaktions menü steuern können.
soweit klappt alles , leider kann ich dies öffnen obwohl kein Civ/ Spieler vor mir steht
Code
#include "..\..\script_macros.hpp"
/*
File: fn_civInteractionMenu.sqf
Author: John 'Hannibal' Smith
Description:
Setzt ein Interaktionsmenü für die Zivilisten
*/
#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","_Btn1","_Btn2","_Btn3","_Btn4","_Btn5","_Btn6","_Btn7","_Btn8"];
disableSerialization;
_curTarget = param [0,objNull,[objNull]];
if (player getVariable ["restrained", false]) then {
if (isNull _curTarget) exitWith {closeDialog 0;}; //Bad target
if (!isPlayer _curTarget) 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;
//Button 1
_Btn1 ctrlSetText "Lizenzen zeigen";
_Btn1 buttonSetAction "[] call life_fnc_Lizenzgeben;";;
//Button 2
_Btn2 ctrlSetText "Perso zeigen";
_Btn2 buttonSetAction "[] call fvs_fnc_zeigePerso;";
//Button 3
_Btn3 ctrlSetText "ausrauben";
_Btn3 buttonSetAction "[] call life_fnc_robAction;";
//Button 4
_Btn4 ctrlSetText localize "";
_Btn4 buttonSetAction "closeDialog 0;";
//Button 5
_Btn5 ctrlSetText localize "";
_Btn5 buttonSetAction "closeDialog 0;";
//Button 6
_Btn6 ctrlSetText localize "";
_Btn6 buttonSetAction "closeDialog 0;";
//Button 7
_Btn7 ctrlSetText localize "";
_Btn7 buttonSetAction "closeDialog 0;";
//Button 8
_Btn8 ctrlSetText localize "";
_Btn8 buttonSetAction "closeDialog 0;";
//SETZE false AUF true WENN DU DEN BUTTON ANGEZEIGT HABEN WILLST!
_Btn1 ctrlShow true;
_Btn2 ctrlShow true;
_Btn3 ctrlShow true;
_Btn4 ctrlShow false;
_Btn5 ctrlShow false;
_Btn6 ctrlShow false;
_Btn7 ctrlShow false;
_Btn8 ctrlShow false;
Alles anzeigen