Forum

> > CS2D > Scripts > How many bullets have I used?
Forums overviewCS2D overview Scripts overviewLog in to reply

English How many bullets have I used?

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

old Re: How many bullets have I used?

sheeL
User Off Offline

Quote
Like This?

1
2
3
4
5
6
7
8
sh = 0

addhook("attack","reload")
function reload(id)
sh = sh+1
parse('hudtxt 5 "©000000255Shots: '..sh..' " 320 432 1')
return 1
end

old Re: How many bullets have I used?

Apache uwu
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
shots={}

addhook("attack","_attack")
addhook("join","_join")

function _attack(id)
	shots[id]=shots[id]+1
	parse('hudtxt2 "..id.." 5 "©000000255Shots: '..shots[id]..' " 320 432 1')
end

function _join(id)
	shots[id]=0
end

I held the mouse button, seems to work fine.

old Re: How many bullets have I used?

Yates
Reviewer Off Offline

Quote
Let me guess, you tested the script with bots? The script you got there counts the total bullets fired by everyone, and not only yours. Use Ketamire's instead.

old Re: How many bullets have I used?

sheeL
User Off Offline

Quote
user Avo has written
@user sheeL:
I tried it before I posted. It doesn't work as it should work. When I hold left mouse mouse it counts a lot of shots

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

addhook("attack","reload")
function reload(id)
sh = sh+1
parse('hudtxt 5 "©000000255Shots: '..sh..' " 320 432 1')
return 1
end

addhook("reload","attack")
function attack(id)
parse('hudtxt 6 "©000000255You Used '..sh..' Balls " 329 452 2')
sh=0
return sh
end

addhook("startround","reloadattack")
function reloadattack()
sh = 0
end

After Puts hudtxt2 ".. id .."

old Re: How many bullets have I used?

Apache uwu
User Off Offline

Quote
@user Avo: I've tested it, and it works fine.

Holding the attack button or pressing it adds to the attack counter appropriately.

For fast weapons such as the fn it will add to the counter faster than weapons such as the deagle.

user Avo has written
When I hold left mouse mouse it counts a lot of shots
-- that's normal
To the start Previous 1 2 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview