Scripting/Squirrel/Functions/GetWeaponDataValue: Difference between revisions
Jump to navigation
Jump to search
This wiki is using an old backup from 2020
Some information may be old/missing
mNo edit summary |
ProsuWANTED (talk | contribs) No edit summary |
||
Line 7: | Line 7: | ||
== Arguments == | == Arguments == | ||
* '' | * ''int'' '''weaponID''' - model ID of weapon | ||
* '' | * ''int'' '''fieldID''' - [[WeaponDataValue|field ID]] of data you want to get | ||
== Example == | == Example == | ||
The following example will change stubby shotgun's range to minigun's one. | The following example will change stubby shotgun's range to minigun's one. | ||
<source lang=squirrel> | <source lang=squirrel> | ||
Line 20: | Line 21: | ||
=== Notes === | === Notes === | ||
Call [[onScriptLoad]] were used in this example. More info about them in the corresponding pages. | Call [[onScriptLoad]] were used in this example. More info about them in the corresponding pages. | ||
Revision as of 11:14, 2 August 2015
This function will return a data value of a weapon. (damage, range, etc)
Syntax
GetWeaponDataValue( weaponID , fieldID )
Arguments
- int weaponID - model ID of weapon
- int fieldID - field ID of data you want to get
Example
The following example will change stubby shotgun's range to minigun's one.
function onScriptLoad()
{
SetWeaponDataValue( 21, 2, GetWeaponDataValue( 33, 2 ) );
}
Notes
Call onScriptLoad were used in this example. More info about them in the corresponding pages.