Jump to content

James2018 Landar

Resident
  • Posts

    10
  • Joined

  • Last visited

Reputation

0 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. okay, thank you finally I got the script adding the names of av's that was in the dialog menu.:matte-motes-big-grin:
  2. But that is the issue, I want the names that was sense to be added to list sensl(sensor list), because I want to use that sensor list in a dialog menu (as dialog buttons "av's names that was detected" [bob, Joe, Doe] ) to choose who has access to script object. llDialog(id, "DetectedAv's..\nChoose which av that you would like to have access to this object. " ",sensl,scriptc); When the owner choose "Bob" or who ever from the dialog menu I want the name "Bob" to be added to accessl(access list).
  3. Okay, it's still not working for some reason prompt "Remove" is the only msg that get added to access list. //GLOBALS//----------//INTEGERS//----------integer freq = 1;integer scriptc = 283638;//LIST//---------list sensl; //sensor listlist accessl; //access list//FUNCTION//-----------integer IsInList(list data, string msg){ integer i; for(i=0; i<llGetListLength(data);i++) { if(llList2String(data,i) == msg) { return TRUE; } } return FALSE;}default{ state_entry() { llSensorRepeat("","",AGENT,20,PI,freq); llListen(scriptc,"","",""); } touch_start(integer x) { llDialog(llDetectedKey(0),"Sensor To Dialog Access and Removal Script",["Add","Remove"],scriptc); } sensor(integer num_detected) { integer i; string name; for(i=0;i<num_detected;i++) if(IsInList(sensl,llKey2Name(llDetectedKey(i)))) { //DO NOT ADD THE SAME AV"S NAME } else { if(llStringLength(name) >24)//if name characters are greater that 24 { name = llGetSubString(name,0,23); } name = llKey2Name(llDetectedKey(i)); sensl += name; } } listen(integer channel, string name, key id, string msg) { if(msg == "Add") { llDialog( id, " \n Detected avatars ...", sensl, scriptc); } else if (!~llListFindList(sensl,[msg]) ) { accessl += [msg]; llOwnerSay( msg + " was added to the access list."); } }}
  4. thanks you guys for your input but now it's taking prompt 'access' button from menu 40(from original script, this is just part of the script) as the message now. EX. "access" was added to access list.
  5. Hi Everyone I'm having a problem with sensor to dialog(add av to access list) list senl;list accessl;integer menu; sensor(integer num_detected) { integer i; string name; for(i=0;i<num_detected;i++) if(IsInList(senl, llKey2Name(llDetectedKey(i)))) { //DO NOTHING } else { name = llKey2Name(llDetectedKey(i)); senl += name; } llListSort(senl,2,FALSE); integer listlen = llGetListLength(senl); for(i=0; i<listlen; i+=2) { name = llList2String(senl,i+1); } } listen(integer chan, string name, key id, string msg) { if(menu == whatever) { if(msg == "Add") { llDialog(id,"Av's that are around",sensl,scriptc); accessl += msg; llOwnersay((string)msg + " was added to the access list"); } } }}what I'm trying to do is choose an av's name from the sensor to dialog menu, which ever av I choose I want that name to be added to access list. not ('Add' was added to the list.) Any ideas?
×
×
  • Create New...