Derpy Posted October 11, 2014 Share Posted October 11, 2014 hello folks, im working on my custom weapon system and im planning to use createWeapon function and then attach it to a vehicle or a ped however im experiencing a problem and i dont know how to avoid this problem whenever i use attachElements function the element that was attached to another gets attached in exactly middle of other element and i cant change position of attached element after it was attached to another element. any ideas? Link to comment
Dealman Posted October 11, 2014 Share Posted October 11, 2014 Read about the function, you'll need to use the offsets. Link to comment
Derpy Posted October 11, 2014 Author Share Posted October 11, 2014 (edited) thanks i have tried this but im having a problem ---- no matter what i do, i cant change weapon's rotation. (tried on all weapons except projectiles) Edited October 11, 2014 by Guest Link to comment
TAPL Posted October 11, 2014 Share Posted October 11, 2014 Use rotation offset arguments of the function attachElements. Link to comment
Derpy Posted October 11, 2014 Author Share Posted October 11, 2014 alright thanks umm just been wondering.. is there a way how i could predict where bullets would go? i'd like to make a crosshair or a 3d line or something to make it easier to fire but not sure how to get the point to which bullets will be fired into Link to comment
Anubhav Posted October 11, 2014 Share Posted October 11, 2014 getPedWeaponMuzzlePosition Link to comment
Derpy Posted October 12, 2014 Author Share Posted October 12, 2014 yes annubhav that could be used for peds or players but what about vehicles?there must be something.. i have no idea how to make crosshair for vehicles which would move crosshair according to where the bullets would be shot at Link to comment
Anubhav Posted October 12, 2014 Share Posted October 12, 2014 See the laser by vick, I think it will help you out. https://community.multitheftauto.com/ind ... ils&id=652 Link to comment
John Smith Posted October 12, 2014 Share Posted October 12, 2014 Or he could just use event onClientWeaponFire and extract hit positions from there. Link to comment
Derpy Posted October 12, 2014 Author Share Posted October 12, 2014 oh right thanks but i have noticed if i do this setWeaponProperty(hydraMG,"weapon_range",number) setWeaponProperty(hydraMG,"target_range",number) no matter which number i put, minigun will shoot at same low distance and i cant increase distance.. Link to comment
Derpy Posted October 12, 2014 Author Share Posted October 12, 2014 please help me guys i dont know why doesnt this change my custom weapon's property of maximum distance where it can shoot at.......... Link to comment
Moderators IIYAMA Posted October 12, 2014 Moderators Share Posted October 12, 2014 (most) weapon property's don't work custom weapons. I already found out that problem when I tried them on their release. They haven't fixed them...... yet....... I also reported a related bug on 2013-07-13. https://bugs.multitheftauto.com/view.php?id=7706 Those weapons where suppose to be serverside too........ But it seems they lost their interest in custom weapons. It is shame. Link to comment
Saml1er Posted October 12, 2014 Share Posted October 12, 2014 Since createWeapon returns an element then how can you set it's property? I mean first arguement of setWeaponProperty must be int/string. Does wiki example has a typo? Link to comment
Moderators IIYAMA Posted October 12, 2014 Moderators Share Posted October 12, 2014 You have to scroll more down: (client part) setWeaponProperty 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" ): "weapon_range" - float "target_range" - float "accuracy" - float "damage" - int FROM VERSION 1.4 r6693 ONWARDS "fire_rotation" - vector - For aligning fire direction with model theValue: The value to set the property to. Returns Returns true if the property was set. Requirements Minimum supported server n/a Minimum supported client 1.3.0-9.04555 Link to comment
Derpy Posted October 12, 2014 Author Share Posted October 12, 2014 Oh. Well i guess that it will take MTA Devs 6 or more months to fix this due to their known laziness. Link to comment
Derpy Posted October 12, 2014 Author Share Posted October 12, 2014 Anyway if anyone is interested in doing something similiar to this like i did or what IYYAMA did, there is a work-around for it. it's actually pretty simple (tested only on server-side) setWeaponProperty(38,"pro","target_range",300) setWeaponProperty(38,"pro","weapon_range",300) 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