Forum

> > CS2D > Scripts > No Melee
Forums overviewCS2D overview Scripts overviewLog in to reply

English No Melee

24 replies
Page
To the start Previous 1 2 Next To the start

old Re: No Melee

Dynamite07
User Off Offline

Quote
user wotaan has written
anyway different solution-->

Nice but can you explain why the other code didnt work? i think idd is not working.

old Re: No Melee

Avo
User Off Offline

Quote
Quote
he is really good lua coder

Yeap, he even uses tabs. Using 'always' hook is also very professional here. Same at his 'for' loop.

old Re: No Melee

wotaan
User Off Offline

Quote
@user Dynamite07: i test it before you asked, and answer is it is working, but maybe return a string value because of that our codes didnt work.. with tonumber() it will be good.

old Re: No Melee

Dynamite07
User Off Offline

Quote
user wotaan has written
@user Dynamite07: i test it before you asked, and answer is it is working, but maybe return a string value because of that our codes didnt work.. with tonumber() it will be good.

Doesnt make sense idk what can we do with idd.

What i think:
addhook("drop","drop") --"When a player tries to drop an item."
function drop(id,idd)
if idd == 1 then -- if the item id = 1 then
parse("equip "..id.." 45") -- equip a laser
end

This break my mind.

old Re: No Melee

wotaan
User Off Offline

Quote
just use tonumber ..

1
2
3
4
5
6
addhook("drop","_drop")
function _drop(id,iid,type,ain,a,mode,x,y)
if tonumber(type)==74 then
return 1
end
end
To the start Previous 1 2 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview