Scripting/Squirrel/Functions/Player.Weapon: Difference between revisions
Jump to navigation
Jump to search
This wiki is using an old backup from 2020
Some information may be old/missing
Line 3: | Line 3: | ||
== Example == | == Example == | ||
This command gives player the name of the weapon they are using when they type '/ | This command gives player the name of the weapon they are using when they type '/mywep'. | ||
<pre>function onPlayerCommand( player, cmd, text ) | <pre>function onPlayerCommand( player, cmd, text ) |
Revision as of 19:27, 4 April 2016
Syntax
int player.Weapon
Example
This command gives player the name of the weapon they are using when they type '/mywep'.
function onPlayerCommand( player, cmd, text ) { if ( cmd == "mywep" ) { MessagePlayer( "Your current weapon: " + GetWeaponName( player.Weapon ), player ); } }