Jump to content

Mike4010

Member
  • Content Count

    4
  • Joined

  • Last visited

  • Medals

Community Reputation

0 Neutral

About Mike4010

  • Rank
    Rookie
  1. Hey guys, so once again my noobie scripting skills make me fail miserably. What i want to achieve is if i press the button 5 (on the numpad) i want the cursorTarget (a player) to get knocked down and after 5 seconds i want him to get back up. It works all well except the 5 seconds delay. I have this in my init.sqf: waituntil {!(IsNull (findDisplay 46))}; _keyDown = (findDisplay 46) displayAddEventHandler ["KeyDown", {if (_this select 1 == 76) then { dude = cursorTarget; dude switchMove "AinjPpneMstpSnonWrflDnon"; sleep 5; dude playMove "AmovPercMstpSnonWnonDnon";}}]; When i run this it returns a generic error message, the cursorTarget gets "knocked down" and right back up. Also i want to ask how to bind that code to a button combination? (Shift + F for example) And would this whole thing work in multiplayer as well? If not, what would i have to change? Excuse my pathetic problems, still quite new to scripting. Thank you in advance!
  2. Same exact issue here. Glad i'm not the only one.
  3. Mike4010

    Simple Garage System

    Thank you very much! I have even extended the script to work with even three helipads now. Appreciate the help!
  4. Hello there, scripting beginner here. I've been trying to script a simple "spawn system" in the editor and i am having a hard time with it. So what i want to achieve is if i execute an action (attached to an object per addAction which leads to my script), i want the script to check if area A (a helipad) is free. If it is, a MH900 should spawn at area A, if not it should spawn at area B which is next to area A. So my script (which is most likely riddled with nonsense and errors) looks like that: loc = createLocation ["NameLocal",[8422.922,18207.314,0],10,10]; veh = nearestObject [[8423.22,18207.4,0.00146484],"LandVehicle"]; pos = getPos veh; if (pos in loc) then { createVehicle ["C_Heli_Light_01_civil_F" ,[8431.15,18223.9,0.00164795], [], 0, "CAN_COLLIDE"]; //Area A } else { createVehicle ["C_Heli_Light_01_civil_F" ,[8423.22,18207.4,0.00146484], [], 0, "CAN_COLLIDE"]; // Area B }; It is sort of working but is there any better way to achieve the same effect without creating a location, checking if the nearest object is in the location etc.? If the vehicle blocking the spawn area is anything but a land vehicle it obviously doesn't work. Is there any way to search for all sorts of vehicles with nearestObject? How would you script that in order to work with all sorts of vehicles blocking the spawn? If there are any other improvements and/or expansions you would like to suggest, feel free to add it, always happy to learn new Things! Thank you in advance and sorry for bothering with my noobie-errors!
×