Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added ApplySticker #90

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 21 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down