Forum

> > CS2D > Scripts > No Melee
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch No Melee

24 Antworten
Seite
Zum Anfang Vorherige 1 2 Nächste Zum Anfang

alt No Melee

limonata
User Off Offline

Zitieren
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

alt Re: No Melee

wotaan
User Off Offline

Zitieren
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

alt Re: No Melee

limonata
User Off Offline

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

alt Re: No Melee

Alistaire
User Off Offline

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

alt Re: No Melee

orkin2913
User Off Offline

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

alt Re: No Melee

ohaz
User Off Offline

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

alt Re: No Melee

Dynamite07
User Off Offline

Zitieren
1
2
parse("equip "..a.." 74")
parse("equip "..a.." 75")
2× editiert, zuletzt 13.03.13 21:39:15

alt Re: No Melee

limonata
User Off Offline

Zitieren
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
----

alt Re: No Melee

wotaan
User Off Offline

Zitieren
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
4× editiert, zuletzt 13.03.13 21:39:21

alt Re: No Melee

limonata
User Off Offline

Zitieren
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.

alt Re: No Melee

wotaan
User Off Offline

Zitieren
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

alt Re: No Melee

Dynamite07
User Off Offline

Zitieren
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.

alt Re: No Melee

Avo
User Off Offline

Zitieren
1
item(iid,"type")

to

1
type

and use function with timer to strip weapon some miliseconds after spawn.
1× editiert, zuletzt 13.03.13 21:54:05

alt Re: No Melee

Dynamite07
User Off Offline

Zitieren
user Avo hat geschrieben
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.

alt Re: No Melee

limonata
User Off Offline

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

alt Re: No Melee

wotaan
User Off Offline

Zitieren
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
Zum Anfang Vorherige 1 2 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht