Jump to content

How to set AK-47 weapon properties to TEC-9?


hipolitalakaj

Recommended Posts

setWeaponProperty(30, "poor", "flags", 0x000002) -- toggle 'only needs arm to aim'
setWeaponProperty(30, "poor", "flags", 0x000800) -- toggle 'can use 2x guns at same time'
-- etc. 

You need to use the numbers from https://wiki.multitheftauto.com/wiki/Weapon_Flags to toggle them between on and off. If you want to know if it's on, use 

function isWeaponFlagSet(weapon, skill, flagBit)
  return bitAnd(getWeaponProperty(weapon, skill, "flags"), flagBit) ~= 0 -- collects the current weapon bitflags, filters them using a bitwise And operation to only retain bits of flagBit, and checks if it's not 0
end

or if you prefer, you can use this function to explicitly enable or disable rather than switch flipping current state

-- Set or clear an individual weapon flag bit
function setWeaponPropertyFlag( weapon, skill, flagBit, bSet )
    local bIsSet = bitAnd( getWeaponProperty(weapon, skill, "flags"), flagBit ) ~= 0
    if bIsSet ~= bSet then
        setWeaponProperty(weapon, skill, "flags", flagBit)
    end
end
-- from setWeaponProperty wiki example

 

Edited by MrTasty
Link to comment

"flag_type_dual"=true means that you can TWO guns at the same time, ak47 has it false already

what i think you need is

https://wiki.multitheftauto.com/wiki/SetWeaponProperty

here:

"flag_type_heavy" -- bool - Can't jump
"flag_move_and_aim" -- bool - Can move and aim at same time
"flag_move_and_shoot" -- bool - Can move and fire at same time
"flag_aim_arm" -- bool - Uses other arm for aiming
"flag_shot_slows" -- bool - Slows down (area effect)

 

Link to comment
7 hours ago, KINGKHAN said:

there is already 1 resource in community were you can use 2 m4 or ak47 like uzi or tec 9

Oh man, I don't wanna use 2 ak47 in hand... I just want to set tec9 to single hand if the tec9 skill level is pro... because the tec9 pro skill level is dual hands by default you understand? sorry, my english is s.ck ...

Link to comment

Then you probably just want to do

setWeaponProperty(32, "pro", "flags", 0x000800) -- toggle 'can use 2x guns at same time' flag
-- or 
setWeaponProperty(32, "pro", "flag_type_dual", false) -- turn off flag_type_dual (I've never used this method, can't attest as to whether it works)

 

  • Like 1
Link to comment

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