PickUpCarryItem
Has a player pick up a carry item - the mode’s own order.
The player’s game plays the pickup and the carry, and everyone who has him in view sees it. Works with the players’ own pickup
switched off; OnPlayerPickUpCarryItem is not asked. Without atOnce the item must lie within six metres of him and in his
view; with atOnce it goes into his hands wherever it lies (the other players see it in his hands at once).
false and the reason (“You are carrying something already.”, “Someone else has it.” …) when the player is dead, not in the
world or in another virtual world than the item; when he is on horseback, in a cart, flying, in a dice match, in a fall or a
pull-down, knocked out, carrying or carried, in a fight, at a shop or in a dialogue; when he holds a carry item already or
someone else holds this one; when it is too far; or when his game cannot carry things (an older build).
Syntax
Section titled “Syntax”PickUpCarryItem(pid, entityId [, atOnce])| Parameter | Type | |
|---|---|---|
pid |
number | the player |
entityId |
number | the carry item (CreateCarryItem) |
atOnce |
boolean | true: straight into his hands, wherever it lies (optional) |
Returns
Section titled “Returns”boolean, string - true when the pickup started; false and the reason when it did not
Example
Section titled “Example”local ok, why = PickUpCarryItem(pid, sackId)if not ok then SendClientMessage(pid, COLOR_RED, why) endSee also
Section titled “See also”GivePlayerCarryItem · DropPlayerCarryItem · GetPlayerCarryItem · the Carry items group of the index
