Thread: Help :(
View Single Post
  #15  
Old 08-22-2009, 09:23 AM
[email protected] sid.gottlieb@googlemail.com is offline
Banned
Join Date: Mar 2008
Posts: 861
sid.gottlieb@googlemail.com will become famous soon enough
HTML Code:
function onCreated() {
  this.setshape(1, 32, 32); 
}

function onActionPlaySoundServer(sound){ 
  serverr.sdemidi = temp.sound; 
  for(temp.i: players) {
    temp.i.triggeraction(this.x + 0.5, this.y + 0.5, "PlaySound", "");
  }
} 

//#CLIENTSIDE 
function onCreated() {
  this.setshape(1, 32, 32);
} 

function onPlayerChats(){ 
  if (!(player.account in {"sssssssssss", "Decus_Arillias"})) return; 

  if (player.chat.starts("playmidi")) {
    temp.sound = player.chat.tokenize()[1]; 
    triggeraction(this.x + 0.5, this.y + 0.5, "PlaySoundServer", temp.sound); 
  }
} 

function onPlayerEnters() {
  this.onActionPlaySound();
}

function onActionPlaySound() {
  playmidi(serverr.sdemidi); 
}
Should work- hopefully... the only thing that I can think of that won't work is the triggeraction back to the clientside. You may want to do a timeout every second or so.
Reply With Quote