Forum

> > CS2D > Scripts > Preventing Ts team to pick up certain items
Forums overviewCS2D overview Scripts overviewLog in to reply

English Preventing Ts team to pick up certain items

6 replies
To the start Previous 1 Next To the start

old Preventing Ts team to pick up certain items

GeoB99
Moderator Off Offline

Quote
Right, I was doing this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Items = {32, 33, 39, 21}

function unallow(id, iid, type)
	if player(id,"team") == 1 then
		for _,i in pairs(Items) do
			if itemtype == i then
				return 1
			else
				return 0
			end
		end
	end
end

addhook("walkover","unallow")
Pretty much basic stuff. What I want to do is to prevent Terrorists to pick up some items (mainly weapons) so I was thinking that cs2d lua hook walkover hook and returning value as 1 would do the job. Everything is fine, the Console doesn't print any lua error message with the exception that as a Terror I am still able to pick up those items...

I don't know what's the odd behind it. Probably either there is something wrong in 6 or 5 line which might causes this I guess but I am not sure though.

Any thoughts?
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview