ok done:
I've tried to add a right click option to the e-tool which start a building process for a booby trap.
This is all untested so far, but hopefully should work ^^ otherwise i will check the whole thing till its working.
Anyway
Here are the files:
https://www.dropbox.com/s/45sfd0t1rqt85f5/new_Mission.rar?dl=0
Following changes i made in your mission and server.pbo:
compiles.sqf:
ui_selectSlot.sqf
alot of things in the player_build.sqf better you compare it with the default to see the whole changes.
server_monitor:
I do not take any credits for this script, i just combined some scripts here and there to get this working. This is not tested but the right way, just test it and tell me the results. If its not working tell me or try to fix it for yourself
Anyway have fun with this so far
I've tried to add a right click option to the e-tool which start a building process for a booby trap.
This is all untested so far, but hopefully should work ^^ otherwise i will check the whole thing till its working.
Anyway
Here are the files:
https://www.dropbox.com/s/45sfd0t1rqt85f5/new_Mission.rar?dl=0
Following changes i made in your mission and server.pbo:
compiles.sqf:
Code:
player_build = compile preprocessFileLineNumbers "custom\player_build.sqf";
player_selectSlot = compile preprocessFileLineNumbers "custom\ui_selectSlot.sqf";
_null = [] execVM "scripts\player_bomb.sqf";
ui_selectSlot.sqf
Code:
if (_item == "ItemEtool") then
{
_menu = _parent displayCtrl (1600 + _numActions);
_menu ctrlShow true;
_text = "Flare Trap";
_script = "[""Land_IED_v4_PMC"",[""ItemEtool""],[[""HandGrenade_West"", 1],[""PartGeneric"", 1]],[0,6,0]] execVM ""custom\player_build.sqf"";";
_height = _height + (0.025 * safezoneH);
uiNamespace setVariable ['uiControl', _control];
_menu ctrlSetText _text;
_menu ctrlSetEventHandler ["ButtonClick",_script];
};
alot of things in the player_build.sqf better you compare it with the default to see the whole changes.
server_monitor:
Code:
//Handle Traps (Land_IED_v4_PMC)
if (typeOf(_object) == "Land_IED_v4_PMC") then {
_object setVariable ["isBomb", 1, true];//this will be known as a bomb instead of checking with classnames in player_bomb
_object addEventHandler ["HandleDamage", {false}];
};
I do not take any credits for this script, i just combined some scripts here and there to get this working. This is not tested but the right way, just test it and tell me the results. If its not working tell me or try to fix it for yourself
Anyway have fun with this so far