Forum

> > CS2D > Scripts > About "item" LUA command
Forums overviewCS2D overview Scripts overviewLog in to reply

English About "item" LUA command

3 replies
To the start Previous 1 Next To the start

old About "item" LUA command

MikuAuahDark
User Off Offline

Quote
I want to create something with this lua command, but cs2d lua cmd item only uses a unique ID of dropped items. If the dropped item is ID 2 and player pick the weapon then
1
item(2,"type")
simply return false

But when the item is dropped
1
item(2,"type")
returns the type ID

So my question is:

Is a cs2d lua cmd item only affect to dropped items?
If so, then this code
1
item(type,"player")
is useless.

old Re: About "item" LUA command

Deleted User

Quote
Read carefully:

http://www.cs2d.com/help.php?luacmd=item#cmd has written
[...]
• player: ID of player that carries this item or 0 if it is dropped
[...]

old Re: About "item" LUA command

EngiN33R
Moderator Off Offline

Quote
@user Infinite Rain: He's right to be in doubt, because as the help page states, item(0,"table") only returns IDs of dropped items.

I don't use this function all too often, but it does look like the player option is useless. The only item ID that belongs to a player seems to be 0, which is always the knife (tried testing it locally) - so when I do item(0,"player") I get 1, and when I do item(0,"type") I get 50. In all other cases the player option returns 0 for dropped.

old Re: About "item" LUA command

MikuAuahDark
User Off Offline

Quote
user Infinite Rain has written
Read carefully:

http://www.cs2d.com/help.php?luacmd=item#cmd has written
[...]
• player: ID of player that carries this item or 0 if it is dropped
[...]

No, you're not read it correctly.
user MikuAuahDark has written
but cs2d lua cmd item only uses a unique ID of dropped items. If the dropped item is ID 2 and player pick the weapon then
1
item(2,"type")
(code above) simply return false


Bdw i need user DC answers here.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview