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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...