Where is the code? in the click object packet?
use something such as :-
I don't know the exact name for the 'playerHasItem' method, but you'll have one that returns whether you have X item or not.Code:if (playerHasItem(#)) { stuffHere }
|
Here's the code I'm using to make it so that when I click on the statue objects that if I'm holding the key (which is dropped by a monster) that it's deleted and an item is added to my inventory - in this case 1 of 4 pieces of 3rd Age Ranged Armour.
Here's the code, it doesn't recognize the symbol: "if (ItemID == 2418)"
[PHP] case 7292: //Statue for 3rd Age Ranged Set
if (ItemID == 2418) {
deleteItem(2418, getItemSlot(2418), 1);
sendMessage("The key vanishes from your inventory.");
addItem(14503, 1);
} else {
sendMessage("Nothing interesting happens.");
}
break;
case 7295: //Statue for 3rd Age Ranged Set
if (ItemID == 2418) {
deleteItem(2418, getItemSlot(2418), 1);
sendMessage("The key vanishes from your inventory.");
addItem(14504, 1);
} else {
sendMessage("Nothing interesting happens.");
}
break;
case 7298: //Statue for 3rd Age Ranged Set
if (ItemID == 2418) {
deleteItem(2418, getItemSlot(2418), 1);
sendMessage("The key vanishes from your inventory.");
addItem(14505, 1);
} else {
sendMessage("Nothing interesting happens.");
}
break;
case 7301: //Statue for 3rd Age Ranged Set
if (ItemID == 2418) {
deleteItem(2418, getItemSlot(2418), 1);
sendMessage("The key vanishes from your inventory.");
addItem(14506, 1);
} else {
sendMessage("Nothing interesting happens.");
}
break/PHP]
Do you guys have any snippets for these cases?
Where is the code? in the click object packet?
use something such as :-
I don't know the exact name for the 'playerHasItem' method, but you'll have one that returns whether you have X item or not.Code:if (playerHasItem(#)) { stuffHere }
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |