Jump to content
sina alex

[need help] GUI Editor

Recommended Posts

hello 

 

i use gui editor and create a tablet.

and whats the plan: the tablet that have 3 picture(each picture are clickable) and when player click picture a loadout apply on him as this code:

question 1 : how i can tell who active addeventhandler to group him,and apply loadout on his group?

question 2 : wich code i need to close tablet as a exit button?

 

[] spawn {
    waitUntil {sleep 0.0000001; !isNull (findDisplay 46)};
    methembyguimenu1 = (findDisplay 46) displayAddEventHandler ["KeyDown", "if ((_this select 1) == 210) then {
    [] spawn ArsenalDevice;
    };"];
 
	ArsenalDevice = {
	_display = findDisplay 46 createDisplay "RscDisplayEmpty";
_guiphone = _display ctrlCreate ["RscPicture", 1200];
_guiphone ctrlSetText "pb.paa";
_guiphone ctrlSetPosition [0.2375, 0.004, 0.5, 1];
_guiphone ctrlCommit 0;

_buttenarmy = _display ctrlCreate ["RscActivePicture", 1201];
_buttenarmy ctrlAddEventHandler ["MouseButtonDown", "_this call fnc_armyloadout"];
_buttenarmy ctrlSetText "army.paa";
_buttenarmy ctrlSetPosition [0.38, 0.26, 0.2125, 0.08];
_buttenarmy ctrlCommit 0;

_buttensns = _display ctrlCreate ["RscActivePicture", 1202];
_buttensns ctrlAddEventHandler ["MouseButtonDown", "_this call fnc_snloadout"];
_buttensns ctrlSetText "sns.paa";
_buttensns ctrlSetPosition [0.38, 0.36, 0.2125, 0.08];
_buttensns ctrlCommit 0;

_buttennop = _display ctrlCreate ["RscActivePicture", 1203];
_buttennop ctrlAddEventHandler ["MouseButtonDown", "_this call fnc_noploadout"];
_buttennop ctrlSetText "nop.paa";
_buttennop ctrlSetPosition [0.38, 0.464, 0.2125, 0.08];
_buttennop ctrlCommit 0;

fnc_armyloadout = {
_pg = _this select 0; 
"laa" remoteExec ["playSound"]; 
hint "loading";
{
removeAllWeapons _x; 
removeAllItems _x; 
removeAllAssignedItems _x; 
removeUniform _x; 
removeVest _x; 
removeBackpack _x; 
removeHeadgear _x; 
removeGoggles _x; 
_x addWeapon "CUP_arifle_G3A3_ris_black"; 
_x addPrimaryWeaponItem "CUP_20Rnd_762x51_G3"; 
_x addPrimaryWeaponItem "CUP_bipod_G3"; 
_x addWeapon "CUP_launch_RPG7V"; 
_x addSecondaryWeaponItem "CUP_optic_PGO7V3"; 
_x addSecondaryWeaponItem "CUP_PG7V_M"; 
_x addWeapon "rhsusf_weap_m9"; 
_x addHandgunItem "rhsusf_mag_15Rnd_9x19_JHP"; 
_x forceAddUniform "rpat_urban_1_uniform"; 
_x addVest "ARMY_V_PlateCarrier_ACU_L"; 
_x addBackpack "B_Carryall_oucamo"; 
_x addWeapon "rhsusf_bino_m24_ARD"; 
for "_i" from 1 to 5 do {_x addItemToUniform "ACE_packingBandage";}; 
for "_i" from 1 to 4 do {_x addItemToUniform "ACE_morphine";}; 
for "_i" from 1 to 4 do {_x addItemToUniform "ACE_tourniquet";}; 
for "_i" from 1 to 15 do {_x addItemToUniform "ACE_fieldDressing";}; 
for "_i" from 1 to 5 do {_x addItemToVest "CUP_20Rnd_TE1_Yellow_Tracer_762x51_G3";}; 
for "_i" from 1 to 2 do {_x addItemToVest "SmokeShell";}; 
for "_i" from 1 to 2 do {_x addItemToVest "rhsusf_mag_15Rnd_9x19_JHP";}; 
for "_i" from 1 to 2 do {_x addItemToVest "rhs_mag_m67";}; 
for "_i" from 1 to 49 do {_x addItemToBackpack "ACE_fieldDressing";}; 
for "_i" from 1 to 30 do {_x addItemToBackpack "ACE_morphine";}; 
for "_i" from 1 to 4 do {_x addItemToBackpack "ACE_tourniquet";}; 
_x addItemToBackpack "ACE_Flashlight_XL50"; 
_x addItemToBackpack "ACE_IR_Strobe_Item"; 
_x addItemToBackpack "ACE_EntrenchingTool"; 
for "_i" from 1 to 3 do {_x addItemToBackpack "ACE_epinephrine";}; 
_x addItemToBackpack "ACE_EarPlugs"; 
_x addItemToBackpack "ACE_SpraypaintBlue"; 
_x addItemToBackpack "ACE_SpraypaintBlack"; 
_x addHeadgear "marpat_urban_helmet"; 
_x linkItem "ItemMap"; 
_x linkItem "ItemCompass"; 
_x linkItem "tf_microdagr"; 
_x linkItem "tf_anprc152"; 
_x linkItem "ItemGPS"; 
_x linkItem "rhsusf_ANPVS_15";  
} foreach _pg;
};

	};
 
};

 

Share this post


Link to post
Share on other sites
On 11/3/2020 at 6:02 PM, sina alex said:

when player click picture a loadout apply on him

On 11/3/2020 at 6:02 PM, sina alex said:

how i can tell who active addeventhandler

The person using a UI is the player.

 

On 11/3/2020 at 6:02 PM, sina alex said:

wich code i need to close tablet as a exit button?

_buttenExit = _display ctrlCreate ["RscActivePicture", 1205];
_buttonExit ctrlSetText "\a3\ui_f\data\gui\rsc\rscdisplayarcademap\icon_exit_cross_ca.paa";
_buttenExit ctrlAddEventHandler ["MouseButtonDown", {
	params[ "_ctrl" ];
	_display = displayParent _ctrl;
	
	_display closeDisplay 1;
}];

 

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites
11 hours ago, Larrow said:

The person using a UI is the player.

 


_buttenExit = _display ctrlCreate ["RscActivePicture", 1205];
_buttonExit ctrlSetText "\a3\ui_f\data\gui\rsc\rscdisplayarcademap\icon_exit_cross_ca.paa";
_buttenExit ctrlAddEventHandler ["MouseButtonDown", {
	params[ "_ctrl" ];
	_display = displayParent _ctrl;
	
	_display closeDisplay 1;
}];

 

I will test it,thank you

Share this post


Link to post
Share on other sites
14 hours ago, Larrow said:

The person using a UI is the player.

 


_buttenExit = _display ctrlCreate ["RscActivePicture", 1205];
_buttonExit ctrlSetText "\a3\ui_f\data\gui\rsc\rscdisplayarcademap\icon_exit_cross_ca.paa";
_buttenExit ctrlAddEventHandler ["MouseButtonDown", {
	params[ "_ctrl" ];
	_display = displayParent _ctrl;
	
	_display closeDisplay 1;
}];

 

 

14 hours ago, Larrow said:

The person using a UI is the player.

 


_buttenExit = _display ctrlCreate ["RscActivePicture", 1205];
_buttonExit ctrlSetText "\a3\ui_f\data\gui\rsc\rscdisplayarcademap\icon_exit_cross_ca.paa";
_buttenExit ctrlAddEventHandler ["MouseButtonDown", {
	params[ "_ctrl" ];
	_display = displayParent _ctrl;
	
	_display closeDisplay 1;
}];

 

i want use it on a dedicated mp server.

if i use player for apply loadouts it will not apply to every player in server??
i want apply just on who use menu

Share this post


Link to post
Share on other sites
18 hours ago, sina alex said:

if i use player for apply loadouts it will not apply to every player in server??
i want apply just on who use menu

So which is it? Apply to ever player OR just the player that uses the UI.

If its just the user that uses the UI then it must be the player. For a UI to be seen then it must be being used on a client/player.

 

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×