mirror of
https://github.com/liftedpixel/lslscripts.git
synced 2026-08-14 09:02:50 +00:00
RANDOM-TP: Check PERMISSION_TELEPORT
Only requests PERMISSION_TELEPORT if it is not yet given - prevents excess dialogs and slower travel.
This commit is contained in:
@@ -41,6 +41,13 @@ roll ( )
|
|||||||
HttpRequestID = llHTTPRequest ( url, [], "" );
|
HttpRequestID = llHTTPRequest ( url, [], "" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
teleport ( )
|
||||||
|
{
|
||||||
|
Hovertext = "Teleporting to " + RegionName;
|
||||||
|
llSetText ( Hovertext, BLUE, 1.0 );
|
||||||
|
llTeleportAgentGlobalCoords ( Toucher, RegionCoordinates, LocalCoordinates, LookAt );
|
||||||
|
}
|
||||||
|
|
||||||
default
|
default
|
||||||
{
|
{
|
||||||
state_entry ( )
|
state_entry ( )
|
||||||
@@ -113,9 +120,7 @@ default
|
|||||||
{
|
{
|
||||||
if ( PERMISSION_TELEPORT & perm )
|
if ( PERMISSION_TELEPORT & perm )
|
||||||
{
|
{
|
||||||
Hovertext = "Teleporting to " + RegionName;
|
teleport();
|
||||||
llSetText ( Hovertext, BLUE, 1.0 );
|
|
||||||
llTeleportAgentGlobalCoords ( Toucher, RegionCoordinates, LocalCoordinates, LookAt );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -155,7 +160,16 @@ default
|
|||||||
LookAt = ZERO_VECTOR;
|
LookAt = ZERO_VECTOR;
|
||||||
Hovertext = "Requesting permission to teleport to " + RegionName + "...";
|
Hovertext = "Requesting permission to teleport to " + RegionName + "...";
|
||||||
llSetText ( Hovertext, RED, 1.0 );
|
llSetText ( Hovertext, RED, 1.0 );
|
||||||
llRequestPermissions ( Toucher, PERMISSION_TELEPORT );
|
|
||||||
|
integer perms = llGetPermissions();
|
||||||
|
if(perms & PERMISSION_TELEPORT)
|
||||||
|
{
|
||||||
|
teleport();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
llRequestPermissions ( Toucher, PERMISSION_TELEPORT );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user