Jump to content

Help, how to disable actions in interiors


Recommended Posts

Posted

Hello everyone, tell me, I wrote a script that allows you to pick up snowballs on the street, the question is how to disable the ability to pick them up in interiors, I mean 24/7, etc.

Posted
On 9/15/2023 at 9:13 PM, Kopra said:

You didn't specify API that you use(C# or JS) so I will give you JS example, should be easy to convert to C# too.

Client side:

const {x, y, z} = mp.players.local.position;
const interiorId = mp.game.interior.getInteriorAtCoords(x, y, z);
if (interiorId === 0) {
    // player is not in interior
} else {
    // player is in interior
}

Interior::getInteriorAtCoords - RAGE Multiplayer Wiki

Thank you very much, but I noticed that if you are near the interior without entering it, then interior > 0

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...