Forum

> > CS2D > Scripts > 1HP and knife
Forums overviewCS2D overview Scripts overviewLog in to reply

English 1HP and knife

5 replies
To the start Previous 1 Next To the start

old 1HP and knife

Moogurn
BANNED Off Offline

Quote
How to make so that all came with 1 HP and only knife?
INFO
On all maps.

old Re: 1HP and knife

Rainoth
Moderator Off Offline

Quote
1
2
3
4
5
6
7
addhook("startround","_sr")
function _sr(mode)
	for _,id in pairs (player(0,"tableliving")) do
		parse("sethealth "..id.." 1")
		parse("strip "..id)
	end
end

Does not prevent acquiring weapons after round starts. Does not prevent healing after round starts. Does not work on modes where knife is not default weapon (for example 'Zombies').

old Re: 1HP and knife

Hajt
User Off Offline

Quote
or simply
1
2
3
4
5
addhook("spawn","myspawnhook")
function myspawnhook(id)
	parse("sethealth "..id.." 1")
	return "x"
end

old Re: 1HP and knife

Yates
Reviewer Off Offline

Quote
Use setmaxhealth instead. This would fix issues with there being bandages or any other type of healing item, entity or armour on a map.
edited 1×, last 25.01.16 02:49:54 pm

old Re: 1HP and knife

Rainoth
Moderator Off Offline

Quote
Wasn't sure if it worked with weapons carried from last round so used my method to write it. If it works too, use user Hajt's code.

old Mode for basic

Paulo49
User Off Offline

Quote
1
2
3
4
5
addhook("spawn","_knifemode")
function _knifemode(id)
parse("sethealth "..id.." 1")
parse("strip "..id.."")
end
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview