Oui c'est exactement ça Dave. Bon j'ai mieux à proposer: j'ai un volet roulant (full perm y compris script) dans mon inventaire qui fonctionne en diminuant la dimension du prim. Ce sera plus approprié pour ce cas là. Je t'envoie ça ce soir Demoss; si tu me contacte ou que je tu me donne ton nom d'avatar.
Edit: voilà le script que j'ai; il ya sans doute des choses inutiles mais si ça te va dans le principe on le nettoyera
integer steps = 20;
string secondOwner = "";
integer object_id;
integer configchannel;
list blacklist;
string lastQuestion = "";
string lastPerson = "";
integer openListener = 0;
vector storedPos;
vector storedSize;
integer Closed = TRUE;
OpenBlinds()
{
if (!Closed)
{
return;
}
llOwnerSay("Open blinds");
storedPos = llGetPos();
storedSize = llGetScale();
float stepsize = (storedSize.z - 0.1) / steps;
vector currentSize = storedSize;
vector currentPos = storedPos;
while(currentSize.z > 0.1)
{
currentSize.z -= stepsize;
if (currentSize.z < 0.1)
{
currentSize.z = 0.1;
}
currentPos.z = storedPos.z + ((storedSize.z - currentSize.z)/2);
llSetScale(currentSize);
llSetPos(currentPos);
}
Closed = FALSE;
}
CloseBlinds()
{
if (Closed)
{
return;
}
llOwnerSay("Close blinds");
float stepsize = (storedSize.z - 0.1) / steps;
vector currentSize = llGetScale();
vector currentPos = llGetPos();
while (currentSize.z < storedSize.z)
{
currentSize.z += stepsize;
if (currentSize.z > storedPos.z)
{
currentSize.z = storedPos.z;
}
currentPos.z = storedPos.z + ((storedSize.z - currentSize.z)/2);
llSetScale(currentSize);
llSetPos(currentPos);
}
llSetScale(storedSize);
llSetPos(storedPos);
Closed = TRUE;
}
default
{
state_entry()
{
configchannel = llRound(llFrand(2000000000));
object_id = (integer) llGetObjectDesc();
llListen(object_id, "", NULL_KEY, "");
llListen(configchannel, "", NULL_KEY, "");
}
touch_start(integer num)
{
if (llDetectedKey(0) == llGetOwner())
{
llDialog(llGetOwner(),"Owner Menu",["SecondOwner","BlackList","-","Open","Close","-"],configchannel);
return;
}
if (llDetectedName(0) == secondOwner)
{
llDialog(llDetectedKey(0),"Second Owner Menu",["-","BlackList","-","Open","Close","-"],configchannel);
return;
}
integer pos = llListFindList(blacklist,[llDetectedName(0)]);
if (pos == -1)
{
pos = llListFindList(blacklist, ["*"]);
if (pos == -1)
{
llDialog(llDetectedKey(0),"User Menu",["-","-","-","Open","Close","-"], configchannel);
}
}
return;
}
listen(integer channel, string name, key id, string message)
{
// Open chat channel messages //
if (channel == 0)
{
if (id == llGetOwner())
{
if (lastQuestion == "secondOwner")
{
lastQuestion = "";
secondOwner = message;
llInstantMessage(llGetOwner(), "Second owner set to: "+secondOwner);
llListenRemove(openListener);
openListener = 0;
llDialog(llGetOwner(),"Send second owner to all blinds?", [" Yes", "No"],configchannel);
return;
}
}
if (id == llGetOwner() || id == secondOwner)
{
if (lastQuestion == "BlacklistAdd")
{
lastQuestion = "";
integer pos2 = llListFindList(blacklist, [message]);
if (pos2 == -1)
{
blacklist += message;
llInstantMessage(id, "Added: "+message+" to the blacklist");
llListenRemove(openListener);
openListener = 0;
lastPerson = message;
llDialog(id, "Send add to blacklist to all blinds?", ["Yes add", "No"], configchannel);
}
}
if (lastQuestion == "BlacklistRemove")
{
lastQuestion = "";
integer pos2 = llListFindList(blacklist, [message]);
if (pos2 > -1)
{
blacklist = llDeleteSubList(blacklist, pos2, pos2);
llInstantMessage(id, "Removed: "+message+" from the blacklist");
llListenRemove(openListener);
openListener = 0;
lastPerson = message;
llDialog(id, "Send remove from blacklist to all blinds?", ["Yes remove", "No"], configchannel);
}
}
}
return;
}
// Messages from other blinds //
if (channel == object_id && llGetOwner() == llGetOwnerKey(id))
{
list templist = llParseString2List(message, [";"], []);
if ("secondOwner" == llList2String(templist,0))
{
secondOwner = llList2String(templist,1);
}
if ("addBlack" == llList2String(templist,0))
{
integer pos2 = llListFindList(blacklist, [llList2String(templist,1)]);
if (pos2 == -1)
{
blacklist += llList2String(templist,1);
}
}
if ("removeBlack" == llList2String(templist,0))
{
integer pos2 = llListFindList(blacklist, [llList2String(templist,1)]);
if (pos2 > -1)
{
llOwnerSay("removing from blacklist: "+(string) pos2);
blacklist = llDeleteSubList(blacklist,pos2,pos2);
}
}
if ("OpenBlinds" == llList2String(templist,0))
{
OpenBlinds();
}
if ("CloseBlinds" == llList2String(templist,0))
{
CloseBlinds();
}
return;
}
// Normal config messages owner only //
if (id == llGetOwner() && channel == configchannel)
{
if (message == "SecondOwner")
{
llSetTimerEvent(60);
openListener = llListen(0,"",llGetOwner(),"");
llInstantMessage(id, "Enter the name of the second owner in the chat");
lastQuestion = "secondOwner";
}
if (message == " Yes")
{
llRegionSay(object_id, "secondOwner;"+secondOwner);
}
}
// Normal config messages owner and second owner only //
if ((id == llGetOwner() || id == secondOwner) && channel == configchannel)
{
if (message == "BlackList")
{
llDialog(id, "BlackList menu.", ["Add BlackList", "Remove BlackList"], configchannel);
}
if (message == "Add BlackList")
{
llSetTimerEvent(60);
openListener = llListen(0,"",NULL_KEY,"");
llInstantMessage(id, "Enter the name of the person to be added to the blacklist in the chat");
lastQuestion = "BlacklistAdd";
}
if (message == "Remove BlackList")
{
llSetTimerEvent(60);
openListener = llListen(0,"",NULL_KEY,"");
llInstantMessage(id, "Enter the name of the person to be removed from the blacklist in the chat");
lastQuestion = "BlacklistRemove";
}
if (message == "Yes add")
{
llRegionSay(object_id, "addBlack;"+lastPerson);
}
if (message == "Yes remove")
{
llRegionSay(object_id, "removeBlack;"+lastPerson);
}
}
// All functions from here on might be black listed
if (id != llGetOwner() && id != secondOwner)
{
integer pos3 = llListFindList(blacklist,[name]);
if (pos3 > -1)
{
return;
}
pos3 = llListFindList(blacklist, ["*"]);
if (pos3 > -1)
{
return;
}
}
if (message == "Open")
{
OpenBlinds();
llDialog(id, "Open all blinds?", ["Yes open", "No"], configchannel);
}
if (message == "Close")
{
CloseBlinds();
llDialog(id, "Close all blinds?", ["Yes close","No"], configchannel);
}
if (message == "Yes close")
{
llRegionSay(object_id, "CloseBlinds");
}
if (message == "Yes open")
{
llRegionSay(object_id, "OpenBlinds");
}
}
timer ()
{
llListenRemove(openListener);
openListener = 0;
}
}