• 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!

TFS 0.X Item for a specific player

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.")
Code:
???
lua_register(m_luaState, "getPlayerTradeState", LuaInterface::luaGetPlayerTradeState);
???
from https://github.com/Fir3element/3777/blob/master/src/luascript.cpp

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?
 
You can not send articles with a virtual parent, you must create the article physically and then send it.
change:
Code:
doCreateItemEx(itemid[, count/subType])
to
Code:
doCreateItem(itemid[, type/count], pos)

some quick idea...
* create the container somewhere inaccessible map and manipulate the article in that way. but there are many methods to do this.
 
You can not send articles with a virtual parent, you must create the article physically and then send it.
change:
Code:
doCreateItemEx(itemid[, count/subType])
to
Code:
doCreateItem(itemid[, type/count], pos)

I don't undertand this sorry


some quick idea...
* create the container somewhere inaccessible map and manipulate the article in that way. but there are many methods to do this.

Just like Store Inbox?
It would be perfect, is that possible to do with an item like <item id="1990" article="a" name="present">?

 
Back
Top