Scripting/Squirrel/Functions/Misc/GetDistrictName
From VC-MP Wiki
This function returns the disrtict name from x and y coordinates.
Syntax
string GetDistrictName( float x, float y )
Example
This command tells player's location when someone types '/c loc playername'.
function onPlayerCommand( player, cmd, text ) { if ( cmd == "loc" ) { local plr = FindPlayer( text ); if ( !plr ) MessagePlayer( "Error: Player '" + text + "' is not online.", player ); else { local pos = plr.Pos; MessagePlayer( plr.Name + "'s location: " + GetDistrictName( pos.x, pos.y ), player ); } } }
Notes
The functions MessagePlayer, player.Name, player.Pos and call onPlayerCommand were used in in this example. More info about them in corresponding pages.
Related Functions
- Message
- MessagePlayer
- MessageAllExcept
- PrivMessage
- PrivMessageAll
- ClientMessage
- ClientMessageToAll
- Announce
- AnnounceAll
- SendPlayerMessage
- KickPlayer
- BanPlayer
- BanIP
- UnbanIP
- GetWeaponName
- GetWeaponID
- GetDistrictName
- GetSkinName
- GetTickCount
- GetTime
- GetFullTime
- IsNum
- BindKey
- UnbindKey
- CallFunc
- InPoly
- DistanceFromPoint
- ReloadScripts
