[DEV]DjSt3rios Posted March 5, 2011 Posted March 5, 2011 Hello, I would like to ask what code should i use to delete an item. I imported L2ItemInstance and PcInventory and then i tried this code: getInventory().destroyItemByItemId("heroweap", 6611, 1, st, null); and i also tried to add st. in front, like this st.getInventory().destroyItemByItemId("heroweap", 6611, 1, st, null); But still i get an error on getInventory. What can i do? Quote
0 Intrepid Posted March 5, 2011 Posted March 5, 2011 you need to get the inventory of a player....st.getPlayer()...(ofc st only if its a quest state) Quote
0 [DEV]DjSt3rios Posted March 5, 2011 Author Posted March 5, 2011 I did it like this: getPlayer().getInventory().destroyItemByItemId("heroweap", 6611, 1, st, null); but i gets an error with getPlayer :S What can i do? Quote
0 Intrepid Posted March 5, 2011 Posted March 5, 2011 I did it like this: getPlayer().getInventory().destroyItemByItemId("heroweap", 6611, 1, st, null); but i gets an error with getPlayer :S What can i do? 1st you either declare a player value or you use st.getPlayer() 2nd st is not a proper object reference st.getPlayer() is Quote
0 [DEV]DjSt3rios Posted March 5, 2011 Author Posted March 5, 2011 i used this now: st.getPlayer().getInventory().destroyItemByItemId("heroweap", 6611, 1, st, null); Still not working :S any other idea? it says error null :S Quote
0 Intrepid Posted March 5, 2011 Posted March 5, 2011 i used this now: st.getPlayer().getInventory().destroyItemByItemId("heroweap", 6611, 1, st, null); Still not working :S any other idea? it says error null :S i told st is not an object reference st.getPlayer() is... Quote
0 [DEV]DjSt3rios Posted March 5, 2011 Author Posted March 5, 2011 I dont understand you lol, please tell me what to use to delete that item. im confused lol Quote
0 Intrepid Posted March 5, 2011 Posted March 5, 2011 I dont understand you lol, please tell me what to use to delete that item. im confused lol for example player.destroyItemByItemId("Quest", DARION_BADGE, 20, npc, true) or st.getPlayer().destroyItemByItemId("Quest", DARION_BADGE, 20, npc, true) read always the method reference to see which value need what... Quote
0 [DEV]DjSt3rios Posted March 5, 2011 Author Posted March 5, 2011 i have 2, brasil and l2j, none of them working. but i am planning to use it on brasil Quote
0 Intrepid Posted March 5, 2011 Posted March 5, 2011 i have 2, brasil and l2j, none of them working. but i am planning to use it on brasil so shitlude than thats why i dont know the il methods xD Quote
0 Intrepid Posted March 5, 2011 Posted March 5, 2011 How can i fix it now? :/ well look into your core or into other scripts for examples Quote
0 [DEV]DjSt3rios Posted March 5, 2011 Author Posted March 5, 2011 Nevermind, Please someone lock this topic. Quote
Question
[DEV]DjSt3rios
Hello, I would like to ask what code should i use to delete an item. I imported L2ItemInstance and PcInventory and then i tried this code:
getInventory().destroyItemByItemId("heroweap", 6611, 1, st, null);
and i also tried to add st. in front, like this
st.getInventory().destroyItemByItemId("heroweap", 6611, 1, st, null);
But still i get an error on getInventory. What can i do?
14 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.