hipolitalakaj Posted January 14, 2019 Share Posted January 14, 2019 How can I set AK-47 weapon properties to TEC-9 (or to any other weapon)? Trying to set dual hand to false, but nothing changes if I type test. -- Server side -- function aktest(player) setWeaponProperty(32, "poor", "flag_type_dual", false) end addCommandHandler("test", aktest) Link to comment
Addlibs Posted January 14, 2019 Share Posted January 14, 2019 (edited) 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 January 14, 2019 by MrTasty Link to comment
savour Posted January 14, 2019 Share Posted January 14, 2019 "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
hipolitalakaj Posted January 14, 2019 Author Share Posted January 14, 2019 I know that ak47 has it false by default, but I want to put ak skin to tec-9 and tec-9 use dual hands if the skill level is pro. So, I want to disable tec-9 dual hands. Link to comment
hipolitalakaj Posted January 15, 2019 Author Share Posted January 15, 2019 Ok, I trying to explain a bit more. I want to use tec-9 as ak-47. so I need to change all of tec-9 properties to ak-47 but my mind is blank now. I know that I need to use the SetWeaponProperty but I don't know full of the ak-47 properties. Link to comment
Storm-Hanma Posted January 15, 2019 Share Posted January 15, 2019 there is already 1 resource in community were you can use 2 m4 or ak47 like uzi or tec 9 Link to comment
hipolitalakaj Posted January 15, 2019 Author Share Posted January 15, 2019 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
Addlibs Posted January 15, 2019 Share Posted January 15, 2019 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) 1 Link to comment
hipolitalakaj Posted January 15, 2019 Author Share Posted January 15, 2019 Thanks for your help @MrTasty, yeah I did it with that method now (I just used skill level "poor" before that's why don't changed the dual hands...) And how can I set the tec9's fire speed as ak-47? It's possible to change hold the tec-9 anim like ak47? Link to comment
hipolitalakaj Posted January 15, 2019 Author Share Posted January 15, 2019 Okay, I did the fire_speed with the anim_loop_start/stop and anim2_loop_start/stop properties, now just want one more thing, which is the anim. So just want to change the tec-9 anim's to the ak-47 anim when aiming and hold the weapon. Can someone help me how to do this? Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now