Moderators IIYAMA Posted July 1, 2013 Moderators Posted July 1, 2013 Why don't setweaponproperty from custom weapons work? somebody does have the same problem? meta: local weapon1 = createWeapon ( "m4",0,0,0+5 ) setWeaponClipAmmo ( weapon1,99999) setWeaponProperty ( weapon1, "accuracy", 0.00001) setWeaponProperty ( weapon1,"weapon_range", 0.00001) setWeaponState (weapon1, "firing") Syntax (weapon creation) bool setWeaponProperty ( weapon theWeapon, string strProperty, value theValue ) Required Arguments theWeapon: the weapon to change the property of. strProperty: the property to edit such as damage per hit ( "damage" ). theValue: whatever you wish to set it to ( different properties use different data types so damage could be an int where as accuracy is a float ). Sets an individual weapons property. Only a handful of useful properties are supported now and it uses the same property names as setWeaponProperty server side. Returns true if the property was set. Requirements Minimum supported server n/a Minimum supported client 1.3.0-9.04555 Note: Using this function requires the resource to have the above minimum version declared in the meta.xml section. e.g.
iMr.3a[Z]eF Posted July 1, 2013 Posted July 1, 2013 1- are you sure about the weapon's position 2- be sure abot the codes side is client
Moderators IIYAMA Posted July 1, 2013 Author Moderators Posted July 1, 2013 both are correct. Normally that is in my vehicle weapon script. Does it work for you, changing them? (I get the boolean true returned, but it doesn't change anything)
iMr.3a[Z]eF Posted July 1, 2013 Posted July 1, 2013 strProperty: the property to edit such as damage per hit ( "damage" ). This is in ClintSide only
Moderators IIYAMA Posted July 1, 2013 Author Moderators Posted July 1, 2013 Does that mean it only supports "damage", If that is true, then wiki mta is very unclear. -_-" This is in ClintSide only I script client side. pls take me seriously, I am not a nab.
iMr.3a[Z]eF Posted July 1, 2013 Posted July 1, 2013 Does that mean it only supports "damage", If that is true, then wiki mta is very unclear. -_-" This is in ClintSide only I script client side. pls take me seriously, I am not a nab. why dont you write in Console "F8" debugscript 3 and hope that information is wrong.
Moderators IIYAMA Posted July 2, 2013 Author Moderators Posted July 2, 2013 @6ArHxiMr'3a[Z]eFwhy dont you write in Console "F8" debugscript 3 and hope that information is wrong. You have no idea what I have created in the past, I AM NOT A NAB SCRIPTER. TAKE ME SERIOUSLY!@! -_-"
iMr.3a[Z]eF Posted July 2, 2013 Posted July 2, 2013 @6ArHxiMr'3a[Z]eFwhy dont you write in Console "F8" debugscript 3 and hope that information is wrong. You have no idea what I have created in the past, I AM NOT A NAB SCRIPTER. TAKE ME SERIOUSLY!@! -_-" dude, i'll never help if i dont know the problem if you dont tell me about "debugscript 3"
Moderators IIYAMA Posted July 2, 2013 Author Moderators Posted July 2, 2013 The problem: setWeaponProperty doesn't make changes, in weapon range and accuration and everthing else. The result ends up "true", that means that it have to work. But it doesn't change a damn. local weapon1 = createWeapon ( "m4",0,0,5 ) outputChatBox("result: " .. tostring(setWeaponProperty ( weapon1, "accuracy", 0.00001)).. " accuracy have been succesfull set") outputChatBox ("result: " .. tostring(setWeaponProperty ( weapon1, "weapon_range", 0.00001)) .. " weapon_range have been succesfull set") setWeaponState (weapon1, "firing")
Spajk Posted July 2, 2013 Posted July 2, 2013 @6ArHxiMr'3a[Z]eFwhy dont you write in Console "F8" debugscript 3 and hope that information is wrong. You have no idea what I have created in the past, I AM NOT A NAB SCRIPTER. TAKE ME SERIOUSLY!@! -_-" dude, i'll never help if i dont know the problem if you dont tell me about "debugscript 3" He's trying to tell you that he isnt a newbie and that debugscript doesnt show anything...
Castillo Posted July 2, 2013 Posted July 2, 2013 I guess it's a bug from the function, you should report it in the bug tracker.
50p Posted July 2, 2013 Posted July 2, 2013 As far as I remember, you can't change custom weapon's range and accuracy. There is no reason why you should change accuracy since every bullet is shot in a straight line, there is no recoil whatsoever.
Xwad Posted August 16, 2016 Posted August 16, 2016 I have the same problem:/ if somebody knows the solution pls tell it me!
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