Forum

> > CS2D > Scripts > Fix This Script
Forums overviewCS2D overview Scripts overviewLog in to reply

English Fix This Script

24 replies
Page
To the start Previous 1 2 Next To the start

old Fix This Script

Bobb1118
User Off Offline

Quote
I'm at a loss here. Could somebody fix this script, and tell me what was wrong? Its a very neat script and everything is labeled.

Spoiler >

old nice

Quit123
User Off Offline

Quote
nice mixter samples and finaly you got a good lua , easy but useful and fun

Spoiler >


i fixx all for make you happy
edited 2×, last 13.10.11 04:46:09 pm

old Re: Fix This Script

Kel9290
User Off Offline

Quote
parse("hudtxt2...") must be one word. NOT 'hudtxt 2'! ITS 'hudtxt2'!
Spoiler >
edited 1×, last 13.10.11 04:57:13 pm

old Re: Fix This Script

Bobb1118
User Off Offline

Quote
user Kel9290 has written
parse("hudtxt2...") must be one word. NOT 'hudtxt 2'! ITS 'hudtxt2'!
Spoiler >


It doesn't seem to change anything.

This doesn't work. What do you make of it?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
--------------------------------------
-- Killstreaks                      --
--------------------------------------

addhook("kill","sample.ks.kill")
function sample.ks.kill(killer,victim,weapon)
	if (os.clock()-sample.ks.timer[killer])>3 then
		sample.ks.level[killer]=0;
	end
	level=sample.ks.level[killer]
	level=level+1
	sample.ks.level[killer]=level
	sample.ks.timer[killer]=os.clock()
	-- Airstrike (5 Killstreak)
		if (level==5) then
		    return "76";
			parse('hudtxt2 "Airstrike is ready for direction. (5 killstreak)" 320 260 1')
		    parse('hudtxtalphafade 0 2 3500 0.0') end
	end
end

76 is an airstike marker. I'm trying to make it so when you get a 5 killstreak you recieve one but it does not swap from your current weapon to it

old Re: Fix This Script

Quit123
User Off Offline

Quote
user Bobb1118 has written
user Kel9290 has written
parse("hudtxt2...") must be one word. NOT 'hudtxt 2'! ITS 'hudtxt2'!
Spoiler >


It doesn't seem to change anything.

This doen't work. What do you make of it?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
--------------------------------------
-- Killstreaks                      --
--------------------------------------

addhook("kill","sample.ks.kill")
function sample.ks.kill(killer,victim,weapon)
	if (os.clock()-sample.ks.timer[killer])>3 then
		sample.ks.level[killer]=0;
	end
	level=sample.ks.level[killer]
	level=level+1
	sample.ks.level[killer]=level
	sample.ks.timer[killer]=os.clock()
	-- Airstrike (5 Killstreak)
		if (level==5) then
		    return "76";
			parse('hudtxt2 "Airstrike is ready for direction. (5 killstreak)" 320 260 1')
		    parse('hudtxtalphafade 0 2 3500 0.0') end
	end
end



you know why in you console spam ? was this



addhook("second","sample.ads.second")
function sample.ads.second()
msg2(id,"Level: "..sample.lvl.level[id].." Kills: "..sample.lvl.kills[id])
end

and i change second for minute --"

addhook("minute","sample.ads.second")
function sample.ads.second()
msg2(id,"Level: "..sample.lvl.level[id].." Kills: "..sample.lvl.kills[id])
end

old Re: Fix This Script

Kel9290
User Off Offline

Quote
More >

Quit123 - you noob in scripting too.

old Re: Fix This Script

Bobb1118
User Off Offline

Quote
im a bit confused because you arent telling me what you changed. i need to know so i can learn from my mistakes

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
--------------------------------------
-- Killstreaks --
--------------------------------------

201 addhook("kill","ks.kill")
202 function ks.kill(killer,victim,weapon)
203     if (os.clock()-ks.timer[killer])>3 then
204          ks.level[killer]=0;
205     end
206     level=ks.level[killer]
207     level=level+1
208     ks.level[killer]=level
209     ks.timer[killer]=os.clock()
210     -- Airstrike (5 Killstreak)
211          if (level==5) then
212           return "76";
213           parse('hudtxt2 "Airstrike is ready for direction. (5 killstreak)" 320 260 1')
214           parse('hudtxtalphafade 0 2 3500 0.0') end
215     end
216 end

lua:213: 'end' expected (to close 'if' at line 211) near 'parse'

old Re: Fix This Script

Kel9290
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
addhook("kill","ks.kill")
function ks.kill(killer,victim,weapon)
	if (os.clock()-ks.timer[killer])>3 then
		ks.level[killer]=0;
	end
	level=ks.level[killer]
	level=level+1
	ks.level[killer]=level
	ks.timer[killer]=os.clock()
	-- Airstrike (5 Killstreak)
	if (level==5) then
		parse('hudtxt2 "Airstrike is ready for direction. (5 killstreak)" 320 260 1')
		parse('hudtxtalphafade 0 2 3500 0.0') end
		return "76"
	end
end
return must be always be at end
also, you got error with hudtxt2, again.

old Re: Fix This Script

Homam
User Off Offline

Quote
user Bobb1118 has written
im a bit confused because you arent telling me what you changed. i need to know so i can learn from my mistakes

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
--------------------------------------
-- Killstreaks --
--------------------------------------

201 addhook("kill","ks.kill")
202 function ks.kill(killer,victim,weapon)
203     if (os.clock()-ks.timer[killer])>3 then
204          ks.level[killer]=0;
205     end
206     level=ks.level[killer]
207     level=level+1
208     ks.level[killer]=level
209     ks.timer[killer]=os.clock()
210     -- Airstrike (5 Killstreak)
211          if (level==5) then
212           return "76";
213           parse('hudtxt2 "Airstrike is ready for direction. (5 killstreak)" 320 260 1')
214           parse('hudtxtalphafade 0 2 3500 0.0') end
215     end
216 end

lua:213: 'end' expected (to close 'if' at line 211) near 'parse'


Add an extra end. Done.

old Re: Fix This Script

Bobb1118
User Off Offline

Quote
Spoiler >


If you attempt to "fix" this, test the f***ing code in the f***ing game before you post your so called "fix" without telling me what you did. Im learning next to nothing.

old Re: Fix This Script

Yates
Reviewer Off Offline

Quote
Tab it on the site when you post. Don't copy & paste the tabbed code, it won't work.

old Re: Fix This Script

Kel9290
User Off Offline

Quote
user Bobb1118 has written
1
2
3
4
addhook("join","ads.join")
function ads.join(p)
     msg2(p,"Welcome to COD2d, "..player(p,"name").."!")
end

non-existing array, try dis:
1
2
3
4
addhook("join","cod2d.ads.join")
function cod2d.ads.join(p)
     msg2(p,"Welcome to COD2d, "..player(p,"name").."!")
end
To the start Previous 1 2 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview