Forum

> > CS2D > Scripts > Item
Forums overviewCS2D overview Scripts overviewLog in to reply

English Item

10 replies
To the start Previous 1 Next To the start

old Item

tos12345678
User Off Offline

Quote
I want function which will allow additionally to zombies have permissions(take id items) 66,67,68
/\
l
ID ITEMS 66,67,68 Access to make a zombie

HELP!!!

old Re: Item

Talented Doge
User Off Offline

Quote
What are you trying to say? Why can't you learn to use lua?

old Re: Item

THEMUD
User Off Offline

Quote
I didn't test it, but hopefully it will work properly.
1
2
3
4
5
6
7
8
9
10
items = {66, 67, 68};

addhook("walkover", "_walkover")
function _walkover(id, iid, type, ain, a, mode)
	if player(id, "team") == 1 then
		if iid == items then
			parse("equip "..id.." "..iid)
		end
	end
end

Edit: Oh sorry, didn't notice that.
edited 2×, last 28.12.15 10:39:42 am

old Re: Item

Cure Pikachu
User Off Offline

Quote
@user THEMUD: It won't, like what user Talented Doge said. Here, let me fix it up:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
items = {66, 67, 68};

addhook("walkover", "_walkover")
function _walkover(id,iid,t)
	if player(id, "team") == 1 then
		for _, i in pairs(items) do
			if t == i then
				parse("equip "..id.." ..i)
				parse("removeitem "..iid)
				return 1
			end
		end
	end
end
But still, user tos12345678, it would be much better for you to do these kinds of scripts yourself and learn something in the process.

old Re: Item

Talented Doge
User Off Offline

Quote
I'm aware that cs2d cmd removeitem will not work. It removes items with id 66, 67 or 68 on the map.

Edit: nvm I think it will work now.

old Re: Item

GeoB99
Moderator Off Offline

Quote
In a basic way, you can do with kind of script too.
1
2
3
4
5
6
7
8
9
10
function collect(id, iid, type)
	if player(id,"team") == 1 then
		parse("equip "..id.." 66")
		parse("equip "..id.." 67")
		parse("equip "..id.." 68")
		return 1
	end
end

addhook("walkover","collect")
It's a bit made in a noob(-ish) way but hope you will figure somehow. I've just used cs2d lua hook walkover + cs2d cmd equip to allow the Zombies team to collect those items. The return 1 is kinda useless since it still allows Zombies to pick up but it doesn't matter, I think.

old Re: Item

THEMUD
User Off Offline

Quote
@user GeoB99: In this case, it will equip those items all (67, 68, 69) in every time you collect something.

old Re: Item

tos12345678
User Off Offline

Quote
Exactly i need script = when got money (Normal Game Money)
that subtract (Normal game money) to dont bug my ( secretcoins(id) )
edited 1×, last 28.12.15 11:24:20 am

old Re: Item

Talented Doge
User Off Offline

Quote
Original post has written
I want function which will allow additionally to zombies have permissions(take id items) 66,67,68
/\
l
ID ITEMS 66,67,68 Access to make a zombie

HELP!!!


Now has written
Exactly i need script = when got money (Normal Game Money)
that -- money to dont bug my ( secretcoins(id) )


That is one hell nice description you've got there. We cannot help you unless you provide us your script.

old Re: Item

tos12345678
User Off Offline

Quote
Problem fixed thanks for help!
edited 1×, last 28.12.15 12:34:07 pm
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview