Forum

> > CS2D > Scripts > Strip knife - classes.
Forums overviewCS2D overview Scripts overviewLog in to reply

English Strip knife - classes.

11 replies
To the start Previous 1 Next To the start

old Strip knife - classes.

MixTape
User Off Offline

Quote
Hi. I have a problem with strip knife in classes script. I will add this line
1
parse ("strip "..id.." 50")

but it doesn't work. Its example class:
1
2
3
4
5
6
7
8
if (sample.classes.class[id]<=1) then
          freeimage(sample.classes.image[id])
          parse ("setmaxhealth "..id.." 150")
          parse ("setarmor "..id.." 200")
          parse ("speedmod "..id.." 1")
          sample.classes.image[id] = image("gfx/hats/swat_hat.png<m>", 1, 0, 200+id)
          return "69,76";
     end

And i was try this:
Spoiler >


All script code
Spoiler >

old Re: Strip knife - classes.

The Gajos
BANNED Off Offline

Quote
I think it could work:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
if (sample.classes.class[id]<=1) then
	freeimage(sample.classes.image[id])
	sample.classes.image[id] = image("gfx/hats/swat_hat.png<m>", 1, 0, 200+id)
	parse ("setmaxhealth "..id.." 150")
	parse ("setarmor "..id.." 200")
	parse ("speedmod "..id.." 1")
	
	local items = {69,76}
	for _, i in pairs(items) do
		parse('equip '..id..' '..i)
	end
	if #items > 0 then parse('setweapon '..id..' '..items[1]) end
	parse ("strip "..id.." 50")
end

old Re: Strip knife - classes.

MixTape
User Off Offline

Quote
It work but i must add
1
2
parse ("strip "..id.." 1")
parse ("strip "..id.." 2")

Thank you! Unreal must add reputation system, i will add you a lot of positive points!

old Re: Strip knife - classes.

DaisukeOno
User Off Offline

Quote
user The Gajos was help you, but user Talented Doge say you need to put it on spawn hook, this is used spawn hook :
1
2
3
4
addhook("spawn","spawn")
spawn = function(id)
     timer(100, "parse", "strip "..id.." 50")
end
And if you want some classes equipped with knife, put this :
1
parse("equip "..id.." 50")
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview