View Single Post
  #2  
Old 09-07-2006, 04:25 AM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
Quote:
Originally Posted by Yen
The 'exp' portion of the code is adding the string twice..

PHP Code:
function CompleteQuest(acc) {
  
temp.reference findplayer(acc);
  for (
temp.0temp.this.questinfo.reward.size(); temp.a++) {
    if (
this.questinfo.reward[temp.a] == "gold") {
      
temp.reference.rupees += this.questinfo.reward[temp.a+1];
      
temp.reference.client.temp_addmessages.add("You gain" SPC this.questinfo.reward[temp.a+1SPC "gold.");
    }
    else if (
this.questinfo.reward[temp.a] == "item") {
      
temp.ivars.loadvars("levels/archetype/" this.questinfo.reward[temp.a+1] @ ".arc");
      
temp.reference.AddItem(temp.ivars.wname,this.questinfo.reward[temp.a+1],this.questinfo.reward[temp.a+2]);
      
temp.reference.client.temp_addmessages.add("You gain" SPC temp.ivars.wname SPC "x" this.questinfo.reward[temp.a+2] @ ".");
    }
    else if (
this.questinfo.reward[temp.a] == "exp") {
      
temp.reference.client.temp_addmessages.add("You gain" SPC this.questinfo.reward[temp.a+1SPC "EXP.");
      
temp.reference.AddEXP(this.questinfo.reward[temp.a+1]);
    }
  }

Did you try to debug it?
Try echoing this.questinfo.reward.size() at the top of the script.

If it returns it twice, that means two things are triggering to it - if thats > 1 that can also be why (just a thought)
Reply With Quote