Scripting/Squirrel/Functions/ResetAllWeaponData: 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 reset a weapon's settings to the defaults. (damage, range, etc) == Syntax == <pre>ResetAllWeaponData( )</pre> == Arguments == * '''N/A''' == Example ==...")
 
No edit summary
 
(One intermediate revision by one other user not shown)
Line 10: Line 10:


== Example ==
== Example ==
The following example will check if the data value of the weapon, from player's hand, was edited.
The following example will reset all weapons data to defaults.
<source lang=squirrel>
<source lang=squirrel>
function onPlayerCommand( player, cmd, text );
function onPlayerCommand( player, cmd, text );
Line 28: Line 28:


{{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 reset a weapon's settings to the defaults. (damage, range, etc)

Syntax

ResetAllWeaponData( )

Arguments

  • N/A

Example

The following example will reset all weapons data to defaults.

function onPlayerCommand( player, cmd, text );
{
     if( cmd == "resetweapons" )
     {
          ResetAllWeaponData( );
          Message( "All weapons were reseted to default settings !!" );
     }
}

Notes

Call onPlayerCommand were used in this example. More info about them in the corresponding pages.

Related Functions