Jump to content

RLV Zone - Restrict Teleportation by sensor


Gayngel
 Share

You are about to reply to a thread that has been inactive for 3558 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I'm trying to create an RLV zone that when in range of the sensor restricts teleportation to landmarks but can't manage to make it work.:matte-motes-confused: 

 

integer chanRLV = -1812221819;
default
{
    state_entry()
    {
 llSensor("", NULL_KEY, AGENT, 20.0, PI); 
    }
    sensor( integer detected )
    {
     while(detected--)
        
       { llSay(chanRLV,"NoTP," + llDetectedName(detected) + ",@tplm=n");
    }
    }
}

 

Link to comment
Share on other sites

Make a thing as simple as possible,  and no simpler.  

 

You are trying to skip that second part.

 

You need to track who is in your zone, and who is restricted,  so you can properly UNRESTRICT them when they leave when possible. 

 

Here is a simple take on an rlv restriction zone.

integer chanRLV = -1812221819;integer RANGE = 20;float RATE = 5.0;list gl_inhabitants;list gl_detected_agents;add_inhabitant(key id){	integer i = llListFindList(gl_inhabitants,[id]);	if(i==-1){		llRegionSayTo(id,chanRLV,"NoTP," + (string)id + ",@tplm=add");		llRegionSayTo(id,0,"You have entered an RLV restriction zone");		gl_inhabitants+=id;	}}remove_inhabitant(key id){	integer i = llListFindList(gl_inhabitants,[id]);	if(i!=-1){		llRegionSayTo(id,chanRLV,"NoTP," + (string)id + ",@clear");//,@tplm=rem		llRegionSayTo(id,0,"You have exited an RLV restriction zone");		gl_inhabitants = llDeleteSubList(gl_inhabitants,i,i);	}}process_agents(){	integer i;	for(i=llGetListLength(gl_inhabitants);i>=0;--i){		key id = llList2Key(gl_inhabitants,i);		if(llListFindList(gl_detected_agents,[id])==-1)			remove_inhabitant(id);	}	for(i=llGetListLength(gl_detected_agents);i>=0;--i){		key id = llList2Key(gl_detected_agents,i);		if(llListFindList(gl_inhabitants,[id])==-1)			add_inhabitant(id);	}}default{    state_entry(){		llSensorRepeat("", NULL_KEY, AGENT, RANGE, PI,RATE);     }    sensor( integer detected ){		gl_detected_agents = [];		while(--detected>=0){			gl_detected_agents+=llDetectedKey(detected);		}		process_agents();    }	no_sensor(){		gl_detected_agents = [];		process_agents();	}}

 

  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3558 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...