Vox Kalam Posted August 26, 2007 Share Posted August 26, 2007 Won't compile. void main() { int nQuantity = GetScriptParameter( 1 ); int i; string sItem = GetScriptStringParameter(); if(nQuantity == 0) nQuantity = 1; object "hkarmor" = GetItemPossessedBy (GetPartyLeader(),"hkarmor"); if (GetIsObjectValid("hkarmor")) { int nStackSize = GetItemStackSize("hkarmor"); if(nQuantity < nStackSize) { nQuantity = nStackSize - nQuantity; SetItemStackSize("hkarmor", nQuantity); } else if(nQuantity > nStackSize || nQuantity == nStackSize) { DestroyObject("hkarmor"); } } } Something about string constant in line 9 Link to comment Share on other sites More sharing options...
stoffe Posted August 26, 2007 Share Posted August 26, 2007 Won't compile. Something about string constant in line 9 That's because you are using a string constant where you should be using an object variable name throughout the script: void main() { int nQuantity = GetScriptParameter( 1 ); int i; string sItem = GetScriptStringParameter(); if(nQuantity == 0) nQuantity = 1; object hkarmor = GetItemPossessedBy(GetFirstPC(), "hkarmor"); if (GetIsObjectValid(hkarmor)) { int nStackSize = GetItemStackSize(hkarmor); if(nQuantity < nStackSize) { nQuantity = nStackSize - nQuantity; SetItemStackSize(hkarmor, nQuantity); } else if(nQuantity > nStackSize || nQuantity == nStackSize) { DestroyObject(hkarmor); } } } Link to comment Share on other sites More sharing options...
Vox Kalam Posted August 26, 2007 Author Share Posted August 26, 2007 thanks. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.