Jump to content

Question about custom weapons


IIYAMA

Recommended Posts

  • Moderators

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.

Link to comment
  • Moderators

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)

Link to comment
  • Moderators

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.

Link to comment
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.

Link to comment
  • Moderators
@6ArHxiMr'3a[Z]eF

why 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!@!

-_-"

Link to comment
@6ArHxiMr'3a[Z]eF

why 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"

Link to comment
  • Moderators

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") 

Link to comment
@6ArHxiMr'3a[Z]eF

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

Link to comment

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.

Link to comment
  • 3 years later...

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