Advertisement
salahzar

cancella

Aug 28th, 2018
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // canale su cui ascolta (ownerkey()-1)
  2. integer cancella;
  3.  
  4. // funzione che torna un intero univoco per ogni avatar
  5. integer OwnerKey()
  6. {
  7.     return -(integer)("0x"+llGetOwner());
  8. }
  9.  
  10. default
  11. {
  12.  
  13.     // al reset calcola il canale e ascolta
  14.     state_entry(){
  15.         cancella=OwnerKey();  
  16.         //llSay(0,"Ascolto sul canale "+(string)cancella);    
  17.         llListen(cancella,"",NULL_KEY,"CANCELLA");
  18.     }
  19.  
  20.     // al rez calcola il canale e ascolta
  21.     on_rez(integer start_param){
  22.         cancella=OwnerKey();
  23.         //llSay(0,"Ascolto sul canale "+(string)cancella);
  24.         llListen(cancella,"",NULL_KEY,"CANCELLA");
  25.     }
  26.  
  27.     // ascolta e muore
  28.     listen(integer channel,string name,key id,string message){
  29.         if(channel==cancella)
  30.         {
  31.             //llSay(0,"ricevuto comando di sparire");
  32.             llDie();
  33.         }
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement