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

Silly question - "do****ItemEx"

Rexxar

of Unimatrix Zero-One
Joined
Jun 4, 2009
Messages
1,014
Solutions
3
Reaction score
130
Location
Narnia
Okay, to many this may seem like a rather stupid question, but I can't for the life of me seem to figure it out.
I've searched a dozen times, and gone through 10+ scripts, but I'm no closer to an answer.

LUA:
doCreateItem(itemid, type/count, pos)
doAddContainerItem(uid, itemid[, count/subtype])
doPlayerAddItem(uid, itemid[, count/subtype[, canDropOnMap = true]])

These ones, among other commands, are fully understandable to me, I know their function and their possible usage.

However.

Code:
doPlayerAddItem[B][COLOR="Red"]Ex[/COLOR][/B](cid, uid[, canDropOnMap = false])
doCreateItem[B][COLOR="Red"]Ex[/COLOR][/B](itemid[, count/subtype])
doAddContainerItem[B][COLOR="Red"]Ex[/COLOR][/B](uid, virtuid)
doTileAddItem[B][COLOR="Red"]Ex[/COLOR][/B](pos, uid)

These ones are the ones confusing me...
do****ItemEx?
What exactly does the "Ex" stand for? Example?

And what does this command do? (Except for creating items obviously)
What is its intended usage? To create item "examples"?

Any help and/or explanation would be appreciated.
 
  1. doCreateItemEx(itemid[, count/subtype])
    Creates a virtual item (stored in RAM) without creating it ingame.

  2. doPlayerAddItemEx(cid, uid[, canDropOnMap = false])
    Adds a virtual item that's been previously created in the script to the target player.

Usage for these 2 functions:
LUA:
local thing = doCreateItemEx(2160, 100) -- creating virtual 100 crystal coins
if doPlayerAddItemEx(cid, thing, false) == RETURNVALUE_NOERROR then -- checking whether player can receive the item
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found 100 crystal coins.") -- success
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You don't have enough free capacity or room.") -- player failed to receive the item
end

doAddContainerItemEx(uid, virtuid) and doTileAddItemEx(pos, uid) also work in a similar way, .. they deal with virtual items.
 
Oh I understand, thanks alot! Some well-deserved rep for you. :)

Just one question;

doCreateItemEx(itemid[, count/subtype])

This one creates the item in the memory (RAM).

doPlayerAddItemEx(cid, uid[, canDropOnMap = false])
doAddContainerItemEx(uid, virtuid)
doTileAddItemEx(pos, uid)


These ones deposits that item in whatever location of your choice (Character inventory, Inside container, On a floor tile).

That way you can manage items without having to actually place them anywhere in game.

Correct?
 
Back
Top