nasagnilac Posted October 17, 2019 Group: Members Topic Count: 89 Topics Per Day: 0.02 Content Count: 232 Reputation: 15 Joined: 11/02/13 Last Seen: December 19, 2024 Share Posted October 17, 2019 I am creating a autostorage timer but it dont store the item. Can you please help me check the script. Thanks you. TIMER_FUNC(unit_autostorage){ struct block_list *bl; struct unit_data *ud; bl = map_id2bl(id); if (!bl) return 0; ud = unit_bl2ud(bl); if (!ud) return 0; struct map_session_data *sd = (struct map_session_data*)bl; int i, a; // Store item when weight become 90% if(pc_is90overweight(sd) && sd->state.afk_storeItem == 1){ if (sd->state.storage_flag != 1) { //Open storage. if( storage_storageopen(sd) == 1 ) { return 0; } } for (i = 0; i < MAX_INVENTORY; i++) { ARR_FIND(0, AFKSTOREITEM_LIST, a, sd->state.afk_storeItemlist[a] == sd->inventory.u.items_inventory[i].nameid); if (a != AFKSTOREITEM_LIST) { if (sd->inventory.u.items_inventory[i].amount && sd->inventory.u.items_inventory[i].equip == 0) { storage_storageadd(sd, &sd->storage, i, sd->inventory.u.items_inventory[i].amount); } } } storage_storageclose(sd); } return 0; } Quote Link to comment Share on other sites More sharing options...
Question
nasagnilac
I am creating a autostorage timer but it dont store the item. Can you please help me check the script. Thanks you.
TIMER_FUNC(unit_autostorage){ struct block_list *bl; struct unit_data *ud; bl = map_id2bl(id); if (!bl) return 0; ud = unit_bl2ud(bl); if (!ud) return 0; struct map_session_data *sd = (struct map_session_data*)bl; int i, a; // Store item when weight become 90% if(pc_is90overweight(sd) && sd->state.afk_storeItem == 1){ if (sd->state.storage_flag != 1) { //Open storage. if( storage_storageopen(sd) == 1 ) { return 0; } } for (i = 0; i < MAX_INVENTORY; i++) { ARR_FIND(0, AFKSTOREITEM_LIST, a, sd->state.afk_storeItemlist[a] == sd->inventory.u.items_inventory[i].nameid); if (a != AFKSTOREITEM_LIST) { if (sd->inventory.u.items_inventory[i].amount && sd->inventory.u.items_inventory[i].equip == 0) { storage_storageadd(sd, &sd->storage, i, sd->inventory.u.items_inventory[i].amount); } } } storage_storageclose(sd); } return 0; }
Link to comment
Share on other sites
0 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.