Forum

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

English Removeitem

13 replies
To the start Previous 1 Next To the start

old closed Removeitem

Mora
User Off Offline

Quote
Hello all
I need little script:
Walkover
when i pick up secondary or primary or flare or defuse kit(if terrorist walk then remove too) then is just remove.(without equip)
Thank you so much

and sorry my english...

old Re: Removeitem

Mora
User Off Offline

Quote
@user Yates: i see it,and i make this:
addhook("walkover","www")
function www(id,iid,type)
if type==61 then
parse("removeitem "..iid")
parse("equip "..id.." "..type)
return 1
elseif type==62 then
parse("removeitem "..iid)
parse("equip "..id.." "..type)
return 1
end
end
but it not work,i dont know.

old Re: Removeitem

Yates
Reviewer Off Offline

Quote
Why are you checking for a type and then removing an idd and equiping a type?

Makes no sense. Make it all type.

user useigor has written
user Mora, open console. And find red text.

If you checked the code you would know that it won't spew out any error. He is just doing it wrong.

Please don't post if you can't code, saves me and him a shitload of time. Thanks.

old Re: Removeitem

Mora
User Off Offline

Quote
@user useigor: {ENGL} my code work,but it equip,i need for not equip.
sorry english :<
{RUS} этот код работает,но предметы добавляются,нужно чтобы они не добавлялись. <sorry for it,my english is too bad.
edited 1×, last 15.10.13 03:39:22 pm

old Re: Removeitem

Yates
Reviewer Off Offline

Quote
@user Mora: So if you don't want it to equip any thing why are you using the command cs2d cmd equip?

Know what, I'll leave you and Useigor to it. You both seem to be on the same page here. Who knows you both might just learn something.
edited 1×, last 15.10.13 03:40:35 pm

old Re: Removeitem

Mora
User Off Offline

Quote
I am n**b scripter...
i dont know how it works

old Re: Removeitem

Yates
Reviewer Off Offline

Quote
1
2
3
4
5
6
addhook("walkover","www")
function www(id,iid,type)
	if type == 61 or type == 62 then
		parse("removeitem "..type)
	end
end

Because you asked nicely. I haven't tested it though.

old Re: Removeitem

useigor
User Off Offline

Quote
type = id of item. iid = id of item on map.

He check if item (that walked over) == type then
remove item from map --
equip item id
end

Type is constant value, but iid is not. If type == iid then there is no sense of meaning of existence of iid.

Edit: I'm slow in answering because i checking seven times my messages before posing.
edited 1×, last 15.10.13 03:50:03 pm

old Re: Removeitem

useigor
User Off Offline

Quote
user Yates, man he must use his own head. Otherwise we should deal with infinity lua threads.
He almost done the script and he understood what to do. So your last answer is needless.

And special for you, maybe someone else will see it:
1
parse("removeitem "..type)
Now imagine what gonna happen, if command item id(type) = item id on map(iid)? - Nothing (except case when their numbers are equal). Otherwise script'd remove all items with this id on map. And therefore there'd no easy way to remove one certain item from map.

What should we learn from this thread >
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview