IsIn

From Liberty Unleashed Wiki
Jump to: navigation, search
Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This function check if the district is a district (Red Light District == Red Light District, returns true)

Syntax

  1. IsIn ( string District1, string District2 )

Example

This example check if the player is in 'Red Light District' when player types '/check'

  1.  
  2. function onPlayerCommand ( pPlayer, szCommand, szParams ) {
  3.  
  4. switch ( szCommand ) {
  5.  
  6. case "check": {
  7.  
  8. if ( IsIn ( GetDistrictName ( pPlayer.Pos.x, pPlayer.Pos.y ), "Red Light District" ) ) ) {
  9. MessagePlayer ( "true", pPlayer );
  10.  
  11. return;
  12. }
  13.  
  14. MessagePlayer ( "false", pPlayer );
  15.  
  16. return;
  17. }
  18. }
  19. }
  20.  

Notes

The function MessagePlayer, GetDistrictName and call onPlayerCommand were used in this example. More info about them in corresponding pages.

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox