From ae6a32af0d1fefbe89cfe15efadc46a2e73f4db3 Mon Sep 17 00:00:00 2001 From: Ekibunnel <7073622+Ekibunnel@users.noreply.github.com> Date: Fri, 16 Feb 2024 15:58:43 +0100 Subject: [PATCH 1/2] Added ApplySticker --- index.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) 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'); From 14b3c4a5ac6758c0122245f2a2540863a1ae9569 Mon Sep 17 00:00:00 2001 From: Ekibunnel <7073622+Ekibunnel@users.noreply.github.com> Date: Fri, 16 Feb 2024 16:10:01 +0100 Subject: [PATCH 2/2] Update README.md Added ApplySticker to the methods --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) 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