Hello can I request a command @alootid but a player can autoloot 3 different item at once. ?
this is the basic alootid, what i must do?
/*==========================================
* @alootid
*------------------------------------------*/
ACMD_FUNC(autolootitem)
{
struct item_data *item_data = NULL;
if (!message || !*message) {
if (sd->state.autolootid) {
sd->state.autolootid = 0;
clif_displaymessage(fd, "Autolootitem has been turned OFF.");
} else
clif_displaymessage(fd, "Please, enter item name or it's ID (usage: @alootid <item_name_or_ID>).");
return -1;
}
if ((item_data = itemdb_exists(atoi(message))) == NULL)
item_data = itemdb_searchname(message);
if (!item_data) {
// No items founds in the DB with Id or Name
clif_displaymessage(fd, "Item not found.");
return -1;
}
sd->state.autolootid = item_data->nameid; // Autoloot Activated
sprintf(atcmd_output, "Autolooting item: '%s'/'%s' (%d)",
item_data->name, item_data->jname, item_data->nameid);
clif_displaymessage(fd, atcmd_output);
return 0;
}
Hello can I request a command @alootid but a player can autoloot 3 different item at once. ?
this is the basic alootid, what i must do?
/*========================================== * @alootid *------------------------------------------*/ ACMD_FUNC(autolootitem) { struct item_data *item_data = NULL; if (!message || !*message) { if (sd->state.autolootid) { sd->state.autolootid = 0; clif_displaymessage(fd, "Autolootitem has been turned OFF."); } else clif_displaymessage(fd, "Please, enter item name or it's ID (usage: @alootid <item_name_or_ID>)."); return -1; } if ((item_data = itemdb_exists(atoi(message))) == NULL) item_data = itemdb_searchname(message); if (!item_data) { // No items founds in the DB with Id or Name clif_displaymessage(fd, "Item not found."); return -1; } sd->state.autolootid = item_data->nameid; // Autoloot Activated sprintf(atcmd_output, "Autolooting item: '%s'/'%s' (%d)", item_data->name, item_data->jname, item_data->nameid); clif_displaymessage(fd, atcmd_output); return 0; }Link to comment
Share on other sites