Jump to content

attachelements problem


Derpy

Recommended Posts

Posted

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?

Posted (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 by Guest
Posted

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

Posted

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

Posted

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

Posted

please help me guys i dont know why doesnt this change my custom weapon's property of maximum distance where it can shoot at..........

  • Moderators
Posted

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

Posted

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? :shock:

  • Moderators
Posted

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  

Posted

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) 

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