What should learn
Mora from this thread:
1.) This code:
1
2
3
4
5
if a == 2 then
something
elseif a == 3 then
something
end
is equal to this:
1
2
3
if a == 2 or a == 3 then
something
end
Inference: use "
or" if something(1) == something(2)
2.) Compare what do commands with what you want. Sample:
What you want:
do NOT equip item that you walked over.
Your command:
do equip item.
Inference: command "
equip" must be removed.
3.) Check console if your script doesn't work to have some chance to solve the problem:
1
2
3
4
5
6
7
8
9
10
11
12
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
Better to use
Notepad++ to have syntax highlighting. Because in this case wrong symbol'll've black color instead of gray.
Quote
parse("removeitem "..iid")
Inference:
" must be removed.
4.) Use tag "
code" and key "tab" on your keyboard. To write understandable script.
What should learn
Yates:
1)
Look before you leap =>
Haste makes waste.
2.) iid =/= type.
3.) Always read attentions on cs2d.com:
Sample | has written
Attention: Do not confuse the ID of an item instance on the map (see item command) with the type ID! Those are two different things. Each item has one unique ID but multiple items can have the same type ID!
What should learn
useigor:
1) Don't spare people and give full ban.
DC has written
full ban is standard. Just use full ban.