OsRegionRestart

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
m (Fixed a typo that prevented the display of the Notes section.)
 
(11 intermediate revisions by 4 users not shown)
Line 1: Line 1:
'''Function Syntax:''' osRegionRestart(double seconds);<br>'''Returns:''' integer
+
{{osslfunc
 
+
|threat_level=High
'''Example:'''
+
|permissions=ESTATE_MANAGER,ESTATE_OWNER
 
+
|delay=0
<source lang="lsl">key owner;
+
|function_syntax=integer osRegionRestart(float seconds)
 +
integer osRegionRestart(float seconds, string message)
 +
|ossl_example=<source lang="lsl">key owner;
 
integer time = 120; // Delay of restart in seconds
 
integer time = 120; // Delay of restart in seconds
 
default
 
default
Line 29: Line 31:
 
     }
 
     }
 
}</source>
 
}</source>
This would start a region restart after 60 seconds.
+
The above example will start a region restart after a 120 second (two minutes) delay.
 
+
|description=Restarts a region after a specified timeout.  Only estate managers and administrators can successfully execute this function.
 
+
The string in the second version of this function will be used in the warning messages sent to all users in-the region about the region restart instead of the default warning message.
[[Category:OSSL]]
+
|additional_info=The version of osRestartRegion that takes a second argument was added in the 0.9 version of OpenSim.
[[Category:OSSL functions without threat level]]
+
}}

Latest revision as of 19:51, 31 August 2018

integer osRegionRestart(float seconds)

integer osRegionRestart(float seconds, string message)

Restarts a region after a specified timeout. Only estate managers and administrators can successfully execute this function.

The string in the second version of this function will be used in the warning messages sent to all users in-the region about the region restart instead of the default warning message.

Threat Level High
Permissions ESTATE_MANAGER,ESTATE_OWNER
Extra Delay 0 seconds
Example(s)
key owner;
integer time = 120; // Delay of restart in seconds
default
{
    state_entry()
    {
        llSetText("Region Restart\nosRegionRestart", <1.0,1.0,1.0>,1.0);
 
    }
    touch (integer total_number)
    {
        owner = llDetectedOwner(0);
        key toucher = llDetectedKey(0);
        if (toucher == owner)
        {
            osRegionRestart(time);
            string name = llKey2Name(toucher);
            llSay (0,"Region Restart requested by " + name + " the sim will restart in " + ((string)time) + " seconds");
 
        }
        else
        {
             llSay(0,"You are not the owner");
        }
    }
}

The above example will start a region restart after a 120 second (two minutes) delay.

Notes
The version of osRestartRegion that takes a second argument was added in the 0.9 version of OpenSim.
Personal tools
General
About This Wiki