• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua Add Item (no cap)

Xtr3m3

Member
Joined
May 14, 2009
Messages
131
Reaction score
11
Is possible to add player item if he don't have cap (the item cannot be created in the ground)?

Thanks.
 
You cannot force to add the item. But you can check if it's not possible to add item, either there is no cap nor room.
 
Like previously said, you cant make item weight less. However what I have done is that I have increased player max cap if item should have less weight than original.
 
You can force it, through doPlayerSetMaxCapacity(cid, cap).
you give more cap to the player, add the item, and then, you take the additional cap.

To calculate how mach capacity you should give, use this function: getPlayerFreeCap(cid)
and to know how much the player need: getItemWeightById(itemid, count[, precise])
 
Back
Top