rebar-altv icon indicating copy to clipboard operation
rebar-altv copied to clipboard

function useweapon bug,

Open kobo07 opened this issue 6 months ago • 0 comments

/** * Save current player weapons */ function save() { const document = Rebar.document.character.useCharacter(player); if (!document.get()) { return; }

    const ammo: { [key: string]: number } = {};
    for (let weapon of player.weapons) {
        ammo[weapon.hash] = player.getAmmo(weapon.hash);
    }

    document.setBulk({
        weapons: player.weapons,
        ammo: ammo,
    });
}

player.getAmmo(weapon.hash) not work, the hash should be the ammohash,not weapon hash...

getweaponhash is ok..

kobo07 avatar Aug 18 '24 19:08 kobo07