Jump to content

lifted86

Member
  • Content Count

    79
  • Joined

  • Last visited

  • Medals

Everything posted by lifted86

  1. heres two i find i use a little.
  2. lifted86

    Only allow West to shoot VIP

    As long as _pilot is still defined where you put the code, you should be right. You could also put a distance check in the eventHandler _unit = _this select 0; // your pilot _damage = _this select 2; _source =_this select 3; //unit doing the damage _returnDamage = 0; if ((side _source) == west && (_source distance _unit) < 200 ) then { _returnDamage = _damage; }; _returnDamage
  3. lifted86

    Only allow West to shoot VIP

    _pilot addeventhandler ["HandleDamage",{[_this] execVM "pilotDamage.sqf";}]; "pilotDamage.sqf" _damage = _this select 2; _source =_this select 3; _returnDamage = 0; if ((side _source) == west) then { _returnDamage = _damage; }; _returnDamage maybe something like this? not tested http://community.bistudio.com/wiki/ArmA_2:_Event_Handlers#HandleDamage
  4. http://community.bistudio.com/wiki/6thSense.eu:EG#Locality maybe this page can help you out :)
  5. My guess would be that moveToCompleted isnt the right command to check if the waypoint is completed. I cant see why the sleep wouldnt be waiting for the waitUntil. I remember reading you can use setWaypointStatements to check if a waypoint is completed but ive never used it before. Edit: I just noticed your using setWaypointStatements ["true", ""]; After reading the wiki, wouldnt this auto complete the waypoint?
  6. lifted86

    Switch Do Rank

    try making the cases all caps, on This page it shows them in all caps, and Im pretty sure switch is case sensitive with strings.
  7. i made this base class to make an invisible button class RscInvisibleButton { access = 0; type = 1; text = ""; colorText[] = {0,0,0,0}; colorDisabled[] = {0,0,0,0}; colorBackground[] = {0,0,0,0}; colorBackgroundDisabled[] = {0,0,0,0}; colorBackgroundActive[] = {0,0,0,0}; colorFocused[] = {0,0,0,0}; colorShadow[] = {0,0,0,0}; colorBorder[] = {0,0,0,0}; soundEnter[] = {"",0.09,1}; soundPush[] = {"",0.09,1}; soundClick[] = {"\ca\ui\data\sound\new1",0.07,1}; soundEscape[] = {"",0.09,1}; style = 2; x = 0; y = 0; w = 0.095589; h = 0.039216; shadow = 2; font = "Bitstream"; sizeEx = 0.03921; offsetX = 0.003; offsetY = 0.003; offsetPressedX = 0.002; offsetPressedY = 0.002; borderSize = 0; };
  8. i was doing something like that and found it can get messy if you want to re arrange the order or something, so i started to do... _sel = lbCurSel _listbox; _selText = lbText [1500, _sel]; //will be a string Switch (_selText) Do *** { Case "M4A1":{hint "m4a1"}; Case "G36C Eotech SD":{hint "g36"}; Case "MP5A5":{hint "mp5a5"}; };
  9. oh, i had no idea about these ui event handlers.
  10. lifted86

    Timer Issue on Dedi server

    if you are running on a dedi using isserver, you wont see the hint. Cause the hint will only happen on the server, which is the dedi. The script is runnig you just cant see it. Make a variable TIME = [_hour, _minute, _second] some where in your script then public var it. then make a hint thats executed from the client like _hour = TIME select 0; _minute = TIME select 1; _second =TIME select 2; hint format["Timeleft = %1 : %2 : %3",_hour, _minute,_second]; This way you can see what its doing when testing on a dedi. Im making this off the top of my head, but i think it should work for your script :)
  11. Just had a quick look through, and it looks really good. Nice work.
  12. yeah _string == ""; this worked, i was checking the wrong variable. :p
  13. _string = ""; is there anyway i can check if _string == ""? Ive tried _string == "" and isNil("_string") cant seem to get these to work.
  14. _sex = format ["%1sex", player]; _description = format ["%1description", player]; forgot the "" quotes edit: lol ninja'd. twice
  15. I can achieve something like what you want by making a listbox like this class RscListBox { type = 5; style = LB_TEXTURES; font = "Zeppelin32"; sizeEx = 0.03921; color[] = {1, 1, 1, 1}; colorText[] = {0.95, 0.95, 0.95, 1}; colorScrollbar[] = {0.95, 0.95, 0.95, 1}; colorSelect[] = {0.023529, 0, 0.0313725, 1}; colorSelect2[] = {0.023529, 0, 0.0313725, 1}; colorSelectBackground[] = {0.58, 0.1147, 0.1108, 1}; colorSelectBackground2[] = {0.58, 0.1147, 0.1108, 1}; period = 1; colorBackground[] = {0, 0, 0, 1}; maxHistoryDelay = 1.0; autoScrollSpeed = -1; autoScrollDelay = 5; autoScrollRewind = 0; soundSelect[] = {"",0.1,1}; rowHeight = 0; class ScrollBar { color[] = {1, 1, 1, 0.6}; colorActive[] = {1, 1, 1, 1}; colorDisabled[] = {1, 1, 1, 0.3}; thumb = "\ca\ui\data\ui_scrollbar_thumb_ca.paa"; arrowFull = "\ca\ui\data\ui_arrow_top_active_ca.paa"; arrowEmpty = "\ca\ui\data\ui_arrow_top_ca.paa"; border = "\ca\ui\data\ui_border_scroll_ca.paa"; }; }; class RscDialog { idd = 3000; movingenable = true; class Controls { class L86RscListboxMain: RscListbox { idc = 1500; x = 0.450214 * safezoneW + safezoneX; y = 0.378879 * safezoneH + safezoneY; w = 0.265375 * safezoneW; h = 0.21979 * safezoneH; color[] = {1, 1, 1, 1}; colorText[] = {0, 0, 0, 0.75}; colorScrollbar[] = {0.95, 0.95, 0.95, 1}; colorSelect[] = {0, 0, 0, 1}; colorSelect2[] = {0.0, 0, 0, 1}; colorSelectBackground[] = {0.6, 0.839, 0.47, 0.3}; colorSelectBackground2[] = {0.6, 0.839, 0.47, 1}; period = 0; colorBackground[] = {0, 0, 0, 1}; sizeEx = 0.035; class ScrollBar { color[] = {1, 1, 1, 0.6}; colorActive[] = {1, 1, 1, 1}; colorDisabled[] = {1, 1, 1, 0.3}; thumb = "\ca\ui\data\igui_scrollbar_thumb_ca.paa"; arrowFull = "\ca\ui\data\igui_arrow_top_active_ca.paa"; arrowEmpty = "\ca\ui\data\igui_arrow_top_ca.paa"; border = "\ca\ui\data\igui_border_scroll_ca.paa"; }; }; }; }; then when you create the dialog createdialog "RscDialog"; _index1 = lbAdd [idc, "your text here"]; //idc is the idc of the list box EDIT: just looked at ctrlSetText. this might be easier to use.
  16. Yeah, leaving the crate there would probably be easier, i cant think of an easy way to add an action to one of those spawned objects off the top of my head. Maybe nearestObect "TYPE OF OBJECT YOU WANT TO ADDACTION TO" somewhere?
  17. Ive tried dialogs before a gave up after the CTD's, but now Ive seen your other post about dialog tutorials. was wondering what tutorial you used? or did you just mess with the BI GUI EDITOR
  18. ok, so im guessing you walk up to the crate and select deploy hq and the base builds? i would try using Dynamic Object Compositions and doing something like init_hq.sqf private ["_crate"]; _crate = _this select 0; _crate setVariable ["hq_deployed", false, true]; _crate addAction ["Deploy HQ", "CREATE CUSTOM COMPOSITIONS SCRIPT", "", 6, false, true,"","!(_this getVariable ""hq_deployed"")"]; _crate addAction ["Undeploy HQ", "DELETE CUSTOM COMPOSITIONS SCRIPT", "", 6, false, true,"","_this getVariable ""hq_deployed"""]; sleep 5; and just change "hq_deployed" where ever in those scripts?
  19. loadScreen = [b]__Rev[/b](["pics\flags\jsf1.paa", "pics\flags\jsf2.paa", "pics\flags\jsf3.paa", "pics\flags\jsf4.paa"] select round random 4); Whats _rev? and it has 2 __ before it. dont know if thats your problem. Just a few things to help me understand this next part. How is init_hq.sqf executed? and are any of these addactions working?
  20. yep. use the in command like "ItemGPS" in [_this] call BIS_fnc_invString will return true or false.
  21. you can use some BIS functions to mess with inventory, you can find a few here
  22. _a = "0.009*( (9/7))"; _b = compile _a; _c = call _b; _d = format ["%1",_c]; hint _d; just tested this, worked for me. I have no idea if theres a better way :)
  23. Great island, are you still working on it? I noticed my gps is displaying a single number when i go to the map screen, I'm using ace, haven't tried in vanilla.
  24. put scoreSide west >= 100 in condition of a trigger, and choose end 1 in the little drop down menu, and scoreSide east >= 100 in another trigger. You can use a debriefing with these endings as well i think.
  25. just putting it in the vehicle init should do it. clearMagazineCargoGlobal this; clearWeaponCargoGlobal this; Or if (!isServer) exitWith {}; // Define variables _unit = _this select 0; _delay = if (count _this > 1) then {_this select 1} else {30}; _deserted = if (count _this > 2) then {_this select 2} else {120}; _respawns = if (count _this > 3) then {_this select 3} else {0}; _explode = if (count _this > 4) then {_this select 4} else {false}; _dynamic = if (count _this > 5) then {_this select 5} else {false}; _unitinit = if (count _this > 6) then {_this select 6} else {}; _haveinit = if (count _this > 6) then {true} else {false}; _hasname = false; _unitname = vehicleVarName _unit; if (isNil _unitname) then {_hasname = false;} else {_hasname = true;}; _noend = true; _run = true; _rounds = 0; if (_delay < 0) then {_delay = 0}; if (_deserted < 0) then {_deserted = 0}; if (_respawns <= 0) then {_respawns= 0; _noend = true;}; if (_respawns > 0) then {_noend = false}; _dir = getDir _unit; _position = getPosASL _unit; _type = typeOf _unit; _dead = false; _nodelay = false; // Start monitoring the vehicle while {_run} do { sleep (2 + random 10); if ((getDammage _unit > 0.8) and ({alive _x} count crew _unit == 0)) then {_dead = true}; // Check if the vehicle is deserted. if (_deserted > 0) then { if ((getPosASL _unit distance _position > 10) and ({alive _x} count crew _unit == 0) and (getDammage _unit < 0.8)) then { _timeout = time + _deserted; sleep 0.1; waitUntil {_timeout < time or !alive _unit or {alive _x} count crew _unit > 0}; if ({alive _x} count crew _unit > 0) then {_dead = false}; if ({alive _x} count crew _unit == 0) then {_dead = true; _nodelay =true}; if !(alive _unit) then {_dead = true; _nodelay = false}; }; }; // Respawn vehicle if (_dead) then { if (_nodelay) then {sleep 0.1; _nodelay = false;} else {sleep _delay;}; if (_dynamic) then {_position = getPosASL _unit; _dir = getDir _unit;}; if (_explode) then {_effect = "M_TOW_AT" createVehicle getPosASL _unit; _effect setPosASL getPosASL _unit;}; sleep 0.1; deleteVehicle _unit; sleep 2; _unit = _type createVehicle _position; _unit setPosASL _position; _unit setDir _dir; if (_haveinit) then {_unit setVehicleInit format ["%1;", _unitinit]; processInitCommands;}; if (_hasname) then {_unit setVehicleInit format ["%1 = this; this setVehicleVarName ""%1""",_unitname]; processInitCommands;}; _dead = false; // Check respawn amount if !(_noend) then {_rounds = _rounds + 1}; if ((_rounds == _respawns) and !(_noend)) then {_run = false;}; [b]clearMagazineCargoGlobal _unit; clearWeaponCargoGlobal _unit;[/b] }; }; should work if you only what no cargo after the first respawn
×