Author Topic: [Solved]Remove all of this tag even if stack give gold per item.  (Read 460 times)

Legacy_Knight_Shield

  • Hero Member
  • *****
  • Posts: 812
  • Karma: +0/-0


               The line in red wont let it compile?




#include "nw_i0_plot"void main()
{   
       string sTag = "NW_IT_MMIDMISC06"; // Tag of items to take.   
       object oPC = GetPCSpeaker(); 
        int nToTake = GetNumItems(oPC,sTag); // Number of items to take.   
         if ( nToTake)   
{     
       TakeNumItems(oPC,sTag,nToTake);     
        int nReward =nToTake * 20;   
        GiveGoldToCreature(oPC,nReward);   
        GiveXPToCreature(oPC,nReward); 
  }   
        else SpeakString("You do not have any proof.");
}
        // Loop through oPC's inventory until enough items are taken   
         // (i.e. while something still needs to be taken). 
         // Checking for OBJECT_INVALID should not be needed, but it's a good safety measure.   
      while ( oItem != OBJECT_INVALID )   
       {
       // Only deal with items with the desired tag.       
       if ( GetTag(oItem) == sTag )       
      {
        // Determine what to do based on stack size.         
      nAmount = nAmount + GetItemStackSize(oItem);       
       DestroyObject(oItem, 0.1);        }     
        // Update the loop.     
       oItem = GetNextItemInInventory(oPC); 
  }
    GiveGoldToCreature(oPC, 20*nAmount);   
    GiveXPToCreature(oPC, 20*nAmount);
    if (iReward == TRUE) 
  {        while(nAmount > 0)       
{       
    CreateItemOnObject(sResRef, oPC);         
  nAmount--;        }   
}

               
               

               


                     Modifié par Knight_Shield, 18 janvier 2012 - 11:55 .
                     
                  


            

Legacy_Knight_Shield

  • Hero Member
  • *****
  • Posts: 812
  • Karma: +0/-0
[Solved]Remove all of this tag even if stack give gold per item.
« Reply #1 on: January 18, 2012, 11:50:46 pm »


               oops found this lol  http://social.biowar...2/index/6707239


#include "nw_i0_plot"
void main()
{    string sTag = "NW_IT_MMIDMISC06"; // Tag of items to take.   
object oPC = GetPCSpeaker();   
int nToTake = GetNumItems(oPC,sTag); // Number of items to take.   
if ( nToTake)   
{      TakeNumItems(oPC,sTag,nToTake);     
int nReward =nToTake * 20;     
GiveGoldToCreature(oPC,nReward);     
GiveXPToCreature(oPC,nReward);    }   
else SpeakString("You do not have any proof.");}
               
               

               


                     Modifié par Knight_Shield, 18 janvier 2012 - 11:54 .