OnPlayerPutDownCarryItem
A carry item left a player’s hands - it lies at x, y, z.
reason is one of: "put down" (the carrier’s own put), "broken off" (the game knocked it out of his hands), "failed" (his
game could not pick it up; it lies where it was), "mode" (DropPlayerCarryItem, or the mode did something to him),
"timeout" (a pickup that never finished), "died", "left", "moved" (SetPlayerPos), "respawned",
"another world", "mounted", "cart", "flying" or "knocked out". After a put the item lies where the carrier’s game laid
it as long as that is within three metres of him and on his level; after anything the server did to him it lies where he
stood. An item taken away (TakePlayerCarryItem, DestroyEntity) is gone: no call.
Syntax
Section titled “Syntax”function OnPlayerPutDownCarryItem(pid, id, item, reason, x, y, z) -- ...end| Parameter | Type | |
|---|---|---|
pid |
number | the carrier |
id |
number | the carry item’s entity id |
item |
string | the item’s name, or its class GUID |
reason |
string | why it ended |
x |
number | metres - where the item lies |
y |
number | metres |
z |
number | metres |
Returns
Section titled “Returns”nothing
Example
Section titled “Example”-- a sack delivered to the mill's door pays 5 Groschenlocal MILL_X, MILL_Y = -312.0, 115.0function OnPlayerPutDownCarryItem(pid, id, item, reason, x, y, z) if reason == "put down" and item == "mlynaruvUcen_sackcarryable" and math.abs(x - MILL_X) < 3 and math.abs(y - MILL_Y) < 3 then GivePlayerMoney(pid, 5) DestroyEntity(id) endendSee also
Section titled “See also”OnPlayerPickUpCarryItem · DropPlayerCarryItem · GetPlayerCarryItem · the Carry items group of the index
