Forum

> > CS2D > Scripts > Unable to strip knife.
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Unable to strip knife.

14 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Unable to strip knife.

hacked
User Off Offline

Zitieren
1
2
3
4
5
6
addhook("spawn","sp_prison_config")

function sp_prison_config(self)
	parse("strip "..self.." 50")
	parse("equip "..self.." 78")
end

I can't remove the damn knife, I keep spawning with both claw and knife.

alt Re: Unable to strip knife.

_oops
User Off Offline

Zitieren
1
2
3
4
5
6
7
addhook("spawn","sp_prison_config")

function sp_prison_config(self)
return "78"
parse("setweapon "..self.." 78")
parse("strip "..self.." 50")
end

didn't test it

alt Re: Unable to strip knife.

Avo
User Off Offline

Zitieren
@user _oops: It won't work because "return" ends function. Everything after "return" will be ignored.

@user hacked: You have to strip a knife after spawn. Note that you won't be able to strip it if it's the only weapon of a player.

alt Re: Unable to strip knife.

Mora
User Spielt CS2D

Zitieren
Just little edit of @user _oops:
1
2
3
4
5
6
addhook("spawn","ssp")
function ssp(id)
parse("equip "..id.." 78")
parse("setweapon "..id.." 78")
parse("strip "..id.." 50")
end

alt Re: Unable to strip knife.

DC
Admin Off Offline

Zitieren
You can't strip the standard melee weapon (well you can but you shouldn't). It will lead to an invalid game state and CS2D will automatically try to fix it be re-equipping the weapon.

alt Re: Unable to strip knife.

_Yank
User Off Offline

Zitieren
@user DC: From what I remember it won't, I already did something similar to this.

1
2
3
4
5
6
7
8
9
function stripem(id)
	parse("strip "..id.." 50")
end

addhook("spawn","_func")
function _func(id)
	timer(30,"stripem",id)
	return 78
end
Didn't tested it by the way.

alt Re: Unable to strip knife.

Alistaire
User Off Offline

Zitieren
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
addhook('drop', '_dropHook')
addhook('select', '_selectHook')
addhook('spawn', '_spawnHook')

function _dropHook(id, iid, type)
	if type == 78 then
		return 1
	end
end

function _selectHook(id, type, mode)
	if type == 50 then
		parse('equip '..id..' 78')
		parse('setweapon '..id..' 78')
	end
end

function weaponIdToClaw(id)
	parse('setweapon '..id..' 78')
end

function _spawnHook(id)
	timer(50, 'weaponIdToClaw', id)
	return 78
end

alt Re: Unable to strip knife.

hacked
User Off Offline

Zitieren
Doesn't work. I looked at the gun game example, and the knife stripping thing works . Can't figure out why mine doesn't.

EDIT:
user Alistaire, your drop function doesn't seem to work.
1× editiert, zuletzt 05.10.14 05:17:42

alt Re: Unable to strip knife.

muxarus
User Off Offline

Zitieren
@user hacked: try this code:
1
2
3
4
5
6
7
8
9
10
addhook("spawn" , "weapon")
function weapon(id,weapon)
	parse("equip "..id.." 78 ")
	parse("setweapon "..id.." 78 ")
end

addhook("spawn","_spawn")
_spawn = function(id)
     timer(100, "parse", "strip "..id.." 50")
end

alt Re: Unable to strip knife.

VADemon
User Off Offline

Zitieren
Itemless REspawn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
addhook("die", "instarespawn")
addhook("spawn", "itemlessspawn")
function instarespawn(victim, killer, weapon, x, y)
	local x, y = 128, 128 -- DIY
	local id = victim
	parse("spawnplayer "..id.." "..x.." "..y)
	
	return 0
end

function itemlessspawn(id)

return "0"
end
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht