bonjour
je galère pour modifier un script pour que seul les membres de mon groupe puisse faire ces opérations sur les boites ( changer la texture de la sim)
pouvez m'aider svp ?
voila le script en question
// start
key requestID;
integer channel;
string currentsim;
string query_string;
default
{
state_entry()
{
handle=0;
//use channel 87 for listening
channel=87;
}
touch_start(integer total_number)
{
if(handle!=0){
llListenRemove(handle);
handle=0;
}
llOwnerSay("Say name of Region you want on channel " + (string)channel);
handle=llListen(channel,"","","");
//set listen time out to 10 seconds
llSetTimerEvent(10.0);
}
listen(integer channel, string name, key id, string message)
{
currentsim=message;
/*urlencode region name and create the query string
&item=objects_uuid requests the object map layer
&item=terrain_uuid requests the terrain map layer
*/
query_string="region=" + llEscapeURL(message) + "&item=objects_uuid";
//send the request to api.gridsurvey.com
requestID = llHTTPRequest("http://api.gridsurvey.com/simquery.php",[HTTP_METHOD, "POST",HTTP_MIMETYPE,"application/x-www-form-urlencoded"], query_string);
//close the current listen
llSetTimerEvent(0.0);
if(handle!=0)llListenRemove(handle);
handle=0;
}
http_response(key req_id, integer status, list meta, string body)
{
if (req_id == requestID)
{
if(llGetSubString(body, 0, 4)=="Error") {
//the api returned an error so report it
llSay(0,body);
} else {
//set the prim texture
llSetTexture(body, ALL_SIDES);
llOwnerSay("Current Region Map UUID for "+ currentsim + " is "+ body);
}
}
else
{
llSay(0,"Error: " + (string)status);
}
}
timer()
{
//if fired due to timeout close the listen
if(handle!=0){
llOwnerSay("Region Map change timed out after 10 seconds. Please touch again to change the Region Map");
llListenRemove(handle);
handle=0;
}
llSetTimerEvent(0.0);
}
}
// end
Dernière modification par Richar ; 23/11/2020 à 19h23.
|