Thread: Join Event
View Single Post
  #8  
Old 08-22-2009, 09:23 PM
[email protected] sid.gottlieb@googlemail.com is offline
Banned
Join Date: Mar 2008
Posts: 861
sid.gottlieb@googlemail.com will become famous soon enough
You're calling this
triggerserver("gui", name, "Host", temp.event, player.account);

Which is setting this
serverr.event = params[1];

Which is setting basically the players first chat token...

What you could do is make a list of events, ie
HTML Code:
function onCreated() {
  this.events_list = {
    {"OSL", "Startlevel.nw", 30, 30},
    {"Fishing", "fishlevel.nw", 25, 25},
    {"spar", "Sparlevel.nw", 35, 35}
  };
}
First is your description, ie OSL, Fishing or spar. Now do the players chat

HTML Code:
if(player.chat.starts(":hostevent ")){
  temp.tokens = player.chat.tokenize();
  temp.event = temp.tokens[1];
    
  for (temp.i: this.events_list) {
    if (temp.event = temp.i[0]) {
      temp.found = temp.i;
      break;
    }
  }
  if (temp.found == false) {
    //The event isn't found!
  }
  temp.event.delete(0); //delete the event description
  triggerserver("gui", name, "Host", temp.event, player.account);
}
All you now need to say is ':hostevent spar', ':hostevent Fishing' or ':hostevent OSL'. Hope this helps.
Reply With Quote