Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Making a self deleting object?

Aleksandr Martov
The Artist
Join date: 12 Jun 2004
Posts: 86
11-30-2004 14:24
I'm trying to make a vehicle that detects the current sim, and if it does not detect the proper sim, it will delete itself. Here's what I have so far, which doesn't work:

timer()
{
string currentSim;
string allowedSim;
currentSim = llGetRegionName();
allowedSim1 = Nowall;
allowedSim2 = Backstage;
if(currentSim != (allowedSim1 || allowedSim2))
{
llDie();
}
}

how do I make this work?
_____________________
I got monkies in me!
-Gir
Tiger Crossing
The Prim Maker
Join date: 18 Aug 2003
Posts: 1,560
11-30-2004 14:33
CODE
timer()
{
list allowed_sims = [ "Nowall", "Backstage" ]; // could make this global
string current_sim = llGetRegionName();

integer len = llGetListLength( allowed_sims );
integer a;
for ( a=0; a<len; ++a )
{
if ( current_sim == llList2String( allowed_sims, a ) )
a = 10000; // we are in an allowed_sim
}

if ( a < 10000 ) // we are not in an allowed sim
llDie();
}

Untested, typed into the forums from scratch. May have typos or bugs... But it looks good to me. IM me if it doesn't work for you.
_____________________
~ Tiger Crossing
~ (Nonsanity)
Aleksandr Martov
The Artist
Join date: 12 Jun 2004
Posts: 86
11-30-2004 14:56
well, it complies alright, but the vehicle own't move when I get in ther cockpit. I never get the release keys button. Any ideas?

AM
_____________________
I got monkies in me!
-Gir
ramon Kothari
FIC
Join date: 9 Dec 2002
Posts: 249
11-30-2004 15:17
here is something else you can try ....

on_rez(integer g)
{


string simname = "simname here" ;
string actualsim = llGetRegionName();
if (actualsim != simname)
{
llSay(0,"sorry not in proper sim ";);
llSleep(1);
llMessageLinked(LINK_SET, 0, "de rez", "";);
llBreakAllLinks();
}

and you can also put it into a timer

timer()
{




string simname = "simname here" ;
string actualsim = llGetRegionName();
if (actualsim != simname)
{
llSay(0,"sorry not in proper sim ";);
llSleep(1);
llMessageLinked(LINK_SET, 0, "de rez", "";);
llBreakAllLinks();
}

}