User Tools

Site Tools


developer_center:developer_editor:script:backpack_event

Backpack Class

Class For Backpack Interface

Return To Previous Page


API list

Class:apiName(Parameters) Return Description Notes
Backpack:getBackpackBarIDRange(bartype:number) ErrorCode.OK _ begid:number, endid:number Obtain the ID range of the prop inventory column (start ID ~ end ID) Parameter(bartype): 1:Shortcut bar; 2:Storage bar; 3:Armor bar
Backpack:getBackpackBarSize(bartype:number) ErrorCode.OK _ size:number Obtain the size of the prop backpack column Parameter(bartype): 1:Shortcut bar; 2:Storage bar; 3:Armor bar
Backpack:setGridItem(playerid:number, gridid:number, itemid:number, num:number, durability:number) ErrorCode.OK _ Set the backpack grid props Parameter(gridid): Switch To Datatype List
Backpack:removeGridItem(playerid:number, gridid:number, num:number) ErrorCode.OK _ Remove a certain number of props in the backpack grid, remove all by default Parameter(gridid): Switch To Datatype List
Backpack:removeGridItemByItemID(playerid:number, itemid:number, num:number) ErrorCode.OK _ num:number Remove a certain number of props in the backpack, remove all by default
Backpack:clearPack(playerid:number, bartype:number) ErrorCode.OK _ Clear the specified backpack column Parameter(bartype): 1:Shortcut bar; 2:Storage bar; 3:Armor bar
Backpack:clearAllPack(playerid:number) Clear all backpacks (including backpack bar, shortcut bar, armor bar)
Backpack:moveGridItem(playerid:number, gridsrc:number, griddst:number, num:number) ErrorCode.OK _ Move backpack props, all transfer by default Parameter(gridsrc & griddst): Switch To Datatype List
Backpack:swapGridItem(playerid:number, gridsrc:number, griddst:number) ErrorCode.OK _ Exchange backpack props Parameter(gridsrc & griddst): Switch To Datatype List
Backpack:enoughSpaceForItem(playerid:number, itemid:number, num:number) ErrorCode.OK _ Whether the backpack has enough space to store a certain number of props
Backpack:calcSpaceNumForItem(playerid:number, itemid:number) ErrorCode.OK _ num:number Calculate the remaining total number of props that can be stored in the backpack
Backpack:getBackpackBarValidList(playerid:number, bartype:number) ErrorCode.OK _ num:number, array:table Obtain the list of effective grid IDs in the inventory column of the props and the array of IDs of the backpack grids Parameter(bartype): 1:Shortcut bar; 2:Storage bar; 3:Armor bar
Backpack:getBackpackBarItemList(playerid:number, bartype:number) ErrorCode.OK _ num:number, arr:table Get the props that the props backpack column already has and the props ID array Parameter(bartype): 1:Shortcut bar; 2:Storage bar; 3:Armor bar
Backpack:hasItemByBackpackBar(playerid:number, bartype:number, itemid:number) ErrorCode.OK _ Detect whether the backpack holds a certain item
Backpack:getItemNumByBackpackBar(playerid:number, bartype:number, itemid:number) ErrorCode.OK _ num:number, arr:table Get the total number of items held in the backpack and return the array of backpack grids containing the items Parameter(bartype): 1:Shortcut bar; 2:Storage bar; 3:Armor bar
Backpack:getGridItemID(playerid:number, gridid:number) ErrorCode.OK _ itemid:number, num:number Get the item ID of the backpack grid Parameter(gridid): Switch To Datatype List
Backpack:getGridItemName(playerid:number, gridid:number) ErrorCode.OK _ name:string Get the name of the backpack grid prop Parameter(gridid): Switch To Datatype List
Backpack:getGridStack(playerid:number, gridid:number) ErrorCode.OK _ num:number, maxstack:number Obtain the stacking number of backpack grid props Parameter(gridid): Switch To Datatype List
Backpack:getGridDurability(playerid:number, gridid:number) ErrorCode.OK _ durcur:number, durmax:number Get the durability of the backpack grid props Parameter(gridid): Switch To Datatype List
Backpack:getGridEnchantList(playerid:number, gridid:number) ErrorCode.OK _ num:number, arr:table Get the enchantment of the backpack grid props Parameter(gridid): Switch To Datatype List
Backpack:getGridToolType(playerid:number, gridid:number) ErrorCode.OK _ type:number Get the tool type of backpack props (<0 means non-tool) Parameter(gridid): Switch To Datatype List
Backpack:addItem(playerid:number, itemid:number, num:number) ErrorCode.OK _ successNum:number Add props to the backpack
Backpack:discardItem(playerid:number, gridid:number, num:number) ErrorCode.OK _ Discard the props in a certain grid of the backpack
Backpack:getGridNum(playerid:number, gridid:number) ErrorCode.OK _ Get the number of props in a certain grid of the backpack
Backpack:actEquipUpByResID(objid:number, resid:number) ErrorCode.OK _ The player puts on the equipment
Backpack:actEquipOffByEquipID(objid:number, equipid:number) ErrorCode.OK _ The player takes off the equipment in the equipment bar
Backpack:actCreateEquip(objid:number, resid:number) ErrorCode.OK _ To create equipment
Backpack:actDestructEquip(objid:number, equipid:number) ErrorCode.OK _ Destroy equipment
Backpack:PlayShortCutIxEffect(objid:number, effectid:number, scale:number) ErrorCode.OK _ Set the playback effect on the handheld bar props
Backpack:StopShortCutIxEffect(objid:number, effectid:number) ErrorCode.OK _ Stop playing special effects on the handheld bar props
Backpack:PlayShortCutItemEffect(objid:number, itemid:number, effectid:number, scale:number) ErrorCode.OK _ Set the shortcut bar to play special effects on the specified props
Backpack:StopShortCutItemEffect(objid:number, itemid:number, effectid:number) ErrorCode.OK _ Stop playing special effects on the specified props in the shortcut bar
developer_center/developer_editor/script/backpack_event.txt · Last modified: 2023/12/14 06:21 by highbrave