Squirrel/Server/Functions/Weapons/GetWeaponIDFromName
From Liberty Unleashed Wiki
(Difference between revisions)
(New page: __NOTOC__ This function returns the ID of the weapon from its name. == Syntax == <code>int GetWeaponIDFromName( string weaponName )</code> == Arguments == * '''weaponName''' - The name...) |
(→Example) |
||
Line 12: | Line 12: | ||
== Example == | == Example == | ||
− | |||
<code lang="squirrel"> | <code lang="squirrel"> | ||
− | + | function onPlayerCommand( player, command, text ) | |
+ | { | ||
+ | if ( command == "wepid" ) GetWeaponIDFromName( text ); | ||
+ | } | ||
</code> | </code> | ||
=== Notes === | === Notes === | ||
− | + | This function is used to get the weapon ID of the given text. | |
== Related Functions == | == Related Functions == | ||
{{Squirrel/Server/Functions/Misc}} | {{Squirrel/Server/Functions/Misc}} |
Revision as of 02:38, 7 January 2010
This function returns the ID of the weapon from its name.
Syntax
int GetWeaponIDFromName( string weaponName )
Arguments
- weaponName - The name of the weapon
Example
function onPlayerCommand( player, command, text ) { if ( command == "wepid" ) GetWeaponIDFromName( text ); }
Notes
This function is used to get the weapon ID of the given text.