Forum

> > CS2D > Scripts > get itemid (not type id of weapon)
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch get itemid (not type id of weapon)

3 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt get itemid (not type id of weapon)

iii
User Off Offline

Zitieren
I have a problem with finding the item id for the Command item.
i try to get information about the zoom mode of a sg550. i think i can get it with item(id,"mode"). but when i go through the first 500 weapen id's and use the value exists on this command it is always false. do you know how i can solve this problem?

alt Re: get itemid (not type id of weapon)

EngiN33R
Moderator Off Offline

Zitieren
@user Near: It's a little different.

The key thing that prevents me from helping you properly is how you put the problem. You try to get information about the zoom mode of an SG550. Do you know which one that SG550 is? In this case the indefinite article implies you don't really know which weapon it is.

In short: the mode of which SG550 are you trying to get? Here I assume that you know who the SG550 belongs to:

1
2
3
4
5
6
7
8
9
10
11
function getPlayerWeaponMode(weapon,player) -- weapon is the weapon type id, player is the player id
	for _,v in pairs(item(0,"table")) do
		if item(v,"type")==weapon then
			if item(v,"player")==player then
				return item(v,"mode")
			end
		end
	end
end

mode = getPlayerWeaponMode(37,1) -- get the mode of the SG550 that belongs to player with the ID 1

alt Re: get itemid (not type id of weapon)

iii
User Off Offline

Zitieren
user EngiN33R hat geschrieben
You try to get information about the zoom mode of an SG550.

You guessed right, that i wanted to say.

but your solution don't work, i already tested it.
item(0,"table") return only dorpped weapons.

i think i found a solution. if you zoom you tiggered attack 2. i will save this data and work with it.
anyway thank you
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht