Jump to content
RAGE Multiplayer Community

Does anyone know how to open the Fleeca bank vaults programmatically. Let's say for a heist situation


MxPrime
 Share

Recommended Posts

The title pretty much sums it up. There are Flecca banks all over the map. In the back of them, there are big vault doors. How might I, programmatically, allow a player to open them. Some sample code would be appreciated. Here is some scratch code I have tried. A command on the server calls this on the client

 

// https://cdn.rage.mp/public/odb/index.html#v_ilev_gb_vauldr

mp.events.add('door', player => {
    const key = 'v_ilev_gb_vauldr'
    const modelHash = mp.game.joaat(key)
    // const woodDoorKey = 'v_ilev_gb_teldr'
    // const woodDoorModelHash = mp.game.joaat(woodDoorKey);

    const vector = new mp.Vector3(player.position.x, player.position.y, player.position.z);

    const obj = mp.game.object.getClosestObjectOfType(vector.x, vector.y, vector.z, 10.0, modelHash, false, true, true)

    //mp.game.object.addDoorToSystem(modelHash, modelHash, vector.x, vector.y, vector.z, true, true, true);
    mp.game.object.doorControl(modelHash, vector.x, vector.y, vector.z, false, 0.0, 50.0, 0.0);
    mp.game.object.doorControl(woodDoorModelHash, vector.x, vector.y, vector.z, false, 0.0, 50.0, 0.0);
    //mp.game.object.setDoorAjarAngle(modelHash, true, true, true);

    mp.gui.chat.push(`model hash: ${modelHash}`)

    // obj.playAnimation('[email protected]@[email protected]_vault_door', 'bank_vault_door_opens', 8, 0)
})

 

Link to comment
Share on other sites

I tried this. Did not work. I think the prop name might be incorrect. I'm pretty sure this (https://cdn.rage.mp/public/odb/index.html#v_ilev_gb_vauldr) is it

mp.events.add('door', player => {
    const key = 'v_ilev_gb_vauldr'
    const modelHash = mp.game.joaat(key)

    const vector = new mp.Vector3(player.position.x, player.position.y, player.position.z);

    const interiorID = mp.game.interior.getInteriorAtCoords(vector.x, vector.y, vector.z);

    mp.game.interior.disableInteriorProp(interiorID, key);
    mp.game.interior.refreshInterior(interiorID);

    mp.gui.chat.push(`int id : ${interiorID}`)
})

 

Link to comment
Share on other sites

  • 3 weeks later...

Just following up here for anyone who finds this discussion. The method `createHideModel` seems to do the trick. Although this just gets rid of the door completely. That would not very RP if a player was say hacking the door. I haven't tried yet, but rotating the door might be better

 

// https://cdn.rage.mp/public/odb/index.html#v_ilev_gb_vauldr

mp.events.add('door', player => {
    const key = 'v_ilev_gb_vauldr'
    const woodDoorName = 'v_ilev_gb_teldr'
    const modelHash = mp.game.joaat(key)
    const modelHashDoor = mp.game.joaat(woodDoorName)

    const vector = new mp.Vector3(144.15286254882812,-1041.8626708984375,29.367929458618164);

    const interiorID = mp.game.interior.getInteriorAtCoords(vector.x, vector.y, vector.z);

    // mp.game.interior.disableInteriorProp(interiorID, key);
    // mp.game.interior.disableInteriorProp(interiorID, woodDoorName);
    // mp.game.interior.refreshInterior(interiorID);

    mp.game.entity.createModelHide(vector.x, vector.y, vector.z, 100,  modelHash, true);
    mp.game.entity.createModelHide(vector.x, vector.y, vector.z, 100,  modelHashDoor, true);

    if (mp.game.interior.isInteriorPropEnabled(interiorID, key)) {
        mp.gui.chat.push('true');
    } else {
        mp.gui.chat.push('false');
    }

    mp.gui.chat.push(`int id : ${interiorID}`)
})

 

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
 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...