Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ///inventoryModifyByIndex(Inventory, Pocket, Index, ValueDifference)
- ///Modifies a specific index; don't call this normally.
- if (debug_mode)
- {
- if (!instance_exists(argument0))
- {
- show_error("[Inventory] Inventory does not exist; cannot get max item count.", 0);
- return 0;
- }
- }
- with (argument0)
- {
- if (argument2 > Max[argument1]) return 0;
- var Str = Slot[argument1, argument2];
- var Quantity = real(string_copy(Str, string_pos("|", Str) + 1, string_length(Str)));
- var Name = string_copy(Str, 1, string_pos("|", Str) - 1);
- if (Quantity + argument3 <= 0)
- {
- Slot[argument1, argument2] = "";
- return 0;
- }
- Slot[argument1, argument2] = Name + "|" + string(Quantity + argument3);
- return Quantity + argument3;
- }
- return 1;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement