I have written this inspired script for CS2D and I have done this halfway but I have a trouble about 1vs1 scripting and better last player check.
I have done:
When the last player in team is alive before their will win the round, message "*Player* is the one and only" (red text if T, blue text if CT) will public shown, only last team player will heard "The one and only" sound.
Problems:
I have done 1 vs 1 scripting, when this round have 1 T and 1 CT alive, message will shown ID players instead player names and also message spam in console for 32 lines.
When the last player in team is alive, I have scripting problem about counting opposite team players.
Example I want:
When the last player is alive in team, the script will count all opposite team players alive, only last player in team will heard "The one and only" sound.
When all teammates are killed but only 1 T and 1 CT, will display message (and sound).
Quote
*Player* vs 7 CTs: All your teammates were killed. Good luck!
*Player* vs *Player2*
*Player* vs *Player2*
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
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
addhook("die","ferb.lastmancheckt") addhook("die","ferb.lastmancheckct") addhook("die","ferb.pvpcheck") addhook("endround","ferb.lastmanstanding") function ferb.lastmancheckt() if lastman==false and #player(0,"team1living")==1 then for id=1,32 do if player(id,"team")==1 and player(id,"health")>0 then msg("ฉ255040040"..player(id,"name").." is the one and only@C") parse("sv_sound2 "..id.." \"Random Sounds From Ferb Fletcher/oneandonly.ogg\"") lastman=true end end end end function ferb.lastmancheckct() if lastman==false and #player(0,"team2living")==1 then for id=1,32 do if player(id,"team")==2 and player(id,"health")>0 then msg("ฉ040040255"..player(id,"name").." is the one and only@C") parse("sv_sound2 "..id.." \"Random Sounds From Ferb Fletcher/oneandonly.ogg\"") lastman=true end end end end function ferb.pvpcheck() if #player(0,"team1living")==1 and #player(0,"team2living")==1 then for id=1,32 do msg("ฉ240240240"..player(0,"team1living")[1].." vs. "..player(0,"team2living")[1].."@C") pvpcheck=true end end end function ferb.lastmanstanding() lastman=false pvpcheck=false end