Avagard Posted May 1, 2017 Share Posted May 1, 2017 why i can't move while shooting? what is the problem function shootingWhileMoving() setWeaponProperty(23, "poor", "flag_move_and_aim", true ) setWeaponProperty( 24, "poor", "flag_move_and_aim",true) setWeaponProperty( 25, "poor", "flag_move_and_aim",true ) setWeaponProperty( 26, "poor", "flag_move_and_aim",true) setWeaponProperty( 27, "poor", "flag_move_and_aim", true ) setWeaponProperty( 29, "poor", "flag_move_and_aim", true ) setWeaponProperty( 30, "poor", "flag_move_and_aim", true ) setWeaponProperty( 31, "poor", "flag_move_and_aim",true ) setWeaponProperty( 33, "poor", "flag_move_and_aim", true) setWeaponProperty( 34, "poor", "flag_move_and_aim", true ) setWeaponProperty(23, "poor", "flag_move_and_shoot", true ) setWeaponProperty( 24, "poor", "flag_move_and_shoot",true) setWeaponProperty( 25, "poor", "flag_move_and_shoot",true ) setWeaponProperty( 26, "poor", "flag_move_and_shoot",true) setWeaponProperty( 27, "poor", "flag_move_and_shoot", true ) setWeaponProperty( 29, "poor", "flag_move_and_shoot", true ) setWeaponProperty( 30, "poor", "flag_move_and_shoot", true ) setWeaponProperty( 31, "poor", "flag_move_and_shoot",true ) setWeaponProperty( 33, "poor", "flag_move_and_shoot", true) setWeaponProperty( 34, "poor", "flag_move_and_shoot", true ) end addEventHandler("onResourceStart",root,shootingWhileMoving) Link to comment
Avagard Posted May 1, 2017 Author Share Posted May 1, 2017 (edited) 7 minutes ago, ZoRRoM said: Is your skill state poor? idk maybe there is a problem with this? addEventHandler("onPlayerJoin",root, function() setPedStat ( source, 70, 999 ) setPedStat ( source, 71, 999 ) setPedStat ( source, 72, 999 ) setPedStat ( source, 74, 999 ) setPedStat ( source, 76, 999 ) setPedStat ( source, 77, 999 ) setPedStat ( source, 78, 999 ) setPedStat ( source, 79, 999 ) end ) Edited May 1, 2017 by Avagard Link to comment
undefined Posted May 1, 2017 Share Posted May 1, 2017 https://wiki.multitheftauto.com/wiki/Weapon_skill_levels You can look for this. If you want to apply this for all stats; use poor, std and pro. Link to comment
Avagard Posted May 1, 2017 Author Share Posted May 1, 2017 2 minutes ago, ZoRRoM said: https://wiki.multitheftauto.com/wiki/Weapon_skill_levels You can look for this. If you want to apply this for all stats; use poor, std and pro. so what is my current level? Link to comment
undefined Posted May 1, 2017 Share Posted May 1, 2017 (edited) You can use gedPedStat for get your stat. For sawnoff; If your stat is in 0-200 you are poor, 200-999 std, 999 pro. You can use it for all levels. local properties = { weapons = {23,24,25,26,27,29,30,31,33,34}, levels = {"poor", "std", "pro"} } function shootingWhileMoving() for _, id in pairs(properties.weapons) do for _, level in pairs(properties.levels) do setWeaponProperty(id, levels, "flag_move_and_aim", true) setWeaponProperty(id, levels, "flag_move_and_shoot", true) end end end Edited May 1, 2017 by ZoRRoM Link to comment
Fist Posted May 1, 2017 Share Posted May 1, 2017 4 hours ago, ZoRRoM said: You can use gedPedStat for get your stat. For sawnoff; If your stat is in 0-200 you are poor, 200-999 std, 999 pro. You can use it for all levels. local properties = { weapons = {23,24,25,26,27,29,30,31,33,34}, levels = {"poor", "std", "pro"} } function shootingWhileMoving() for _, id in pairs(properties.weapons) do for _, level in pairs(properties.levels) do setWeaponProperty(id, levels, "flag_move_and_aim", true) setWeaponProperty(id, levels, "flag_move_and_shoot", true) end end end this is better way to write it, less code required. function shootingWhileMoving() for i=23,34 do for _,level in pairs({"poor", "std", "pro"}) do setWeaponProperty(i, level, "flag_move_and_aim", true) setWeaponProperty(i, level, "flag_move_and_shoot", true) end end end Link to comment
Avagard Posted May 1, 2017 Author Share Posted May 1, 2017 for some reason its still not working... nothing on debug Link to comment
Fist Posted May 1, 2017 Share Posted May 1, 2017 5 hours ago, Avagard said: for some reason its still not working... nothing on debug you used my example? Try this then function shootingWhileMoving() for i=23,34 do local wepid = i; for _,level in pairs({"poor", "std", "pro"}) do setWeaponProperty(wepid, level, "flag_move_and_aim", true) setWeaponProperty(wepid, level, "flag_move_and_shoot", true) end end end Link to comment
undefined Posted May 2, 2017 Share Posted May 2, 2017 (edited) 8 hours ago, Fist said: this is better way to write it, less code required. function shootingWhileMoving() for i=23,34 do for _,level in pairs({"poor", "std", "pro"}) do setWeaponProperty(i, level, "flag_move_and_aim", true) setWeaponProperty(i, level, "flag_move_and_shoot", true) end end end Avagard is not use 28 id. ------ local properties = { weapons = {23,24,25,26,27,29,30,31,33,34}, levels = {"poor", "std", "pro"} } function shootingWhileMoving() for _, id in pairs(properties.weapons) do for _, level in pairs(properties.levels) do setWeaponProperty(id, levels, "flags", 0x000010) setWeaponProperty(id, levels, "flags", 0x000020) end end end Try it. Edited May 2, 2017 by ZoRRoM Link to comment
Fist Posted May 2, 2017 Share Posted May 2, 2017 1 minute ago, ZoRRoM said: Avagard is not use 28 id. ------ local properties = { weapons = {23,24,25,26,27,29,30,31,33,34}, levels = {"poor", "std", "pro"} } function shootingWhileMoving() for _, id in pairs(properties.weapons) do for _, level in pairs(properties.levels) do setWeaponProperty(id, levels, "flags", 0x000010) setWeaponProperty(id, levels, "flags", 0x000020) end end end Try it. You still can add extra check variable like this function shootingWhileMoving() for i=23,34 do if (i ~= 28) then local wepid = i; for _,level in pairs({"poor", "std", "pro"}) do setWeaponProperty(wepid, level, "flag_move_and_aim", true) setWeaponProperty(wepid, level, "flag_move_and_shoot", true) end end end end but agreed, in this case would better just to use table. Link to comment
undefined Posted May 2, 2017 Share Posted May 2, 2017 2 minutes ago, Fist said: You still can add extra check variable like this function shootingWhileMoving() for i=23,34 do if (i ~= 28) then local wepid = i; for _,level in pairs({"poor", "std", "pro"}) do setWeaponProperty(wepid, level, "flag_move_and_aim", true) setWeaponProperty(wepid, level, "flag_move_and_shoot", true) end end endend but agreed, in this case would better just to use table. Link to comment
Avagard Posted May 2, 2017 Author Share Posted May 2, 2017 still not working! it works for 2 secs then i can't move used both codes Link to comment
HeySlickThatsMe Posted May 2, 2017 Share Posted May 2, 2017 You can also do the same as you did at the start , except that copy everything and change "poor" to "std" then again copy it and change "std" to "pro" Link to comment
Avagard Posted May 2, 2017 Author Share Posted May 2, 2017 1 hour ago, ThatsMe said: You can also do the same as you did at the start , except that copy everything and change "poor" to "std" then again copy it and change "std" to "pro" tried it didn't work.. full code addEventHandler("onPlayerJoin",root, function() setPedStat ( source, 70, 999 ) setPedStat ( source, 71, 999 ) setPedStat ( source, 72, 999 ) setPedStat ( source, 74, 999 ) setPedStat ( source, 76, 999 ) setPedStat ( source, 77, 999 ) setPedStat ( source, 78, 999 ) setPedStat ( source, 79, 999 ) end ) function shootingWhileMoving() setWeaponProperty(23, "poor", "flag_move_and_aim", true ) setWeaponProperty( 24, "poor", "flag_move_and_aim",true) setWeaponProperty( 25, "poor", "flag_move_and_aim",true ) setWeaponProperty( 26, "poor", "flag_move_and_aim",true) setWeaponProperty( 27, "poor", "flag_move_and_aim", true ) setWeaponProperty( 29, "poor", "flag_move_and_aim", true ) setWeaponProperty( 30, "poor", "flag_move_and_aim", true ) setWeaponProperty( 31, "poor", "flag_move_and_aim",true ) setWeaponProperty( 33, "poor", "flag_move_and_aim", true) setWeaponProperty( 34, "poor", "flag_move_and_aim", true ) setWeaponProperty(23, "poor", "flag_move_and_shoot", true ) setWeaponProperty( 24, "poor", "flag_move_and_shoot",true) setWeaponProperty( 25, "poor", "flag_move_and_shoot",true ) setWeaponProperty( 26, "poor", "flag_move_and_shoot",true) setWeaponProperty( 27, "poor", "flag_move_and_shoot", true ) setWeaponProperty( 29, "poor", "flag_move_and_shoot", true ) setWeaponProperty( 30, "poor", "flag_move_and_shoot", true ) setWeaponProperty( 31, "poor", "flag_move_and_shoot",true ) setWeaponProperty( 33, "poor", "flag_move_and_shoot", true) setWeaponProperty( 34, "poor", "flag_move_and_shoot", true ) --- setWeaponProperty(23, "std", "flag_move_and_aim", true ) setWeaponProperty( 24, "std", "flag_move_and_aim",true) setWeaponProperty( 25, "std", "flag_move_and_aim",true ) setWeaponProperty( 26, "std", "flag_move_and_aim",true) setWeaponProperty( 27, "std", "flag_move_and_aim", true ) setWeaponProperty( 29, "std", "flag_move_and_aim", true ) setWeaponProperty( 30, "std", "flag_move_and_aim", true ) setWeaponProperty( 31, "std", "flag_move_and_aim",true ) setWeaponProperty( 33, "std", "flag_move_and_aim", true) setWeaponProperty( 34, "std", "flag_move_and_aim", true ) setWeaponProperty(23, "std", "flag_move_and_shoot", true ) setWeaponProperty( 24, "std", "flag_move_and_shoot",true) setWeaponProperty( 25, "std", "flag_move_and_shoot",true ) setWeaponProperty( 26, "std", "flag_move_and_shoot",true) setWeaponProperty( 27, "std", "flag_move_and_shoot", true ) setWeaponProperty( 29, "std", "flag_move_and_shoot", true ) setWeaponProperty( 30, "std", "flag_move_and_shoot", true ) setWeaponProperty( 31, "std", "flag_move_and_shoot",true ) setWeaponProperty( 33, "std", "flag_move_and_shoot", true) setWeaponProperty( 34, "std", "flag_move_and_shoot", true ) --- setWeaponProperty(23, "pro", "flag_move_and_aim", true ) setWeaponProperty( 24, "pro", "flag_move_and_aim",true) setWeaponProperty( 25, "pro", "flag_move_and_aim",true ) setWeaponProperty( 26, "pro", "flag_move_and_aim",true) setWeaponProperty( 27, "pro", "flag_move_and_aim", true ) setWeaponProperty( 29, "pro", "flag_move_and_aim", true ) setWeaponProperty( 30, "pro", "flag_move_and_aim", true ) setWeaponProperty( 31, "pro", "flag_move_and_aim",true ) setWeaponProperty( 33, "pro", "flag_move_and_aim", true) setWeaponProperty( 34, "pro", "flag_move_and_aim", true ) setWeaponProperty(23, "pro", "flag_move_and_shoot", true ) setWeaponProperty( 24, "pro", "flag_move_and_shoot",true) setWeaponProperty( 25, "pro", "flag_move_and_shoot",true ) setWeaponProperty( 26, "pro", "flag_move_and_shoot",true) setWeaponProperty( 27, "pro", "flag_move_and_shoot", true ) setWeaponProperty( 29, "pro", "flag_move_and_shoot", true ) setWeaponProperty( 30, "pro", "flag_move_and_shoot", true ) setWeaponProperty( 31, "pro", "flag_move_and_shoot",true ) setWeaponProperty( 33, "pro", "flag_move_and_shoot", true) setWeaponProperty( 34, "pro", "flag_move_and_shoot", true ) end 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