mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-31 00:15:54 -04:00
Added a check to make sure player is close to object when utilizing it
This commit is contained in:
@@ -18,6 +18,16 @@ trigger OnInitialize()
|
||||
|
||||
trigger OnObjectMenuRequest(obj_id player, menu_info mi)
|
||||
{
|
||||
|
||||
location here = getLocation (player);
|
||||
location term = getLocation (self);
|
||||
float range = getDistance(here, term);
|
||||
if (range > 5.0)
|
||||
{
|
||||
sendSystemMessage (player, new string_id ( SYSTEM_MESSAGES, "elev_range" ) );
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
|
||||
string stringName = ACTIVE;
|
||||
obj_id bldg = getTopMostContainer(self);
|
||||
if ( utils.hasScriptVar( bldg, "warren.deactivated") )
|
||||
@@ -43,8 +53,18 @@ trigger OnHearSpeech(obj_id speaker, string text)
|
||||
if ( turretCodeSequence == null )
|
||||
return SCRIPT_CONTINUE;//there is no code
|
||||
|
||||
|
||||
if ( toUpper(text).equals(turretCodeSequence) )
|
||||
{
|
||||
|
||||
location here = getLocation (speaker);
|
||||
location term = getLocation (self);
|
||||
float range = getDistance(here, term);
|
||||
if (range > 10.0)
|
||||
{
|
||||
sendSystemMessage (speaker, new string_id ( SYSTEM_MESSAGES, "elev_range" ) );
|
||||
return SCRIPT_CONTINUE;
|
||||
}
|
||||
setName( self, "" );
|
||||
setName( self, new string_id( SYSTEM_MESSAGES, "turret_term_off" ) );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user