CODE
list admins = [""];
integer active;
integer admin;
integer brodcast = -5657;
integer dischan = -7493;
detectsim()
{
string region = llGetRegionName();
if(region == "Lestern")
{
llOwnerSay("Radio Active");
active = TRUE;
}
else
{
llOwnerSay("Radio Deativated - Only useable in Lestern Sim");
active = FALSE;
}
}
default
{
state_entry()
{
llSetText("",<1,1,1>,1);
llListen(1,"",llGetOwner(),"");
llListen(2,"",llGetOwner(),"");
llListen(0,"",llGetOwner(),"");
detectsim();
}
listen( integer channel, string name, key id, string message )
{
if(active == TRUE)
{
if(channel == 1)
{
if(admin == TRUE)
{
llRegionSay(brodcast,"[GM] "+(string)llGetOwner()+" (PD): "+message);
}
if(admin == FALSE)
{
llRegionSay(brodcast,(string)llGetOwner()+" (PD): "+message);
}
}
else if(channel == 2)
{
if(admin == TRUE)
{
llRegionSay(brodcast,"[GM] "+(string)llGetOwner()+" (PD)->(Dispatch): "+message);
}
if(admin == FALSE)
{
llRegionSay(brodcast,(string)llGetOwner()+" (PD)->(Dispatch): "+message);
}
}
else if(channel == 0)
{
if(message == "aon")
{
if(~llListFindList(admins, (list)llGetOwner()));
{
admin = TRUE;
llWhisper(0,"[GM] Tag Enabled");
}
else // error
{
llOwnerSay("Admin only Command");
}
}
if(message == "aoff")
{
admin = FALSE;
llWhisper(0,"[GM] Tag Disabled");
}
else // error
{
llOwnerSay("Admin only Command");
}
}
}
else
{
llOwnerSay("Radio is inactive you may only listen");
}
}
}