View Single Post
  #16  
Old 05-22-2007, 10:06 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
Don't waste your time.
HTML Code:
function onPlayerChats()
{
  if (player.chat.starts("buy"))
  {

    temp.itemStuff = {
      //buying Name, weapon Name, item Price
      {"Juggaling", "Prizes/Juggle", 30}
    };

    for (temp.currentItem: temp.itemStuff)
    {
      if (temp.currentItem[0] == player.chat.substring(4))
      {
        if (player.clientr.etcoins >= temp.currentItem[2])
        {
          this.buyItem(temp.currentItem); 
        }
      }
    }

  }
}
function buyItem(itemData)
{
  if (player.findWeapon(temp.itemData[1]))
  {
    return false;
  }

  player.addWeapon(temp.itemData[1]);
  player.clientr.etcoins -= temp.itemData[2];
  player.chat = format(_("You've %s %s for %d event coins!"), randomString("purchased", "bought", "stolen"), temp.itemData[0], temp.itemData[2]);
}
__________________
Reply With Quote