Squirrel/Server/Functions/Game/CloseGarage

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with '{{Squirrel/Title|CloseGarage}} This function closes the given garage door. List of garage IDs can be found from here. == Syntax == <code>b…')
 
Line 12: Line 12:
 
== Example ==
 
== Example ==
  
{{Squirrel/NeedsExample}}
+
This will close the Portland hideout garage when the player types /closesesame
Explanation for the example
+
  
 
<code lang="squirrel">
 
<code lang="squirrel">
-- todo
+
function onPlayerCommand( pPlayer, szCommand, szText )
 +
{
 +
if ( szCommand == "closesesame" )
 +
{
 +
CloseGarage( PORTLAND_HIDEOUT_GARAGE );
 +
}
 +
 +
return 1;
 +
}
 
</code>
 
</code>
  
 
=== Notes ===
 
=== Notes ===
  
-- List of used functions and other notes here.
+
The event [[Squirrel/Server/Events/Player/onPlayerCommand|onPlayerCommand]] was used in this example. More info about this in the corresponding page.
  
 
== Related Functions ==
 
== Related Functions ==
  
 
{{Squirrel/Server/Functions/Game}}
 
{{Squirrel/Server/Functions/Game}}

Revision as of 23:46, 19 October 2010

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

This function closes the given garage door. List of garage IDs can be found from here.

Syntax

  1. bool CloseGarage( int garage )

Arguments

  • garage - This is the ID of the garage you want to close. List of garage IDs can be found from here

Example

This will close the Portland hideout garage when the player types /closesesame

  1.  
  2. function onPlayerCommand( pPlayer, szCommand, szText )
  3. {
  4. if ( szCommand == "closesesame" )
  5. {
  6. CloseGarage( PORTLAND_HIDEOUT_GARAGE );
  7. }
  8. return 1;
  9. }
  10.  

Notes

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

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox