Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Pls Help

RaveWolf Strauss
Registered User
Join date: 1 Jan 2006
Posts: 53
07-25-2006 10:56
I Need Help Getting This Code To Group Useable Only Peeps Outside Of Group Are Changing It Pls Help Somebody :/
CODE
list    _radioURLs;
list _radioStations;
integer _linenum = 0;
integer group;
string _notecard = "stations";

//-----------------------

reset_radio() {
_radioURLs = [ "" ];
_radioStations = [ "off" ];
_linenum = 0;
llGetNotecardLine(_notecard, _linenum);
}

add_station(string line) {
list words = llParseString2List(line, [" ", " ", "="], []);
if (llGetListLength(words) < 2) {
return;
}
string url = llList2String(words, llGetListLength(words) - 1);
string station = "";
integer i;
for (i=0; i<llGetListLength(words) - 1; i++) {
if (llStringLength(station) > 0) {
station += " ";
}
station += llList2String(words, i);
}
_radioURLs += ;
_radioStations += [station];
}

//-----------------------

default {
state_entry() {
reset_radio();
}

changed(integer change) {
if (change & CHANGED_INVENTORY) {
reset_radio();
}
}

dataserver(key query_id, string data) {
if (llGetListLength(_radioURLs) > 11) {
llSay(0, "only the first 10 stations are avaliable");
}
else {
if (data != EOF) {
add_station(data);
_linenum++;
llGetNotecardLine(_notecard, _linenum);
return;
}
}
llListen(93, "", NULL_KEY, "");
llSay(0, "touch to change stations");
}

touch_start(integer touchNumber) {
llDialog(llDetectedKey(0), "pick a station", _radioStations, 93);
}

listen(integer channel, string name, key id, string message) {
string newURL = llList2String(_radioURLs, llListFindList(_radioStations, [message]));
llSay(0, message + " ---> " + newURL);
llSetParcelMusicURL(newURL);
}
}
Maarek North
Registered User
Join date: 3 May 2006
Posts: 14
07-25-2006 11:29
Make the objects group the one you want to allow and replace the touch_start with the following...
CODE

touch_start(integer touchNumber) {
if (llDetectedGroup(0) == TRUE)
llDialog(llDetectedKey(0), "pick a station", _radioStations, 93);
}


Please note that the group must be active. So your users will have to switch to the same group as the object.
Jesse Malthus
OMG HAX!
Join date: 21 Apr 2006
Posts: 649
07-25-2006 19:45
Shouldn't that be llSameGroup(llDetectedGroup(0)) == TRUE?
_____________________
Ruby loves me like Japanese Jesus.
Did Jesus ever go back and clean up those footprints he left? Beach Authority had to spend precious manpower.
Japanese Jesus, where are you?
Pragmatic!
Bitzer Balderdash
Dazed and Confused
Join date: 21 Dec 2005
Posts: 246
07-26-2006 05:40
From: Jesse Malthus
Shouldn't that be llSameGroup(llDetectedGroup(0)) == TRUE?


no, you're thinking of llSameGroup(llDetectedKey(0)) == TRUE

llDetectedGroup() shortcuts it. into one call
Jesse Malthus
OMG HAX!
Join date: 21 Apr 2006
Posts: 649
07-26-2006 05:42
From: Bitzer Balderdash
no, you're thinking of llSameGroup(llDetectedKey(0)) == TRUE

llDetectedGroup() shortcuts it. into one call

You're right. My coherency was suffering last night
_____________________
Ruby loves me like Japanese Jesus.
Did Jesus ever go back and clean up those footprints he left? Beach Authority had to spend precious manpower.
Japanese Jesus, where are you?
Pragmatic!