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?
Forum
CS2D Scripts get itemid (not type id of weapon)get itemid (not type id of weapon)
3 replies 1
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?
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
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
EngiN33R has written
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
1