Why not set after the command
pickupcommandddddd here
}
}
Else if item(id==####)
pickup=false;
sM("You are not allowd to pickup this item");
This is just and example i know it might be wrong (:
Code:
if (command.startsWith("pickup")) {
String ItemName = command.substring(7);
ItemName = ItemName.replaceAll("_", " ");
for(int i = 0; i < 8000; i++) {
if(getItemName(i).toLowerCase().equalsIgnoreCase(ItemName.toLowerCase())) {
addItem(i, 1);
sM("Item Added");
return;
}
}
sM("No item called "+ItemName+" is found.");
}
}
Else item(id==###)
pickup=false;
sM("you are not allowed to pickup this item");
}