Skip to content

GivePlayerCarryItem

Makes a new carry item and puts it in a player’s hands.

The item (as in CreateCarryItem) is made at the player’s feet - half a metre in front of him, or right where he stands with atOnce - and he picks it up at once, the mode’s own order (PickUpCarryItem’s checks, without the reach). nil and the reason when the item is unknown or he cannot carry it now (the new item is removed again then).

GivePlayerCarryItem(pid, item [, atOnce])
Parameter Type
pid number the player
item string the item’s name, id or class GUID
atOnce boolean true: the other players see it in his hands at once (optional)

number | nil, string - the new item’s entity id; nil and the reason when none was given

-- the quartermaster hands out a bucket
local id, why = GivePlayerCarryItem(pid, "waterBucket")
if not id then SendClientMessage(pid, COLOR_RED, why) end

PickUpCarryItem · TakePlayerCarryItem · CreateCarryItem · the Carry items group of the index