Jump to content
  • 0

New Epoch tool... the Headlamp


So I've been working on a script using the extra_rc.hpp script to make a new tool function.  A headlamp or lantern if you prefer. (In effect it is really more like the latter.)  The lamp part works perfectly, but I am unable to shut it off afterwards. Here is what I have so far:

if (isNil "headlamp") then
	headlamp = 0;

if (headlamp == 0) then
	_hlight = "#lightpoint" createVehicle (getpos player);
	_hlight setLightAmbient [.15, .15, .15];
	_hlight setLightColor [.15, .12, .10];
	_hlight setLightBrightness .25;
	setaperture -1;
	_hlight setDir (getDir player);
	_hlight attachTo [(vehicle player), [0,0,1.5]];
	Sleep 0.1;
	headlamp = 1;
	hint "Headlamp ON";

	Sleep 0.1;
	detach _hlight;
	_hlight setPosATL [-10000,-10000,100000];
	Sleep 0.1;
	deleteVehicle _hlight;
	Sleep 0.1;
	headlamp = 0;
	hint "Headlamp OFF";

It never makes it to "Headlamp OFF". It is having trouble detaching the light from the player and it can't delete it while it is attached.  Any ideas? Am I just using the command wrong?

Share this post

Link to post
Share on other sites

2 answers to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Similar Content

    • By JakeQue
      Usually it would state 
      "You cannot gut this animal without a knife"
      but now the scroll  action is dead and I don't get an error.
      Please help!
    • By xDUKEx
      * Sorry ... This should be ARMA 2 not ARMA 3 ... Not sure how I got myself into the wrong forum*
      I'm currently on Epoch and I've been banging my head against the wall when it comes to getting my intro.ogg file to play when a  player connects to the server. 
      I've been using some of my old server scripts to try to build a new one, and I've been online searching for a current script ... but they all seem pretty old and I wonder if they are still working.  Everyone I have tried does nothing.  I've tried adding it to a welcome message/credits script and to a camera intro script but nothing happens.  Actually, I can't even seem to get my stock Server Rules .sqf to stop running.  It's getting really frustrating. 
      Then I found the server_playerLogin.sqf and I wondered if maybe I needed to script the code in here?
      If anyone knows of a current playsound / welcome credits / camera intro script, in any combination of the three or you know where I should be placing the script, I would GREATLY appreciate it.
    • By lesvieuxcrevards
      Anyone have scripts/mod to have lights sources for players bases?
      Best Regards.
    • By Schalldampfer
      While testing this old script in Epoch, I got an issue:
      When I ride on the bus which an AI is driving, the bus start driving well.
      But after running about some ten or hundred meters away,
      the bus suddenly stop and damage me as if there's an invisible barrier in front of me, 
      and it starts bouncing like a football there.
      I want any idea to make the script works well.
      I have changed a part of init_bus.sqf from
      to make it work in 1061, and player_axebus.qf to
      to make it work for any player skin.
    • By harcosgoogle
      How to fix Bug?
      The image is darkened,As if the character wanted to faint,darkens.
      Sometimes it happens,Random
      And: Tired of character, bad targeting too
      Thanks,Sorry NO SPEAK ENGLISH :)
  • Advertisement
  • Supporters
  • Discord

  • Create New...