MH6
Member-
Content Count
63 -
Joined
-
Last visited
-
Medals
Everything posted by MH6
-
The default range of the AI mortars is fairly low I found. While they can hit me from about the distance of half of the airfield (i.e. them at one end and me in the middle), they cannot hit me from one end of the airfield if I am at the opposite end. I have yet to figure out a solution to this, because I know the mortars themselves can fire that distance if you set the range to "far". P.S. - Add this bit of code to determine if the AI are in fact capable of reaching the target location. if(_pos inRangeOfArtillery [[_mortar], "8Rnd_82mm_Mo_shells"]) then { hint "Target in range! Firing..."; } else { hint "Target out of range."; };
-
As 2nd Ranger said, commandArtilleryFire or doArtilleryFire work nicely. I implemented this yesterday using the latter command. On a somewhat related note, I also have a question: Is it possible to tell the AI mortar to switch the ranging mode? If the target position for the artillery barrage lies too far away, they won't fire--but it's only too far away if you are in the first two distance modes (close and medium or some such). If you are in "Far" mode, you can easily reach the target position. But I'm not sure if I can tell the AI to use that option. I can however do it manually if I get in the artillery piece and try to fire it myself. It seems like the AI defaults to Medium range, and refuses to fire at anything that would lay within the "Far" min/max ranges. Though it's possible it's just hard coded somewhere and impossible to change. I thought maybe I had to use a different type of ammunition, but it seems there is only one type of 82mm HE round.
-
Has anyone solved the problem of the C-130 ramp appearing closed while seated in the cargo bay? It looks fine if you're in third person or outside the vehicle, but inside it will always appear closed. I reckon this is because it uses a seperate model for interior rendering than it does exterior, so is there a way to find a handle to this interior model and animate the ramp open? (If it even has an open ramp animation...hope it does.)
-
RCon server administration coming to ArmA 2!
MH6 replied to $able's topic in ARMA 2 & OA - Servers & Administration
My stuff is currently being beta tested on the Legion of Sparta servers. Once all the kinks have been worked out, and once I can implement $able's fine work, I'll be releasing my apps to the public along with the source. There are two versions, a basic RCON tool where you can execute the usual ArmA admin commands, and an extended tool which adds support for SQL, File IO, HTTP/FTP, and whatever else people write plugins for. -
RCon server administration coming to ArmA 2!
MH6 replied to $able's topic in ARMA 2 & OA - Servers & Administration
:D -
SQL database and Arma 2
MH6 replied to pwnstar23's topic in ARMA 2 & OA : ADDONS - Configs & Scripting
Just a heads up, SpartaLib is now finalized and currently beginning testing over on the Sparta servers. When I am satisfied that SpartaLib is ready for public release I will be releasing the source code for both the RCON Client and the SpartaLib Utility. 545 kb The SpartaLib utility allows the ArmAII dedicated server to contact the outside world via the clipboard, adding quite a bit of functionality to the game, and enabling support of such things as: SQL PHP HTTP/FTP File I/O Remote Admin (RCON) ...plus more to come! Both programs will update themselves should a new version become available, though if you build them from source you can disable this. I've also set it up in such a way as to be fairly easy to extend SpartaLib via plugins, so those that wish to can add their own custom code to ArmA. The Legion of Sparta currently uses this tool for keeping track of certified pilots for each aircraft and for remote admin capabilities. Come visit us on the forums and join us on teamspeak--we're always interested to meet new folks. Oh, and no, Leonidas will not be making an appearance in the public release. :D -
DedicatedServerInterface.sqf is the new UI dialog they added which basically just calls the chat commands (#login/#kick/etc). The chat commands themselves are handled by the engine code I reckon. Certainly can't find any mention of them anywhere else.
-
Deleting member from array
MH6 replied to McArcher's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I'm not *entirely* sure this works, and I don't currently have the time to test, but I think you can do something like this: _elementToRemove = _i; mcti_airFactories_ru set [_elementToRemove, "_REMOVE_"]; mcti_airFactories_ru = mcti_airFactories_ru - ["_REMOVE_"]; Now I don't know much about the inner workings of these script commands, so not sure if it'd result in a memory leak, but I highly doubt it. Note: You can use anything in replace of "_REMOVE_", such as objNull. -
That means the path is probably wrong. Did you put the script I posed into a file called setupCOIN.sqf in the scripts subfolder of the map?
-
Find nearest Airport
MH6 replied to [frl]myke's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
This is what each of those locations looks like in their respective config files: Chernarus: class Local_Airstrip1 { name = $STR_LOCATION_AIRSTRIP; position[] = {4955.75, 2427.69}; type = "NameLocal"; radiusA = 130.83; radiusB = 147.96; angle = 0.0; }; class Local_Airstrip { name = $STR_LOCATION_AIRSTRIP; position[] = {12034.3, 12788.4}; type = "NameLocal"; radiusA = 136.67; radiusB = 154.66; angle = 0.0; }; class Local_Airfield { name = $STR_LOCATION_AIRFIELD; position[] = {4631.52, 10192.2}; type = "NameLocal"; radiusA = 171.47; radiusB = 193.34; angle = 0.0; }; Utes class Utes_CC03 { name = $STR_LOCATION_AIRFIELD; position[] = {3506.23, 3660.34}; type = "CityCenter"; neighbors[] = {"Utes_CC02", "Utes_CC04"}; demography[] = {CIV, 0.0, CIV_RU, 0.0}; radiusA = 10.0; radiusB = 10.0; angle = 0.0; }; So, there's got to be some way to get the positions of every airfield on a map automatically. Especially since they all have the same name, contained in $STR_LOCATION_AIRFIELD. Are you positive the usual location functions won't work? -
attach flare to an object?
MH6 replied to Deathcon5's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Try if(isServer) then { ... }; If that doesn't work, then the script is probably only being executed on clients, and you'll need to change that. -
Here's an example script for adding custom buildings to the Construction Interface. Replace the third element in the array (i.e. 100, or 10) with the price you want that building to be. Then you just call this script from the init field of the COIN module. (i.e. _handle = [this] execVM "scripts\setupCOIN.sqf"; ) _module = _this select 0; //Set the categories //These will be used by each building as well _module setvariable ["BIS_COIN_categories",["Buildings","Defense","Barriers","Sandbag Barriers","Fortifications","Ammunition Crates","Other"]]; //Populate BIS_COIN_items array _module setvariable ["BIS_COIN_items",[ //Format each entry like so: //[Name of Building, Name of Category, Price of Building], ["USMC_WarfareBVehicleServicePoint","Buildings",100], //["USMC_WarfareBAircraftFactory","Buildings",100], //["USMC_WarfareBArtilleryRadar","Buildings",100], ["USMC_WarfareBAntiAirRadar","Buildings",100], ["USMC_WarfareBBarracks","Buildings",100], ["MASH","Buildings",100], //["USMC_WarfareBHeavyFactory","Buildings",100], //["LAV25_HQ_unfolded","Buildings",100], //["USMC_WarfareBLightFactory","Buildings",100], ["USMC_WarfareBUAVterminal","Buildings",100], ["WarfareBAirport","Buildings",100], ["Barrack2","Buildings",100], ["Land_Hangar_2","Buildings",100], ["Land_Antenna","Buildings",100], ["WarfareBCamp","Buildings",100], ["USMC_WarfareBMGNest_M240","Defense",100], ["Stinger_Pod","Defense",100], ["M119","Defense",100], ["M252","Defense",100], ["MK19_TriPod","Defense",100], ["TOW_TriPod","Defense",100], ["M2StaticMG","Defense",100], ["M2HD_mini_TriPod","Defense",100], ["SearchLight_CDF","Defense",100], ["Base_WarfareBBarrier10xTall","Barriers",100], ["Base_WarfareBBarrier10x","Barriers",100], ["Base_WarfareBBarrier5x","Barriers",100], ["Land_HBarrier5","Barriers",100], ["Land_Hbarrier_large","Barriers",100], ["Land_HBarrier3","Barriers",100], ["Land_HBarrier1","Barriers",100], ["Hedgehog","Barriers",100], ["Fort_RazorWire","Barriers",100], ["Land_BarGate2","Barriers",100], ["Land_ConcreteBlock","Barriers",100], ["Land_CncBlock","Barriers",100], ["Land_BagFenceLong","Sandbag Barriers",100], ["Land_BagFenceShort","Sandbag Barriers",100], ["Land_BagFenceCorner","Sandbag Barriers",100], ["Land_BagFenceRound","Sandbag Barriers",100], ["Land_BagFenceEnd","Sandbag Barriers",100], ["Land_fort_bagfence_long","Sandbag Barriers",100], ["Land_fort_bagfence_corner","Sandbag Barriers",100], ["Land_fort_bagfence_round","Sandbag Barriers",100], ["Land_fortified_nest_big","Fortifications",100], ["Land_fortified_nest_small","Fortifications",100], ["Land_Fort_Watchtower","Fortifications",100], ["Land_fort_rampart","Fortifications",100], ["Land_fort_artillery_nest","Fortifications",100], ["USBasicAmmunitionBox","Ammunition Crates",10], ["USLaunchersBox","Ammunition Crates",10], ["USOrdnanceBox","Ammunition Crates",10], ["USBasicWeaponsBox","Ammunition Crates",10], ["USSpecialWeaponsBox","Ammunition Crates",10], ["USVehicleBox","Ammunition Crates",10], ["FlagCarrierUSA","Other",10], ["HeliHRescue","Other",10], ["HeliHCivil","Other",10], ["HeliH","Other",10], ["Land_CamoNet_NATO","Other",10], ["Land_CamoNetVar_NATO","Other",10], ["Land_CamoNetB_NATO","Other",10], ["Camp","Other",10], ["Land_Toilet","Other",10], ["Fence_corrugated_plate","Other",10] ]]; //End BIS_COIN_items Array Hopefully the comments in the script are enough for you to go by?
-
Not sure about that bud. Maybe try just giving the truck the Build action and ignore _BIS_COIN_idAction completely, and see if that works. If it does, great. If it doesn't, then you need some way to get the player who is using the truck. I assume you want them to be able to build while outside the truck too, yes?
-
x_consmod and COIN_RU_MHQ are variables, but yes, you can replace x_consmod with COIN_RU_MHQ, and your code will work.
-
Small SQF causing weird De-sync.
MH6 replied to Jat Goodwin's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Essentially, though you can use smaller values, i.e. sleep 0.25 to sleep 1/4th of a second. P.S.- You the same Jat from Wiremod? :D -
You need to do something similar to the following whenever the player you want to give the ability to build to spawns. When they spawn (which you can determine with the use of an event handler if you haven't set something up already), you have to add a custom Build action to their action menu, like so: _action = player addAction ["Build","scripts\coin\coin_interface.sqf",x_consmod,1,false]; player setvariable [_BIS_COIN_idAction,_action]; Where x_consmod is the name of the Construction Module you placed in the map (if it doesn't have a name, give it one). The module may also need to be synced with the player in the map editor. Also, if you want the player to be able to build anywhere, instead of only where you place the Construction Module, add this below where you add the action: [x_consmod,player] execVM "scripts\coin\updateConstructionModule.sqf"; and stick this into "scripts\coin\updateConstructionModule.sqf", which you'll need to create. _module = _this select 0; _cmdr = _this select 1; _module setvariable ["CMDR",_cmdr,true]; while {true} do { if(!alive _cmdr) exitWith{}; _pos = getPos _module; _module setPos getPos _cmdr; sleep 5; }; All this does is reset the position of the module to the player's position, so he'll always be able to build where he is at. It keeps the radius restriction though, so he can't build something a mile away from his location. Now just stick coin_interface.sqf from my above post into scripts/coin/ and you should be set. That should be all you need for it to work. If it doesn't, let me know; I may be forgetting something (haven't used these scripts in a while).
-
Where do all of you learn how to script?
MH6 replied to tlwhite0311's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Same as above. I've been programming in C/C++ for a number of years, and also know a variety of other languages (including scripted, such as LUA). All it took for me was to read some of Bohemia's scripts for a little bit before I got the hang of it. It still annoys me that parameters come before function calls though. I also don't like the fact that if statements require the keyword then and a final semi-colon--but I guess that's just the C in me. There's got to be some tutorials for it somewhere though, I don't think the language has changed much since the OFP days. Oh, and learn to love this website, and, more specifically, this page: http://community.bistudio.com/wiki/Category:Scripting_Commands -
I modified the coin_interface.sqf script a while back to do this (note: you toggle ground-alignment with ALT), as well as allow you to hold SHIFT to place multiple buildings at once without having to purchase it from the menu each and every time first. It also fixes some bugs where models don't show up correctly (i.e. small sandbag barriers) which makes them a pain in the ass to place. Oh, and it disables collision detection so the builder can actually make barriers and put other objects (i.e. MG turrets) within another object (a nest or semi-circle barrier). But of course you may not want this, in which case uncomment lines 482-491 (or search for "_isFlat ="). Here's the script: scriptName "CoIn\data\scripts\coin_interface.sqf"; /* File: coin_interface.sqf Author: Karel Moricky Description: Construction Interface system Parameter(s): _this - OBJECT - CoIn manager Returned value(s): Nothing */ _logic = _this select 3; //if(player distance FLAG_BASE < 1500) exitWith{ "Must be atleast 1500m away from main base to build." call XfGlobalChat; }; uinamespace setvariable ["COIN_displayMain",finddisplay 46]; debuglog format ["Log: [CoIn] %1 executed %2",player,_logic getvariable "BIS_COIN_name"]; debuglog format ["WF_CONS [CoIn] %1",_this]; //--- Terminate of system is already running if !(isnil {player getvariable "bis_coin_logic"}) exitwith {debuglog "Log: [CoIn] Camera script is already running"}; player setvariable ["bis_coin_logic",_logic]; bis_coin_player = player; ////////////////////////////////////////////////// startLoadingScreen [localize "str_coin_name","RscDisplayLoadMission"]; ////////////////////////////////////////////////// //--- Execute designer defined code - onStart _code = _logic getvariable "BIS_COIN_onStart"; [_logic] call _code; debugLog format ["COIN_ after onStart %1",_logic]; _camera = BIS_CONTROL_CAM; if (isnil "BIS_CONTROL_CAM") then { _camera = "camconstruct" camcreate [position player select 0,position player select 1,15]; //_camera = "camconstruct" camcreate [position _logic select 0,position _logic select 1,15]; _camera cameraeffect ["internal","back"]; _camera camPrepareFOV 0.900; _camera campreparefocus [-1,-1]; _camera camCommitPrepared 0; cameraEffectEnableHUD true; _camera setdir direction player; [_camera,-30,0] call BIS_fnc_setPitchBank; _camera camConstuctionSetParams ([position _logic] + (_logic getvariable "BIS_COIN_areasize")); }; BIS_CONTROL_CAM = _camera; BIS_CONTROL_CAM_LMB = false; BIS_CONTROL_CAM_RMB = false; showcinemaborder false; 1122 cutrsc ["constructioninterface","plain"]; //_display = finddisplay 46; (uinamespace getvariable "COIN_displayMain") displayseteventhandler ["KeyDown", "if !(isnil 'BIS_CONTROL_CAM_Handler') then {BIS_temp = ['keydown',_this,commandingmenu] spawn BIS_CONTROL_CAM_Handler; BIS_temp = nil;}"]; (uinamespace getvariable "COIN_displayMain") displayseteventhandler ["KeyUp", "if !(isnil 'BIS_CONTROL_CAM_Handler') then {BIS_temp = ['keyup',_this] spawn BIS_CONTROL_CAM_Handler; BIS_temp = nil;}"]; (uinamespace getvariable "COIN_displayMain") displayseteventhandler ["MouseButtonDown", "if !(isnil 'BIS_CONTROL_CAM_Handler') then {BIS_temp = ['mousedown',_this,commandingmenu] spawn BIS_CONTROL_CAM_Handler; BIS_temp = nil; BIS_CONTROL_CAM_onMouseButtonDown = _this; if (_this select 1 == 1) then {BIS_CONTROL_CAM_RMB = true}; if (_this select 1 == 0) then {BIS_CONTROL_CAM_LMB = true};}"]; (uinamespace getvariable "COIN_displayMain") displayseteventhandler ["MouseButtonUp", "if !(isnil 'BIS_CONTROL_CAM_Handler') then {BIS_CONTROL_CAM_RMB = false; BIS_CONTROL_CAM_LMB = false;}"]; //(uinamespace getvariable "COIN_displayMain") displayseteventhandler ["MouseMoving", "if !(isnil 'BIS_CONTROL_CAM_Handler') then {BIS_temp = ['mousemoving',_this] spawn BIS_CONTROL_CAM_Handler; BIS_temp = nil;}"]; //(uinamespace getvariable "COIN_displayMain") displayseteventhandler ["MouseHolding", "if !(isnil 'BIS_CONTROL_CAM_Handler') then {BIS_temp = ['mouseholding',_this] spawn BIS_CONTROL_CAM_Handler; BIS_temp = nil;}"]; BIS_CONTROL_CAM_keys = []; if (isnil "BIS_CONTROL_CAM_ASL") then { createcenter sidelogic; _logicGrp = creategroup sidelogic; _logicASL = _logicGrp createunit ["Logic",position player,[],0,"none"]; BIS_CONTROL_CAM_ASL = _logicASL; }; _logic setvariable ["BIS_COIN_selected",objnull]; _logic setvariable ["BIS_COIN_params",[]]; _logic setvariable ["BIS_COIN_tooltip",""]; _logic setvariable ["BIS_COIN_menu","#USER:BIS_Coin_categories_0"]; _logic setvariable ["BIS_COIN_restart",false]; _nvgstate = if (daytime > 18.5 || daytime < 5.5) then {true} else {false}; camusenvg _nvgstate; _logic setvariable ["BIS_COIN_nvg",_nvgstate]; debugLog format ["COIN_ open menu %1",_logic]; //--- Open menu _logic spawn { _logic = _this; waituntil {!isnil {_this getvariable "BIS_COIN_fundsOld"}}; while {!isnil "BIS_CONTROL_CAM"} do { waituntil { _params = _logic getvariable "BIS_COIN_params"; if (isnil "_params") then {_params = []}; (commandingmenu == "" && count _params == 0 && !BIS_CONTROL_CAM_RMB) || isnil "BIS_CONTROL_CAM" }; if (isnil "BIS_CONTROL_CAM") exitwith {}; showcommandingmenu "#USER:BIS_Coin_categories_0"; //showcommandingmenu (_logic getvariable "BIS_COIN_menu"); sleep 0.01; }; }; debugLog format ["COIN_ border %1",_logic]; //--- Border - temporary solution //TODO: move border if position of logic changes (eg. by placing hq) _createBorder = { _logic = _this; _oldBorder = missionnamespace getvariable "BIS_COIN_border"; if (!isnil "_oldBorder") then { {deletevehicle _x} foreach _oldBorder; }; missionnamespace setvariable ["BIS_COIN_border",nil]; _border = []; _center = position _logic; _size = (_logic getvariable "BIS_COIN_areasize") select 0; _width = 9.998; //200/126 _width = 9.996; //150/96 _width = 9.992; //100/64 _width = 9.967; //50/32 _width = 9.917; //30/20 _width = 9.83; //20/14 _width = 9.48; //10/8 _width = 10 - (0.1/(_size * 0.2)); _width = 10; _pi = 3.14159265358979323846; _perimeter = (_size * _pi); _perimeter = _perimeter + _width - (_perimeter % _width); _size = (_perimeter / _pi); _wallcount = _perimeter / _width * 2; _total = _wallcount; //_size = sqrt (((_size *4)^2)/(_width^2)); /* _pi = 3.14159265358979323846; _perimeterOrig = (_size * 2 * _pi); _perimeterOrig = _perimeterOrig + _width - (_perimeterOrig % _width); _total = _perimeterOrig / _width; _perimeter = _perimeterOrig / _width; _minD = 2 * sqrt ((_size/2)^2 - _total); _size = _minD; */ //hintc str [_total,_size]; for "_i" from 1 to _total do { _dir = (360 / _total) * _i; _xpos = (_center select 0) + (sin _dir * _size); _ypos = (_center select 1) + (cos _dir * _size); _zpos = (_center select 2); _a = "transparentwall" createvehiclelocal [_xpos,_ypos,_zpos]; _a setposasl [_xpos,_ypos,0]; _a setdir (_dir + 90); _border = _border + [_a]; //[_a,0,0] call BIS_fnc_setPitchBank; //sleep 0.01; }; missionnamespace setvariable ["BIS_COIN_border",_border]; }; _createBorderScope = _logic spawn _createBorder; //"chromAberration" ppEffectEnable true; //"chromAberration" ppEffectAdjust [0.015*0.666, 0.0175*0.666, false]; //"chromAberration" ppEffectCommit 0; debugLog format ["COIN_ cam handler %1",_logic]; //--- This block is pretty important if !(isnil "BIS_CONTROL_CAM_Handler") exitwith {endLoadingScreen}; BIS_CONTROL_CAM_Handler = { _mode = _this select 0; _input = _this select 1; _camera = BIS_CONTROL_CAM; _logic = bis_coin_player getvariable "bis_coin_logic"; _terminate = false; if (isnil "_logic") exitwith {}; //--- Closing CoIn if player not in rules // _rules = _logic getvariable "BIS_COIN_rules"; // _code = if (typename _rules == "ARRAY") then {{(player in _rules) || ((side player) in _rules)}} else {{(side player) == _rules}}; //! same condition code as in coin //.fsm // if !(call _code) then {BIS_COIN_QUIT = true;}; //player not in rules -> close _areasize = _logic getvariable "BIS_COIN_areasize"; _limitH = _areasize select 0; _limitV = _areasize select 1; _keysCancel = actionKeys "MenuBack"; _keysRepair = actionKeys "User13"; _keysSell = actionKeys "User14"; _keysUp = actionKeys "nextAction"; _keysDown = actionKeys "prevAction"; _keysShift = actionKeys "User11"; _keysBanned = [1]; //_keysSelectAll = actionKeys "SelectAll"; _keyNightVision = actionKeys "NightVision"; //--- Mouse Moving/Holding if (_mode in ["mousemoving","mouseholding"]) then { ///_logic = bis_coin_player getvariable "bis_coin_logic"; //_logic setvariable ["BIS_COIN_mousepos",_input]; }; //--- Mouse DOWN if (_mode == "mousedown") then { _key = _input select 1; if (_key == 1 && 65665 in (actionkeys "MenuBack")) then {_terminate = true}; }; //--- Key DOWN if (_mode == "keydown") then { _key = _input select 1; if !(_key in (BIS_CONTROL_CAM_keys + _keysBanned)) then {BIS_CONTROL_CAM_keys = BIS_CONTROL_CAM_keys + [_key]}; //--- Terminate CoIn if (_key in _keysCancel && isnil "BIS_Coin_noExit") then {_terminate = true}; //--- Start NVG if (_key in _keyNightVision) then { _NVGstate = !(_logic getvariable "BIS_COIN_nvg"); _logic setvariable ["BIS_COIN_nvg",_NVGstate]; camusenvg _NVGstate; }; }; //--- Key UP if (_mode == "keyup") then { _key = _input select 1; if (_key in BIS_CONTROL_CAM_keys) then {BIS_CONTROL_CAM_keys = BIS_CONTROL_CAM_keys - [_key]}; }; //--- Deselect or Close if (_terminate) then { _menu = _this select 2; //--- Close if (isnil "BIS_Coin_noExit") then { if (_menu == "#USER:BIS_Coin_categories_0") then { BIS_CONTROL_CAM cameraeffect ["terminate","back"]; camdestroy BIS_CONTROL_CAM; BIS_CONTROL_CAM = nil; } else { _preview = _logic getvariable "BIS_COIN_preview"; if !(isnil "_preview") then {deletevehicle _preview}; _logic setvariable ["BIS_COIN_preview",nil]; _logic setvariable ["BIS_COIN_params",[]]; }; }; }; //--- Camera no longer exists - terminate and start cleanup if (isnil "BIS_CONTROL_CAM" || player != bis_coin_player || !isnil "BIS_COIN_QUIT") exitwith { ////////////////////////////////////////////////// startLoadingScreen [localize "str_coin_exit" + " " + localize "str_coin_name","RscDisplayLoadMission"]; ////////////////////////////////////////////////// if !(isnil "BIS_CONTROL_CAM") then {BIS_CONTROL_CAM cameraeffect ["terminate","back"];camdestroy BIS_CONTROL_CAM;}; BIS_CONTROL_CAM = nil; BIS_CONTROL_CAM_Handler = nil; 1122 cuttext ["","plain"]; _player = bis_coin_player; _player setvariable ["bis_coin_logic",nil]; bis_coin_player = objnull; _preview = _logic getvariable "BIS_COIN_preview"; if !(isnil "_preview") then {deletevehicle _preview}; //_logic setvariable ["BIS_COIN_mousepos",nil]; _logic setvariable ["BIS_COIN_preview",nil]; _logic setvariable ["BIS_COIN_selected",nil]; _logic setvariable ["BIS_COIN_params",nil]; _logic setvariable ["BIS_COIN_lastdir",nil]; _logic setvariable ["BIS_COIN_tooltip",nil]; _logic setvariable ["BIS_COIN_fundsOld",nil]; _logic setvariable ["BIS_COIN_restart",nil]; _logic setvariable ["BIS_COIN_nvg",nil]; showcommandingmenu ""; //_display = finddisplay 46; (uinamespace getvariable "COIN_displayMain") displayseteventhandler ["KeyDown", ""]; (uinamespace getvariable "COIN_displayMain") displayseteventhandler ["KeyUp", ""]; (uinamespace getvariable "COIN_displayMain") displayseteventhandler ["MouseButtonDown", ""]; (uinamespace getvariable "COIN_displayMain") displayseteventhandler ["MouseButtonUp", ""]; (uinamespace getvariable "COIN_displayMain") displayseteventhandler ["MouseMoving", ""]; (uinamespace getvariable "COIN_displayMain") displayseteventhandler ["MouseHolding", ""]; (uinamespace getvariable "COIN_displayMain") displayseteventhandler ["MouseZChanged", ""]; //--- Behold the placeholders BIS_COIN_QUIT = nil; _border = missionnamespace getvariable "BIS_COIN_border"; {deletevehicle _x} foreach _border; missionnamespace setvariable ["BIS_COIN_border",nil]; //"chromAberration" ppEffectEnable false; //if !(isnil "BIS_WF_CoreCommonInitialized") then {(uinamespace getvariable "COIN_displayMain") displaySetEventHandler ["keydown","if ((_this select 1) In actionKeys ""TeamSwitch"") then {[] Exec (corePath + ""Client\Action\Action_OpenOptionsMenu.sqs"")};"];}; debuglog format ["Log: [CoIn] %1 terminated %2",player,_logic getvariable "BIS_COIN_name"]; ////////////////////////////////////////////////// endLoadingScreen; ////////////////////////////////////////////////// }; //coinn = coinn + 1; }; waituntil {scriptdone _createBorderScope}; ////////////////////////////////////////////////// endLoadingScreen; ////////////////////////////////////////////////// /******************************************************************************************************************************************************* /*** LOOOP ********************************************************************************************************************************************* /******************************************************************************************************************************************************/ _canAffordCount = 0; _canAffordCountOld = 0; _oldMenu = commandingmenu; _limitHOld = -1; _limitVOld = -1; _loaded = false; _localtime = time; _heightAdj = 0; while {!isnil "BIS_CONTROL_CAM"} do { if (isnull (uinamespace getvariable 'BIS_CONTROL_CAM_DISPLAY') && !_loaded) then { cameraEffectEnableHUD true; 1122 cutrsc ["constructioninterface","plain"]; _loaded = true; _logic setvariable ["BIS_COIN_restart",true]; _localtime = time; }; if ((time - _localtime) >= 1 && _loaded) then {_loaded = false}; _logic = bis_coin_player getvariable "bis_coin_logic"; _mode = "mousemoving"; //_input = _logic getvariable "BIS_COIN_mousepos"; _camera = BIS_CONTROL_CAM; if (isnil "_logic") exitwith {}; //--- Closing CoIn if player not in rules //_rules = _logic getvariable "BIS_COIN_rules"; //_code = if (typename _rules == "ARRAY") then {{(player in _rules) || ((side player) in _rules)}} else {{(side player) == _rules}}; //! same condition code as in coin //.fsm //if !(call _code) then {BIS_COIN_QUIT = true}; //player not in rules -> close _areasize = _logic getvariable "BIS_COIN_areasize"; _limitH = _areasize select 0; _limitV = _areasize select 1; if (_limitH != _limitHOld || _limitV != _limitVOld) then { _logic spawn _createBorder; BIS_CONTROL_CAM camConstuctionSetParams ([position _logic] + (_logic getvariable "BIS_COIN_areasize")); }; _limitHOld = _limitH; _limitVOld = _limitV; _keysCancel = actionKeys "MenuBack"; _keysRepair = actionKeys "User13"; _keysSell = actionKeys "User14"; _keysShift = actionKeys "User11"; _keysAlt = actionkeys "User12"; _keysBanned = [1]; _keysSelectAll = actionKeys "SelectAll"; /* //--- Close if (BIS_CONTROL_CAM_RMB && 65665 in (actionkeys "MenuBack") && isnil "BIS_Coin_noExit") then { if (commandingmenu == "#USER:BIS_Coin_categories_0") then { BIS_CONTROL_CAM cameraeffect ["terminate","back"]; camdestroy BIS_CONTROL_CAM; BIS_CONTROL_CAM = nil; }; }; */ //--- Mouse moving or holding if (_mode in ["mousemoving","mouseholding"]) then { _x = _input select 1; _y = _input select 2; //--- Check pressed keys _keys = BIS_CONTROL_CAM_keys; //debuglog ("Log: " + str _keys); _ctrl = (29 in _keys) || (157 in _keys); _shift = (42 in _keys) || (54 in _keys); _alt = (56 in _keys); //--- Construction or Selection _params = _logic getvariable "BIS_COIN_params"; _tooltip = "empty"; _tooltipType = "empty"; _selected = objnull; if (count _params > 0) then { //--- Construction //--- Basic colors _colorGreen = "#(argb,8,8,3)color(0,1,0,0.3,ca)"; _colorRed = "#(argb,8,8,3)color(1,0,0,0.3,ca)"; _colorGray = "#(argb,8,8,3)color(1,1,1,0.1,ca)"; _colorGray = "#(argb,8,8,3)color(0,0,0,0.25,ca)"; _color = _colorGreen; //--- Class, Category, Cost, (preview class), (display name) _itemclass = _params select 0; _itemcategory = _params select 1; //if (typename _itemcategory == typename 0) then {_itemCategory = select _itemcategory}; _itemcost = _params select 2; _itemcash = 0; if (typename _itemcost == "ARRAY") then {_itemcash = _itemcost select 0; _itemcost = _itemcost select 1}; _itemFunds = (_logic getvariable "BIS_COIN_funds") select _itemcash; _itemname = if (count _params > 3) then {_params select 3} else {gettext (configfile >> "CfgVehicles" >> _itemclass >> "displayName")}; //_itemclass_preview = _itemclass + "preview"; _itemclass_preview = gettext (configfile >> "CfgVehicles" >> _itemclass); if (_itemclass_preview == "") then {_itemclass_preview = _itemclass}; //if (str (configfile >> "CfgVehicles" >> _itemclass_preview) == "") then {_itemclass_preview = _itemclass}; //--- Preview building _preview = camtarget BIS_CONTROL_CAM; if (typeof _preview != _itemclass_preview) then { //debuglog str ["Log:::::::::",time,_itemclass,_itemclass_preview,(configfile >> "CfgVehicles" >> _itemclass >> "ghostpreview")]; //--- No preview deletevehicle _preview; if !(isnil {_logic getvariable "BIS_COIN_preview"}) then {deletevehicle (_logic getvariable "BIS_COIN_preview")}; //--- Serialization hack _preview = _itemclass_preview createvehicle (screentoworld [0.5,0.5]); BIS_CONTROL_CAM camsettarget _preview; BIS_CONTROL_CAM camcommit 0; _logic setvariable ["BIS_COIN_preview",_preview]; _preview setObjectTexture [0,_colorGray]; _preview setvariable ["BIS_COIN_color",_colorGray]; //--- Execute designer defined code _code = _logic getvariable "BIS_COIN_onSelect"; //[_itemclass,_preview] call _code; [_logic, _preview,_itemclass] spawn _code; //--- Exception - preview not created if (isnull _preview) then { deletevehicle _preview; _logic setvariable ["BIS_COIN_preview",nil]; _logic setvariable ["BIS_COIN_params",[]]; debuglog format ["Log: [COIN] ERROR: Failed to create '%1' (preview of '%2')",_itemclass_preview,_itemclass]; }; } else { //--- Check zone if ( ([position _preview,_logic] call BIS_fnc_distance2D) > _limitH ) then { _color = _colorGray } else { //--- No money _funds = 0; call compile format ["_funds = %1",_itemFunds]; _fundsRemaining = _funds - _itemcost; if (_fundsRemaining < 0) then {_color = _colorRed}; //--- No Place To Build /*_isFlat = (position _preview) isflatempty [ (sizeof typeof _preview) / 2, //--- Minimal distance from another object 0, //--- If 0, just check position. If >0, select new one 0.7, //--- Max gradient (sizeof typeof _preview), //--- Gradient area 0, //--- 0 for restricted water, 2 for required water, false, //--- True if some water can be in 25m radius _preview //--- Ignored object ]; if (count _isFlat == 0) then {_color = _colorRed};*/ }; _preview setObjectTexture [0,_color]; _preview setvariable ["BIS_COIN_color",_color]; _tooltip = _itemclass; _tooltipType = "preview"; //--- Temporary solution _colorGUI = [1,1,1,0.1]; if (_color == _colorGreen) then {_colorGUI = [0.3,1,0.3,0.3]}; if (_color == _colorRed) then {_colorGUI = [1,0.2,0.2,0.4]}; //_display = uiNamespace getvariable "BIS_CONTROL_CAM_DISPLAY"; //_center = (uiNamespace getvariable "BIS_CONTROL_CAM_DISPLAY") displayctrl 112201; ((uiNamespace getvariable "BIS_CONTROL_CAM_DISPLAY") displayctrl 112201) ctrlsettextcolor _colorGUI; ((uiNamespace getvariable "BIS_CONTROL_CAM_DISPLAY") displayctrl 112201) ctrlcommit 0; }; //--- Place if (!isnull _preview && ((BIS_CONTROL_CAM_LMB && 65536 in (actionKeys "DefaultAction")) || {_x in (actionKeys "DefaultAction")} count BIS_CONTROL_CAM_keys > 0) && _color == _colorGreen) then { _pos = position _preview; _dir = direction _preview; _done = true; _align = false; if (count _keys > 0) then { if ({_x in _keysShift} count _keys > 0) then { _done = false; }; if ({_x in _keysAlt} count _keys > 0) then { _align = true; }; }; if(_done) then { deletevehicle _preview; _logic setvariable ["BIS_COIN_preview",nil]; _logic setvariable ["BIS_COIN_params",[]]; }; //--- Remove funds call compile format ["%1 = %1 - _itemcost",_itemFunds]; //--- Execute designer defined code [_logic,_itemclass,_pos,_dir,_done,_align] spawn { _logic = _this select 0; _itemclass = _this select 1; _pos = _this select 2; _dir = _this select 3; _done = _this select 4; _align = _this select 5; //format["%1",_pos] call XfGlobalChat; _code = _logic getvariable "BIS_COIN_onPurchase"; [_logic,objNull,_itemclass,_pos,_dir] call _code; //--- Build _building = _itemclass createvehicle _pos;//[10,10,10000]; _building setpos _pos; _building setdir _dir; sleep 0.1; if(!_align) then {_building setpos _pos;}; //if (gettext (configfile >> "cfgvehicles" >> _itemclass >> "placement") == "vertical") then {_building setpos _pos}; //--- Vertical _building setvariable ["BIS_COIN_cost",_itemcost,true]; //--- Register building [_logic,"BIS_COIN_buildings",[_building],true] call bis_fnc_variablespaceadd; if(!_align) then { waituntil {!isnull _building}; _building setdir _dir; _building setpos _pos; }; //--- Execute designer defined code On Construct _code = _logic getvariable "BIS_COIN_onConstruct"; [_logic, _building,_itemclass,_pos,_dir] spawn _code; }; //--- Temporary solution _colorGUI = [1,1,1,0.1]; //_display = uiNamespace getvariable "BIS_CONTROL_CAM_DISPLAY"; //_center = (uiNamespace getvariable "BIS_CONTROL_CAM_DISPLAY") displayctrl 112201; ((uiNamespace getvariable "BIS_CONTROL_CAM_DISPLAY") displayctrl 112201) ctrlsettextcolor _colorGUI; ((uiNamespace getvariable "BIS_CONTROL_CAM_DISPLAY") displayctrl 112201) ctrlcommit 0; }; //--- Deselect /* if (BIS_CONTROL_CAM_RMB) then { deletevehicle _preview; _logic setvariable ["BIS_COIN_preview",nil]; _logic setvariable ["BIS_COIN_params",[]]; }; */ } else { _colorGUI = [1,1,1,0.1]; _buildings = _logic getvariable "BIS_COIN_buildings"; if (count _buildings > 0) then { //--- Selection _worldpos = screentoworld [0.5,0.5]; _selected = objnull; { _size = (sizeof typeof _x) / 3; if (_size < 2) then {_size = 2}; if (_x distance _worldpos < _size) exitwith {_selected = _x;_logic setvariable ["BIS_COIN_selected",_selected]}; _logic setvariable ["BIS_COIN_selected",objnull]; } foreach _buildings; //--- Selected building if !(isnull _selected) then { _colorGUI = [1,1,1,0.3]; _tooltip = typeof _selected; _tooltipType = "selected"; //--- Custom actions if (count _keys > 0 && !_ctrl) then { //--- Repair if ({_x in _keysRepair} count _keys > 0) then { [_logic,_selected] spawn { _code = (_this select 0) getvariable "BIS_COIN_onRepair"; _this call _code; (_this select 1) setdamage 0; }; }; //--- Sell if ({_x in _keysSell} count _keys > 0) then { [_logic,_selected] spawn { _code = (_this select 0) getvariable "BIS_COIN_onSell"; _this call _code; deletevehicle (_this select 1); }; }; }; }; }; //_display = uiNamespace getvariable "BIS_CONTROL_CAM_DISPLAY"; //_center = (uiNamespace getvariable "BIS_CONTROL_CAM_DISPLAY") displayctrl 112201; ((uiNamespace getvariable "BIS_CONTROL_CAM_DISPLAY") displayctrl 112201) ctrlsettextcolor _colorGUI; ((uiNamespace getvariable "BIS_CONTROL_CAM_DISPLAY") displayctrl 112201) ctrlcommit 0; }; _oldTooltip = _logic getvariable "BIS_COIN_tooltip"; //_display = uiNamespace getvariable "BIS_CONTROL_CAM_DISPLAY"; if ((_tooltipType + _tooltip) != _oldTooltip || commandingmenu != _oldMenu) then { //--- Description _type = _tooltip; //--- Header & preview picture _textHeader = "<t size='1.2'><br /></t>"; _textPicture = "<t size='2.8'><br /></t><br /><br />"; _fileIcon = gettext (configfile >> "cfgvehicles" >> _type >> "icon"); if (str(configfile >> "CfgVehicleIcons" >> _fileIcon) != "") then {_fileIcon = gettext (configfile >> "CfgVehicleIcons" >> _fileIcon)}; _filePicture = gettext (configfile >> "cfgvehicles" >> _type >> "picture"); if (str(configfile >> "CfgVehicleIcons" >> _filePicture) != "") then {_filePicture = gettext (configfile >> "CfgVehicleIcons" >> _filePicture)}; if (_tooltipType != "empty") then { _textHeader = format ["<t align='center'><t size='1.4'>%1</t><br /><t size='1'></t></t>", gettext (configfile >> "cfgvehicles" >> _type >> "displayname"), if (isnull _selected) then {""} else {str round ((1 - damage _selected) * 100) + "%"} ]; _textPicture = format ["<t align='left' size='2.8' shadow='0'><img image='%1'/></t> ",_filePicture]; }; /* _textHeader = "X"; _textPicture = ""; */ _text1 = if (_tooltipType == "selected" && (str (_logic getvariable "BIS_COIN_onRepair") != str {})) then { //--- Repair hint localize "str_coin_repair" + "<t align='right'>" + call compile (actionKeysNames ["User13",1]) + "</t><br />"; } else { //--- Rotate if (count _params > 0) then { localize "str_coin_rotate" + "<t align='right'>" + call compile (keyname 29) + "</t><br />"; } else {"<br />"}; }; _text2 = if (_tooltipType == "selected" && (str (_logic getvariable "BIS_COIN_onSell") != str {})) then { //--- Sell hint localize "str_coin_sell" + "<t align='right'>" + call compile (actionKeysNames ["User14",1]) + "</t><br />"; } else { //--- Build hint if (count _params > 0) then { localize "str_coin_build" + "<t align='right'>" + call compile (actionKeysNames ["DefaultAction",1]) + "</t><br />"; } else {"<br />"}; }; _text3 = if (commandingmenu != "#USER:BIS_Coin_categories_0") then { //--- Back hint if (isnil "BIS_Coin_noExit") then { localize "str_coin_back" + "<t align='right'>" + call compile (actionKeysNames ["MenuBack",1]) + "</t>"; } else {""}; } else { //--- Exit hint if (isnil "BIS_Coin_noExit") then { "<t color='#ff5544'>" + localize "str_coin_exit" + "<t align='right'>" + call compile (actionKeysNames ["MenuBack",1]) + "</t></t>"; } else {""}; }; //--- Compose text _textHint = ( _textPicture + _textHeader + "" ); _textControls = ( _text1 + _text2 + _text3 + "" ); //--- Set box //_bcg = (uiNamespace getvariable "BIS_CONTROL_CAM_DISPLAY") displayctrl 112211; ((uiNamespace getvariable "BIS_CONTROL_CAM_DISPLAY") displayctrl 112211) ctrlshow true; ((uiNamespace getvariable "BIS_CONTROL_CAM_DISPLAY") displayctrl 112211) ctrlcommit 0; //_desc = _display displayctrl 112214; ((uiNamespace getvariable "BIS_CONTROL_CAM_DISPLAY") displayctrl 112214) ctrlsetstructuredtext (parsetext _textHint); ((uiNamespace getvariable "BIS_CONTROL_CAM_DISPLAY") displayctrl 112214) ctrlshow true; ((uiNamespace getvariable "BIS_CONTROL_CAM_DISPLAY") displayctrl 112214) ctrlcommit 0; //_controls = _display displayctrl 112215; ((uiNamespace getvariable "BIS_CONTROL_CAM_DISPLAY") displayctrl 112215) ctrlsetstructuredtext (parsetext _textControls); ((uiNamespace getvariable "BIS_CONTROL_CAM_DISPLAY") displayctrl 112215) ctrlshow true; ((uiNamespace getvariable "BIS_CONTROL_CAM_DISPLAY") displayctrl 112215) ctrlcommit 0; }; //--- Amount of funds changed _funds = _logic getvariable "BIS_COIN_funds"; _fundsDescription = _logic getvariable "BIS_COIN_fundsDescription"; _cashValues = []; { _cashValues = _cashValues + [call compile _x]; } foreach _funds; _cashValuesOld = _logic getvariable "BIS_COIN_fundsOld"; if (isnil "_cashValuesOld") then {_cashValuesOld = []; _cashValuesOld set [count _cashValues - 1,-1]}; _restart = _logic getvariable "BIS_COIN_restart"; if (!([_cashValues,_cashValuesOld] call bis_fnc_arraycompare) || _restart) then { _cashValuesCount = count _cashValues; _cashSize = if (_cashValuesCount <= 1) then {2} else {2.8 / _cashValuesCount}; _cashText = format ["<t size='%1' align='left' valign='middle'>",_cashSize]; _cashLines = 0; for "_i" from 0 to (count _funds - 1) do { _cashValue = _cashValues select _i; _cashDescription = if (count _fundsDescription > _i) then {_fundsDescription select _i} else {"?"}; _cashText = _cashText + format ["%1 %2<br />",_cashDescription,round _cashValue]; _cashLines = _cashLines + 0.05; }; _cashText = _cashText + "</t>"; //_cash = _display displayctrl 112224; _cashPos = ctrlposition ((uiNamespace getvariable "BIS_CONTROL_CAM_DISPLAY") displayctrl 112224); ((uiNamespace getvariable "BIS_CONTROL_CAM_DISPLAY") displayctrl 112224) ctrlsetstructuredtext (parsetext _cashText); ((uiNamespace getvariable "BIS_CONTROL_CAM_DISPLAY") displayctrl 112224) ctrlsetposition [_cashPos select 0,_cashPos select 1,_cashPos select 2,(_cashPos select 3)/*0.1*/ + _cashLines]; ((uiNamespace getvariable "BIS_CONTROL_CAM_DISPLAY") displayctrl 112224) ctrlshow true; ((uiNamespace getvariable "BIS_CONTROL_CAM_DISPLAY") displayctrl 112224) ctrlcommit 0; //--- Categories menu _categories = +(_logic getvariable "BIS_COIN_categories"); //_categoriesLong = []; //{_categoriesLong = _categoriesLong + [_x + ""]} foreach _categories; //--- Adding empty spaces will widen the box to max value _categoriesMenu = []; for "_i" from 0 to (count _categories - 1) do { _categoriesMenu = _categoriesMenu + [_i]; }; [["Categories",true],"BIS_Coin_categories",[_categoriesMenu,_categories],"#USER:BIS_Coin_%1_items_0","",""] call BIS_fnc_createmenu; //--- Items menu _items = _logic getvariable "BIS_COIN_items"; _canAffordCountOld = _canAffordCount; _canAffordCount = 0; debugLog format ["COIN_ %1",_items]; for "_i" from 0 to (count _categories - 1) do { _category = _categories select _i; _arrayNames = []; _arrayNamesLong = []; _arrayEnable = []; _arrayParams = []; { _itemclass = _x select 0; _itemcategory = _x select 1; if (typename _itemcategory == typename "") then {//--- Backward compatibility _itemcategory = _categories find _itemcategory; debuglog format ["Log: [COIN] ERROR: Old category used: '%1' (in '%2')",_itemcategory,_itemclass]; } else {100}; if (_itemcategory < count _categories) then { _itemcost = _x select 2; _itemcash = 0; if (typename _itemcost == "ARRAY") then {_itemcash = _itemcost select 0; _itemcost = _itemcost select 1}; _cashValue = _cashValues select _itemcash; _cashDescription = if (count _fundsDescription > _itemcash) then {_fundsDescription select _itemcash} else {"?"}; _itemname = if (count _x > 3) then {_x select 3} else {gettext (configfile >> "CfgVehicles" >> _itemclass >> "displayName")}; if (_itemcategory == _i/*_category*/) then { _canAfford = if (_cashValue - _itemcost >= 0) then {1} else {0}; _canAffordCount = _canAffordCount + _canAfford; _text = _itemname + " - " + _cashDescription + str _itemcost; _arrayNames = _arrayNames + [_text]; _arrayNamesLong = _arrayNamesLong + [_text + " "]; _arrayEnable = _arrayEnable + [_canAfford]; _arrayParams = _arrayParams + [[_logic getvariable "BIS_COIN_ID"] + [_x,_i]]; }; } else {debuglog format ["Log: [CoIn] ERROR: Invalid category '%1' used in '%2'",_itemcategory,_itemclass]}; } foreach _items; [[_category,true],format ["BIS_Coin_%1_items",_i],[_arrayNames,_arrayNamesLong,_arrayEnable],""," BIS_CONTROL_CAM_LMB = false; scopename 'main'; _item = '%1'; _id = %2; _array = (call compile '%3') select _id; _logic = call compile ('BIS_COIN_'+ str (_array select 0)); _params = _array select 1; _logic setvariable ['BIS_COIN_params',_params]; _logic setvariable ['BIS_COIN_menu',commandingmenu]; showcommandingmenu ''; ",_arrayParams] call BIS_fnc_createmenu; /* [_category,format ["BIS_Coin_%1_items",_category],[_arrayNames,_arrayNamesLong,_arrayEnable],""," debugLog ('item: %1 id %2 array %3'); ",_arrayParams] call BIS_fnc_createmenu; */ }; if (_canAffordCount != _canAffordCountOld) then {showcommandingmenu (commandingmenu)}; //<-- Open menu again to show disabled items }; _logic setvariable ["BIS_COIN_fundsOld",_cashValues]; _logic setvariable ["BIS_COIN_tooltip",_tooltipType + _tooltip]; if (_restart) then { _logic setvariable ["BIS_COIN_restart",false]; //showcommandingmenu ""; }; }; _oldMenu = commandingmenu; sleep 0.01; }; Edit: Oh, and you may need to bind Shift and Alt to the "User11" and "User12" actions respectively. They're under custom actions in the key config menu. I forget if they were default or not.
-
serverCommand usage?
MH6 replied to gossamersolid's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Put all the commands in a server side addon as functions, then call the call the functions from scripts in the map. No one will have access to the addon besides the server admins, and that will contain the password. Some interesting things you could do with this: Create dynamic campaigns in multiplayer using the "#mission" command, called from within the map based on an objective being completed/failed. Kicking players should they violate some rule on an RPG map, automatically -
serverCommand usage?
MH6 replied to gossamersolid's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Works fine here. Are you logging in first? i.e. serverCommand "#login password"; serverCommand format["#kick %1",_name]; serverCommand "#logout"; where password is, of course, the admin password for the server. You can also check to make sure you can execute the command first--so you can essentially check to see if you're logged in--like so: if(serverCommandAvailable "#kick") then { serverCommand format["#kick %1",_name]; } else { diag_log "Unable to kick player: Not logged in!"; }; -
serverCommand usage?
MH6 replied to gossamersolid's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Yep. Going to start testing it out on a couple of servers soon, and if that goes well then I'll try and release it. -
serverCommand usage?
MH6 replied to gossamersolid's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
serverCommand format["#kick %1",_name]; And yes I've used it. I've developed an RCON tool with it. -
Who needs that when your aircraft has JATO capability? :D
-
Yep, I wrote a JATO script for C-130s in my Domination mod, 'cause I wanted to be able to land and takeoff from the two grass airfields. It's pretty simple, and still kind of rough (more a proof of concept, will rewrite it later), but I like the effect. Works great for my needs; I just need to add flames and smoke now. :D _vehicle = vehicle player; if(typeof _vehicle != "C130J") exitWith {"Wrong vehicle type for JATO" call XfDebugChat; }; //just in case if(!isNil "d_jato_time" && d_jato_time > time) exitWith{format["Cannot use JATO again for %1 seconds.",ceil (d_jato_time-time)] call XfGlobalChat;}; _speed = 2; //Added speed; _c =0; waitUntil{ _vel = velocity _vehicle; _dir = direction _vehicle; _vehicle setVelocity [(_vel select 0)+(sin _dir*_speed),(_vel select 1)+ (cos _dir*_speed),(_vel select 2)]; _c = _c+0.5; sleep 0.1; _c >= 10}; d_jato_time = time + 300; You will probably need to remove the XfDebugChat and XfGlobalChat calls unless you are running Domination (and even then remove XfDebugChat, as that function is specific to my map). You can also increase the _speed variable if you want it to go faster, or change up _c a bit to make it "burn" longer. It is also on a timer, as I only want players to use it sparingly, i.e. when taking off.
-
synchronizeObjectsAdd help
MH6 replied to {USI}_Zombie's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
You can't synchronize artillery properly once the map has started. So add this: [_tube] call BIS_ARTY_F_initVehicle;