Squirrel/Server/Functions/Game/CloseGarage
From Liberty Unleashed Wiki
(Difference between revisions)
Line 10: | Line 10: | ||
* '''garage''' - This is the ID of the garage you want to close. List of garage IDs can be found from [[Squirrel/Server/Constants#Garages|here]] | * '''garage''' - This is the ID of the garage you want to close. List of garage IDs can be found from [[Squirrel/Server/Constants#Garages|here]] | ||
− | == Example == | + | == Example I == |
This will close the Portland hideout garage when the player types /closesesame | This will close the Portland hideout garage when the player types /closesesame | ||
Line 22: | Line 22: | ||
} | } | ||
+ | return 1; | ||
+ | } | ||
+ | </code> | ||
+ | |||
+ | == Example II == | ||
+ | |||
+ | This will close an garage by ID. List of garage IDs can be found from [[Squirrel/Server/Constants#Garages|here]] | ||
+ | <code lang="squirrel"> | ||
+ | function onPlayerCommand ( pPlayer, szCommand, szParams ) | ||
+ | { | ||
+ | if ( szCommand == "closegarage" ) | ||
+ | { | ||
+ | if ( !szParams ) MessagePlayer ( "You need to write the ID of the garage to close.", pPlayer ); | ||
+ | else CloseGarage ( szParams.tointeger ( ) ); | ||
+ | } | ||
+ | |||
return 1; | return 1; | ||
} | } |
Latest revision as of 23:57, 15 November 2013
This function closes the given garage door. List of garage IDs can be found from here.
[edit] Syntax
bool CloseGarage( int garage )
[edit] Arguments
- garage - This is the ID of the garage you want to close. List of garage IDs can be found from here
[edit] Example I
This will close the Portland hideout garage when the player types /closesesame
function onPlayerCommand( pPlayer, szCommand, szText ) { if ( szCommand == "closesesame" ) { CloseGarage( PORTLAND_HIDEOUT_GARAGE ); } return 1; }
[edit] Example II
This will close an garage by ID. List of garage IDs can be found from here
function onPlayerCommand ( pPlayer, szCommand, szParams ) { if ( szCommand == "closegarage" ) { if ( !szParams ) MessagePlayer ( "You need to write the ID of the garage to close.", pPlayer ); else CloseGarage ( szParams.tointeger ( ) ); } return 1; }
[edit] Notes
The event onPlayerCommand was used in this example. More info about this in the corresponding page.
[edit] Related Functions
- CloseGarage
- CloseSSVBridge
- EnableTrains
- GetBoundariesLower
- GetBoundariesUpper
- GetFriendlyFire
- GetGamespeed
- GetGravity
- GetHour
- GetIslands
- GetMinute
- GetSSVBridgeLock
- GetSSVBridgeUpdateTime
- GetSurfaceTraction
- GetTimeLock
- GetWeather
- GetWeatherLock
- IsSSVBridgeUp
- OpenGarage
- OpenSSVBridge
- SetBoundaries
- SetFriendlyFire
- SetGamespeed
- SetGravity
- SetIslands
- SetSSVBridgeLock
- SetSSVBridgeUpdateTime
- SetSurfaceTraction
- SetTime
- SetTimeLock
- SetWeather
- SetWeatherLock