Jump to content

player camera is aiming at water or player is near water


Recommended Posts

Posted
//L Taste
mp.keys.bind(0x45, true, function() {
    if(mp.players.local.isTypingInTextChat) return;
    mp.game.graphics.notify("On the way");
    mp.game.graphics.notify("On the way");
    mp.console.logInfo("example", false, false);

    const camera = mp.cameras.new("gameplay");
    mp.game.graphics.notify("On the way1");

    let position = camera.getCoord(); 
    mp.game.graphics.notify("On the way2");

    let distance = 30;
    mp.game.graphics.notify("On the way3");

    let direction = camera.getDirection();
    mp.game.graphics.notify("On the way4");

    let farAway = new mp.Vector3((direction.x * distance) + (position.x), (direction.y * distance) + (position.y), (direction.z * distance) + (position.z));
    mp.game.graphics.notify("On the way5");

    let [val1, val2] = mp.game.water.testVerticalProbeAgainstAllWater(position, farAway);
    //mp.game.water.testProbeAgainstWater(position, farAway);
    mp.game.graphics.notify("On the way6");

    if(val1 == true)
    {
        mp.game.graphics.notify("True");
    }
    else{
        mp.game.graphics.notify("False");
    }
});

Why this not Working ?

 

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...