Forum

> > CS2D > Scripts > Roundstart functions doesn't work!
Forums overviewCS2D overview Scripts overviewLog in to reply

English Roundstart functions doesn't work!

3 replies
To the start Previous 1 Next To the start

old Roundstart functions doesn't work!

hacked
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
----------------------------------------------------------------
--aim_shotgun_bla4 script file                                --
--DO NOT CHANGE EVERYTHING UNLESS YOU KNOW WHAT ARE YOU DOING!--
----------------------------------------------------------------

--HOOOOOKS!--

addhook("startround","eq")
addhook("startround","st")
--FUNCTIONS!--

function eq(id,w)
	parse("equip ".. id .." 10")
end

function st(id)
	parse("strip "..id.." 50")
end

Help! The lua under me doesn't work! I checked the console and I don't find any error.

So? What do you want?
I want every roundstart the lua will strip the knife and gives M3 automatically.

Please help! More details ask me here.


EDIT:
Thanks user Suprise! But the stripping system still doesn't work!

EDIT2:
Nah,I found to fix it by myself. By combining both the strip and the equip.
edited 2×, last 23.09.12 03:49:53 pm

old Re: Roundstart functions doesn't work!

DC
Admin Off Offline

Quote
You should have taken a look at cs2d lua hook startround. cs2d lua hook startround only has one parameter which is the startround mode and not a player id. So it can't work properly with cs2d cmd equip or cs2d cmd strip

By the way: Do not use equip or strip in cs2d lua hook spawn. Use the return value instead:
1
2
3
4
addhook("spawn","givem3")
function givem3(id)
	return "10"
end

You will still have a knife this way but stripping the knife is not a good idea (leads to bugs). Instead consider to set the knife damage to 0 or to automatically switch back to the shotgun when the knife is selected.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview