Jump to content
  • 0

Hemp / Arma coding


Emerghency

Question

I was curious if there was a line of code (specifically an if statement) that tested if a player was looking at a object in the map, i.e an added custom building, but in my case one of the weed plants. I was also curious if there was an if statement to test if a player was inside of a vehicle. thanks!

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0
13 minutes ago, Emerghency said:

I was curious if there was a line of code (specifically an if statement) that tested if a player was looking at a object in the map, i.e an added custom building, but in my case one of the weed plants. I was also curious if there was an if statement to test if a player was inside of a vehicle. thanks!

examine your fn_selfactions.sqf

Its full of those examples

here is one i created using the ones in there

//Smoke Bong
if (_typeOfCursorTarget in ["Land_Water_pipe_EP1"] and (_cursorTarget distance player <= 3)) then {
                if (s_player_pipe < 0) then {
                s_player_pipe = player addAction["Smoke Pipe", "custom\smokeshit\pipesmoke.sqf","", 1, true, true, "", ""];
    };
        } else {
    player removeAction s_player_pipe;
    s_player_pipe = -1;
        };

 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...