GameBanana shows no ads to members. Sign up now!
Ads keep us online. Without them, we wouldn't exist. We don't have paywalls or sell mods - we never will. But every month we have large bills and running ads is our only way to cover them. Please consider unblocking us. Thank you from GameBanana <3

UTSFX Linux Fix

A Config Script for CS2D

83 2 kb Raw Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
local parse = parse
local msg = msg

if sample==nil then sample={} end
sample.ut={}

function initArray(m)
        local array = {}
        for i = 1, m do
                array[i]=0
        end
        return array
end
sample.ut.timer=initArray(32)                           -- time of last kill, for each player
sample.ut.level=initArray(32)                           -- current kill level (killstreak), for each player
sample.ut.fblood=0                                                      -- first blood already shed? 0=no/1=yes

addhook("second","_second")
function _second()
        for id = 1, 32 do
                if sample.ut.timer[id] ~= 4 then
                        sample.ut.timer[id] = sample.ut.timer[id] + 1
                end
        end
end

addhook("startround","sample.ut.startround")
function sample.ut.startround()
        parse("sv_sound \"fun/prepare.wav\"")
        sample.ut.fblood=0
end

addhook("kill","sample.ut.kill")
function sample.ut.kill(killer,victim,weapon)
        -- Was last kill more than 3 secs ago?
        if sample.ut.timer[killer])>3 then
                -- Yes, more than 3 secs ago! Reset level!
                sample.ut.level[killer]=0;
        end
        -- Get level of player and increase it
        level=sample.ut.level[killer]
        level=level+1
        sample.ut.level[killer]=level
        -- Reset the timer (last kill happened now!)
        sample.ut.timer[killer]=0
        -- FIRST BLOOD?
        if (sample.ut.fblood==0) then
                sample.ut.fblood=1
                parse("sv_sound \"fun/firstblood.wav\"");
                msg (player(killer,"name").." sheds FIRST BLOOD by killing "..player(victim,"name").."!")
        end
        -- HUMILIATION? (KNIFEKILL)
        if (weapon==50) then
                -- HUMILIATION!
                parse("sv_sound \"fun/humiliation.wav\"");
                msg (player(killer,"name").." humiliated "..player(victim,"name").."!")
        else
                -- REGULAR KILL
                if (level==1) then
                        -- 1: Single Kill! Nothing Special!
                elseif (level==2) then
                        -- 2: Doublekill
                        parse("sv_sound \"fun/doublekill.wav\"");
                        msg (player(killer,"name").." made a Doublekill!")
                elseif (level==3) then
                        -- 3: Multikill
                        parse("sv_sound \"fun/multikill.wav\"")
                        msg (player(killer,"name").." made a Multikill!")
                elseif (level==4) then
                        -- 4: Ultrakill
                        parse("sv_sound \"fun/ultrakill.wav\"")
                        msg (player(killer,"name").." made an ULTRAKILL!")
                elseif (level==5) then
                        -- 5: Monsterkill
                        parse("sv_sound \"fun/monsterkill.wav\"")
                        msg (player(killer,"name").." made a MO-O-O-O-ONSTERKILL-ILL-ILL!")
                else
                        -- >5: Unstoppable
                        parse("sv_sound \"fun/unstoppable.wav\"")
                        msg (player(killer,"name").." is UNSTOPPABLE! "..level.." KILLS!")
                end
        end
end

UTSFX Linux Fix for os.clock

This script allows you to use UTSFX properly in your linux server. 
Since os.clock works on Linux much different than it does on Windows,so i used second hook instead of it.
Sign up to access this!

No comments yet

Embed

Share banner
Image URL
HTML embed code
BB embed code
Markdown embed code

Credits

Key Authors
DC
DC Joined 16y ago
Offline
103 points Ranked 70191st
7 medals 1 legendary 1 rare
  • 10 years a member Medal icon
  • 6 years a member Medal icon
  • One month a member Medal icon
  • 6 months a member Medal icon
  • 1 year a member Medal icon
  • 2 years a member Medal icon
Fixed by
BcY07
BcY07 Joined 8y ago
CS2D Manager
Offline
428 points Ranked 47677th
9 medals 2 rare
  • 6 years a member Medal icon
  • Achieved Game Manager clearance Medal icon
  • One month a member Medal icon
  • 6 months a member Medal icon
  • 1 year a member Medal icon
  • 2 years a member Medal icon

Submitter

BcY07 avatar
BcY07 Joined 8y ago
CS2D Manager
I'm away.
428 points Ranked 47677th
9 medals 2 rare
  • 6 years a member Medal icon
  • Achieved Game Manager clearance Medal icon
  • One month a member Medal icon
  • 6 months a member Medal icon
  • 1 year a member Medal icon
  • 2 years a member Medal icon
BcY07
Creator
Sign up to access this!
Sign up to access this!
Sign up to access this!

Game

Sign up to access this!

Category

License

Share

  • Share on Reddit
  • Share on Twitter
  • Share on Facebook
  • 0
  • 139
  • 1mo

More from Submitter

More Lua Scripts Scripts