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 No Melee

limonata
User Off Offline

Quote
Hello us please tell me how can i remove knife? I tried this but failed.

1
2
3
4
5
6
addhook("spawn","_spawn")
function _spawn(id)
for i = 1,32 do
parse("strip "..i.." 50")
end
end

old Re: No Melee

wotaan
User Off Offline

Quote
Attention: You cannot remove all weapons! The player always has to have at least one weapon. The game will automatically equip the standard melee weapon (knife with id 50 in most game modes) if there is no weapon left! Do not try to strip all weapons. Its an invalid game state that might lead to problems!

http://www.cs2d.com/help.php?cat=all&cmd=strip#cmd

old Re: No Melee

limonata
User Off Offline

Quote
So ? What should i do now ? I already didnt strip all weapons i just do it on knife (ID: 50)

old Re: No Melee

Alistaire
User Off Offline

Quote
You can't strip the knife without giving the player something else first (like claws).

old Re: No Melee

orkin2913
User Off Offline

Quote
1
2
3
4
5
addhook("spawn","_spawn")
function _spawn(id)
parse("equip "..id.." 1")
parse("strip "..id.." 50")
end

old Re: No Melee

ohaz
User Off Offline

Quote
1
2
3
4
addhook("startround", "no_knife")
function no_knife()
	parse("mp_wpndmg 50 0")
end

old Re: No Melee

Dynamite07
User Off Offline

Quote
1
2
parse("equip "..a.." 74")
parse("equip "..a.." 75")
edited 2×, last 13.03.13 09:39:15 pm

old Re: No Melee

limonata
User Off Offline

Quote
I tried but doesnt work correctly. I dont want to pistol or glock or melee just wrech and snowball. I tried this but failed.

1
2
3
4
5
6
7
8
9
addhook("spawn","rp_spawn")
function rp_spawn(id)
parse("equip "..id.." 75")
parse("strip "..id.." 50")
parse("equip "..id.." 74")
parse("strip "..id.." 1")
parse("strip "..id.." 2")
end
----

old Re: No Melee

wotaan
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
addhook("always","_dspawn")
function _dspawn()
for i = 1,32 do
parse("equip "..i.." 74")
parse("setweapon "..i.." 74")
parse("strip "..i.." 50")
end
end

addhook("drop","_drop")
function _drop(id,iid,type,ain,a,mode,x,y)
if item(iid,"type")==74 then
return 1
end
end
edited 4×, last 13.03.13 09:39:21 pm

old Re: No Melee

limonata
User Off Offline

Quote
Wotan thanks for your help But it isnt correct. You used always hook its mean when i a take pistol or other weapons it returns to wrech so yours fail.

old Re: No Melee

wotaan
User Off Offline

Quote
try this one->
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
addhook("always","_dspawn")
function _dspawn()
for i = 1,32 do
if player(i,"weapontype")==50 then
parse("equip "..i.." 74")
parse("setweapon "..i.." 74")
parse("strip "..i.." 50")
end
end
end

addhook("drop","_drop")
function _drop(id,iid,type,ain,a,mode,x,y)
if item(iid,"type")==74 then
return 1
end
end

old Re: No Melee

Dynamite07
User Off Offline

Quote
It should be better the spawn hook if you use the drop hook because the always should lag a bit more, idk why drop is not working, maybe is a bug.

old Re: No Melee

Avo
User Off Offline

Quote
1
item(iid,"type")

to

1
type

and use function with timer to strip weapon some miliseconds after spawn.
edited 1×, last 13.03.13 09:54:05 pm

old Re: No Melee

Dynamite07
User Off Offline

Quote
user Avo has written
1
item(iid,"type")

to

1
item(type,"type")

and use function with timer to strip weapon some miliseconds after spawn.

Keep the same for me.

old Re: No Melee

limonata
User Off Offline

Quote
Wotan will solve this problem because he is really good lua coder.

old Re: No Melee

wotaan
User Off Offline

Quote
anyway different solution-->
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
addhook("spawn","_spawn")
function _spawn()
return "x"
end

addhook("always","_always")
function _always()
for i = 1,32 do
if player(i,"weapontype")==50 then
parse("equip "..i.." 74")
parse("setweapon "..i.." 74")
parse("strip "..i.." 50")
end
end
end

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