Squirrel/Server/Functions/Utils/IsIn

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with "{{Squirrel/Title|IsIn}} This function check if the district is a district (Red Light District == Red Light District, returns true) == Syntax == <code>IsIn ( string District1...")

Revision as of 11:52, 26 August 2014

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