Thread: emoticons event
View Single Post
  #4  
Old 06-02-2009, 06:55 PM
Frankie Frankie is offline
xChugxLifex
Frankie's Avatar
Join Date: Feb 2008
Location: New York
Posts: 1,610
Frankie is a jewel in the roughFrankie is a jewel in the rough
Send a message via AIM to Frankie Send a message via MSN to Frankie
this is what I came up with so far but it doesn't want to work.

PHP Code:
function onCreated()
{
  
this.emoticons = {
  {
65"emoticon_AFK_stay.mng"},
  {
66"emoticon_BRB_stay.mng"},
  {
67"emoticon_conf.png"}
  };
  
  
//player.chat = this.emoticons[this.emoticons.index(65)][1];
  //this.chat = this.emoticons.index("emoticon_conf.png");
}

function 
onPlayerChats()
{
  
/*if (player.guild != "Events Team")
  {
    return;
  }*/
  
  
if (player.chat in {":start"":stop"})
  {
    
this.(player.chat == ":start""startEvent""stopEvent")();
  }
}
  
function 
startEvent()
{
  
this.chat "Event starting, get ready!";
  
serverr.emoticon "";
  
scheduleEvent(3"onPickEmoticon""first");
}

function 
stopEvent()
{
  
serverr.emoticon "";
  
serverr.emoticonevent false;
}

function 
onPickEmoticon()
{
  if (
params[0] == "first")
  {
    
serverr.emoticonevent true;
  }
  
  if (
serverr.emoticonevent == false)
  {
    return;
  }
  
  
serverr.emoticonevent true;
  
kickPlayers();
  
serverr.emoticon int(random(6567));
  
this.chat serverr.emoticon;
  
  
//showimg stuff here, didn't do it yet.
  
  
scheduleEvent(3"onPickEmoticon""");
}

function 
kickPlayers()
{
  if (
serverr.emoticon == "")
  {
    return;
  }
  
  for (
plplayers)
  {
    if (
pl.guild != "Events Team")
    {
      
level.playercount ++;
    }
    if (
level.playercount == 1)
    {
      
stopEvent();
    }
    
    if (
pl.client.emoticon != serverr.emoticon)
    {
      
player.chat "you lose!";
    }
  }
}
  
//#CLIENTSIDE
function GraalControl.onKeyDown()
{
  if (
serverr.emoticonevent == false)
  {
    
client.emoticon "";
    return;
  }
  
  if (
params[0in |577602|)
  {
    
client.emoticon emoticonchar;
  }

I also found out that array.index doesn't work when you have an array inside of an array -.-
__________________
*Sum41Freeeeek
*Frankie
Reply With Quote