diff --git a/README.md b/README.md index 9802678..1e26eb1 100644 --- a/README.md +++ b/README.md @@ -293,6 +293,15 @@ It appears that under some circumstances, the GC might load these items into you so if you are using [`inventory`](#inventory) to see what items are in your inventory, you will need to check `casket_id` to filter out items stored in storage units. +### ApplySticker(stickerId, itemId, stickerSlot, stickerRotation, stickerOffsetX, stickerOffsetY) +- `stickerId` - The ID of the sticker you want to consume to do this +- `itemId` - The ID of the item you want to apply the sticker to +- `stickerSlot` - The sticker slot number, from 0 to 4 or 5 depending on weapon +- `stickerRotation` - The sticker rotation, from -180 to 180 +- `stickerOffsetX` - The sticker X offset from the sticker slot, can't be placed into the void +- `stickerOffsetY` - The sticker Y offset from the sticker slot, can't be placed into the void + + # Events ### connectedToGC diff --git a/index.js b/index.js index 871e8de..e1ff47c 100644 --- a/index.js +++ b/index.js @@ -407,6 +407,27 @@ GlobalOffensive.prototype.getCasketContents = function(casketId, callback) { this.on('itemCustomizationNotification', customizationNotification); }; +/** + * Apply a sticker to an item in your inventory. + * @param {int} stickerId + * @param {int} itemId + * @param {int} stickerSlot + * @param {float} stickerRotation + * @param {float} stickerOffsetX - Sticker can't be placed into the void + * @param {float} stickerOffsetY - Sticker can't be placed into the void + */ +GlobalOffensive.prototype.ApplySticker = function(stickerId, itemId, stickerSlot, stickerRotation, stickerOffsetX, stickerOffsetY ) { + this._send(Language.ApplySticker, Protos.CMsgApplySticker, { + sticker_item_id: stickerId, + item_item_id: itemId, + sticker_slot: stickerSlot, + sticker_rotation: stickerRotation, + sticker_offset_x: stickerOffsetX, + sticker_offset_y: stickerOffsetY + }); +} + + GlobalOffensive.prototype._handlers = {}; require('./enums.js');