Squirrel/Server/Functions/Utils/IsIn
From Liberty Unleashed Wiki
(Difference between revisions)
(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
This function check if the district is a district (Red Light District == Red Light District, returns true)
Syntax
IsIn ( string District1, string District2 )
Example
This example check if the player is in 'Red Light District' when player types '/check'
function onPlayerCommand ( pPlayer, szCommand, szParams ) { switch ( szCommand ) { case "check": { if ( IsIn ( GetDistrictName ( pPlayer.Pos.x, pPlayer.Pos.y ), "Red Light District" ) ) { MessagePlayer ( "true", pPlayer ); return; } MessagePlayer ( "false", pPlayer ); return; } } }
Notes
The function MessagePlayer, GetDistrictName and call onPlayerCommand were used in this example. More info about them in corresponding pages.