Scripting/Squirrel/Functions/Player.Weapon: 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 "== Syntax == <pre>int player.Weapon</pre> == Example == This command gives player the name of the weapon they are using when they type '/c mywep'. <pre> function onPlayerCom...")
 
Line 5: Line 5:
This command gives player the name of the weapon they are using when they type '/c mywep'.
This command gives player the name of the weapon they are using when they type '/c mywep'.


<pre> function onPlayerCommand( player, cmd, text )
<pre>function onPlayerCommand( player, cmd, text )
{
{
     if ( cmd == "mywep" )
     if ( cmd == "mywep" )

Revision as of 09:16, 8 January 2015

Syntax

int player.Weapon

Example

This command gives player the name of the weapon they are using when they type '/c mywep'.

function onPlayerCommand( player, cmd, text )
{
     if ( cmd == "mywep" )
     {
          MessagePlayer( "Your current weapon: " + GetWeaponName( player.Weapon ), player );
     }
}