GetDistrictName

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

This function finds the district name of given co-ordinates.

Syntax

  1. string GetDistrictName( float x, float y )

Arguments

  • x, y - The position as two floats

Example

  1.  
  2. function onPlayerCommand( pPlayer, szCommand, szText )
  3. {
  4. if ( szCommand == "district" )
  5. {
  6. local pos = pPlayer.Pos;
  7. local szDistrict = GetDistrictName( pos.x, pos.y );
  8. MessagePlayer( "You are currently in " + szDistrict + ".", pPlayer );
  9. }
  10. }
  11.  

This will tell the player what district they are currently in.

Notes

The functions Player.Pos, MessagePlayer and call onPlayerCommand were used in in this example. More info about them in the corresponding page.

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox