Forum

> > CS2D > Scripts > Script request.
Forums overviewCS2D overview Scripts overviewLog in to reply

English Script request.

4 replies
To the start Previous 1 Next To the start

old Script request.

lucaSWAT
User Off Offline

Quote
Hi unreal !

I wonder if there is a script or if anyone could do it.

And wanted to know the% of a number.

Example: kill = 1000, die = 500, Ratio: 50.0%

I would like to know if this and posivel. And if you would like to know if anyone know do it.

The code of the score and die and.
1
2
save_kill[id]
save_die[id]

Sorry for the mistakes in English I'm using google translator.

old Re: Script request.

Devil-Thanh
GAME BANNED Off Offline

Quote
i think kill 1000 and die 1000 is 50%

1
2
3
4
function ratio(id)
	local ratio = save_kill[id]*100/(save_kill[id] + save_die[id])
        parse('hudtxt2 '..id..' 1 "©000255000Ratio: '..ratio..' " 13 117')
end

old Re: Script request.

Rainoth
Moderator Off Offline

Quote
I'm pretty sure you can't make locals that are named the same as function but everything else I think should be fine.

old Re: Script request.

lucaSWAT
User Off Offline

Quote
user Devil-Thanh has written
i think kill 1000 and die 1000 is 50%

1
2
3
4
function ratio(id)
	local ratio = save_kill[id]*100/(save_kill[id] + save_die[id])
        parse('hudtxt2 '..id..' 1 "©000255000Ratio: '..ratio..' " 13 117')
end


Thx .

old Re: Script request.

VADemon
User Off Offline

Quote
user Rainoth has written
I'm pretty sure you can't make locals that are named the same as function but everything else I think should be fine.

That crazy shit works as well as
1
2
3
4
x, y = 2, 5
print(x,y)
x, y = y, x
print(x,y)
Anyway, you'd never call the same function again you're currently running.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview