Legato Posted November 24, 2011 Group: Members Topic Count: 19 Topics Per Day: 0.00 Content Count: 87 Reputation: 1 Joined: 11/20/11 Last Seen: September 10, 2013 Share Posted November 24, 2011 Hiya, everyone. Is it possible to check the item ids before creating them via @item, @item2, @produce and @itemmap. Like you,'d restrict the item that in between the id that you will set. Example. (btw, this isn't working.) if (item_id >= 18000 && item_id <= 19000) { clif_displaymessage(fd, "These items are restricted."); return 1; } Can someone show me how's it done? Tia. Quote Link to comment Share on other sites More sharing options...
0 Kenpachi Posted November 24, 2011 Group: Members Topic Count: 22 Topics Per Day: 0.00 Content Count: 764 Reputation: 220 Joined: 11/14/11 Last Seen: November 19, 2020 Share Posted November 24, 2011 Hmm, this actually should work. I added this: if(item_id >= 2000) { clif_displaymessage(fd, "NOT ALLOWED!"); return -1; } below this: item_id = item_data->nameid; in the @item function and it worked. You probably added your check at the wrong spot. 1 Quote Link to comment Share on other sites More sharing options...
0 Legato Posted November 25, 2011 Group: Members Topic Count: 19 Topics Per Day: 0.00 Content Count: 87 Reputation: 1 Joined: 11/20/11 Last Seen: September 10, 2013 Author Share Posted November 25, 2011 (edited) Ohh. Right. >_> Thanks, Kenpachi. Can I use arrays on source modification? Or should I just use this to check different ids? if ( item_id >= 2000 && item_id <= 2200 || item_id == 2300 || item_id == 2400 and so on ... ) { clif_displaymessage(fd, "NOT ALLOWED"); return 1; } Edited November 25, 2011 by Legato Quote Link to comment Share on other sites More sharing options...
0 Kenpachi Posted November 25, 2011 Group: Members Topic Count: 22 Topics Per Day: 0.00 Content Count: 764 Reputation: 220 Joined: 11/14/11 Last Seen: November 19, 2020 Share Posted November 25, 2011 Can I use arrays on source modification? Or should I just use this to check different ids?Sure. Arrays are no problem.But i think in your case checking ID ranges is the more elegant solution. Quote Link to comment Share on other sites More sharing options...
Question
Legato
Hiya, everyone. Is it possible to check the item ids before creating them via @item, @item2, @produce and @itemmap.
Like you,'d restrict the item that in between the id that you will set.
Example. (btw, this isn't working.)
Can someone show me how's it done?
Tia.
Link to comment
Share on other sites
3 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.