warriorfrog
Active Member
- Joined
- Jul 29, 2015
- Messages
- 334
- Reaction score
- 35
How to give an item to a player with something like a attribute and only this player can have this item
I mean, when player try to trade send doPlayerSendCancel(cid, "You cant trade a UNIQUE item.")
from https://github.com/Fir3element/3777/blob/master/src/luascript.cpp
On throw item
When player dies: send the item to players depot
Is it possible?
I mean, when player try to trade send doPlayerSendCancel(cid, "You cant trade a UNIQUE item.")
Code:
???
lua_register(m_luaState, "getPlayerTradeState", LuaInterface::luaGetPlayerTradeState);
???
On throw item
Code:
function onMoveItem(item, fromPosition, toPosition, cid)
if item.itemid == UNIQUEID and toPosition.y == ONGAMESCREEN then
doPlayerSendCancel(cid, "You cant throw a UNIQUE item.")
return false
end
return true
end
When player dies: send the item to players depot
Code:
local player = ???
local item_id = ???
local count = ???
local town_id = 1
local chest = doCreateItemEx(2595)
doAddContainerItem(chest, item_id, count)
doPlayerSendMailByName(getPlayerNameByGUID(player), chest, town_id)
Is it possible?