Added a check to make sure player is close to object when utilizing it

This commit is contained in:
PrisonCamp
2014-11-23 08:58:51 -08:00
parent e1eda39822
commit fd3d738323
@@ -30,6 +30,15 @@ trigger OnObjectMenuSelect(obj_id player, int item)
if ( hasEncryptionKey( player ) )
return SCRIPT_CONTINUE;//you've already got one
location here = getLocation (player);
location term = getLocation (self);
float range = getDistance(here, term);
if (range > 10.0)
{
sendSystemMessage (player, new string_id ( SYSTEM_MESSAGES, "elev_range" ) );
return SCRIPT_CONTINUE;
}
sui.msgbox(player, new string_id ( SYSTEM_MESSAGES, "download_complete" ));
obj_id playerInv = utils.getPlayerDatapad(player);