Scripting/Squirrel/Functions/GetWeaponDataValue: Difference between revisions

From Vice City Multiplayer
Jump to navigation Jump to search
Caution icon
This wiki is using an old backup from 2020
Some information may be old/missing
(Created page with "This function will return a data value of a weapon. (damage, range, etc) == Syntax == <pre>GetWeaponDataValue( weaponID , fieldID )</pre> == Arguments == * ''integer'' '''...")
 
No edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 7: Line 7:
== Arguments ==
== Arguments ==


* ''integer'' '''weaponID''' - model ID of weapon
* ''int'' '''weaponID''' - model ID of weapon
* ''integer'' '''fieldID'''  - field ID of data you want to get ( [[WeaponDataValue]] )
* ''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>
function onScriptLoad()
function onScriptLoad()
{
{
     SetWeaponDataValue( 21, 2, GetWeaponDataValue( 21, 2 ) );
     SetWeaponDataValue( 21, 2, GetWeaponDataValue( 33, 2 ) );
}
}
</source>
</source>


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


Line 25: Line 27:


{{Scripting/Squirrel/Functions/Weapon Functions}}
{{Scripting/Squirrel/Functions/Weapon Functions}}
[[Category:Scripting/Squirrel/Functions/Weapon_Functions]]

Latest revision as of 22:06, 30 January 2017

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.

Related Functions