Squirrel/Server/Functions/SpawnClass/RemoveWeapon

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Example)
 
Line 1: Line 1:
__NOTOC__
+
{{Squirrel/Title|SpawnClass.RemoveWeapon}}
 
This function removes the spawn weapon from the given slot of a ''SpawnClass''.
 
This function removes the spawn weapon from the given slot of a ''SpawnClass''.
  

Latest revision as of 10:38, 11 October 2010

Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This function removes the spawn weapon from the given slot of a SpawnClass.

[edit] Syntax

  1. int SpawnClass.RemoveWeapon( int iSlot )

[edit] Arguments

  • iSlot - The slot you want to remove the weapon from. There are three slots available: 1, 2 and 3

[edit] Example

  1.  
  2. function onPlayerCommand( player, cmd, text )
  3. {
  4. if ( cmd == "remwep" )
  5. {
  6. p_SpawnClass.RemoveWeapon( 1 );
  7. }
  8. }
  9.  

This example will remove the weapon in slot 1, from the class, that we created earlier in FindSpawnClass.

[edit] Notes

The call onPlayerCommand was used in in this example. More info about this in the corresponding page.

[edit] Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox