SHOW:
|
|
- or go back to the newest paste.
1 | - | #pragma semicolon 1 |
1 | + | function AddPanel() |
2 | - | |
2 | + | |
3 | - | #include <sourcemod> |
3 | + | nDepthOffset++; |
4 | - | |
4 | + | var _loc2_ = Panel.Notice.DeathText1.attachMovie("death-text","NoticePanel" + nDepthOffset,this.getNextHighestDepth() + nDepthOffset); |
5 | - | // Global Definitions |
5 | + | _loc2_._visible = false; |
6 | - | #define PLUGIN_VERSION "1.0.0" |
6 | + | return _loc2_; |
7 | - | |
7 | + | |
8 | - | // Functions |
8 | + | function SetPanelText(notice, text, isVictim, isKiller) |
9 | - | public Plugin:myinfo = |
9 | + | |
10 | notice._visible = false; | |
11 | - | name = "Name", |
11 | + | notice._y = 0; |
12 | - | author = "Author", |
12 | + | notice.TextPanel.Text.htmlText = text; |
13 | - | description = "Description", |
13 | + | notice.PanelAttacker._visible = isKiller; |
14 | - | version = PLUGIN_VERSION, |
14 | + | notice.PanelVictim._visible = isVictim; |
15 | - | url = "http://forums.alliedmods.net" |
15 | + | notice.IDTextBG._visible = !isKiller; |
16 | - | }; |
16 | + | return notice._height; |
17 | - | |
17 | + | |
18 | - | public OnPluginStart() |
18 | + | function RemovePanel(movieClip) |
19 | { | |
20 | - | CreateConVar("sm_name_version", PLUGIN_VERSION, "Name Version", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY); |
20 | + | Panel.Notice.DeathText1[movieClip._name].removeMovieClip(); |
21 | - | |
21 | + | |
22 | - | HookEvent ( "player_death", DeathPre, EventHookMode_Pre ); |
22 | + | function UpdateWidth(movieClip) |
23 | { | |
24 | - | |
24 | + | movieClip.PanelAttacker.KillerHighlight._width = movieClip.TextPanel.Text.textWidth + 20; |
25 | - | public Action: DeathPre ( Handle: event, const String: name [ ], bool: dontBroadcast ) { |
25 | + | movieClip.PanelAttacker.KillerHighlight._x = movieClip.TextPanel._x + (movieClip.TextPanel._width - movieClip.PanelAttacker.KillerHighlight._width) + 10; |
26 | - | |
26 | + | movieClip.PanelVictim.VictimHighlight._width = movieClip.PanelAttacker.KillerHighlight._width; |
27 | - | new killer = GetClientOfUserId ( GetEventInt ( event, "attacker" ) ); |
27 | + | movieClip.PanelVictim.VictimHighlight._x = movieClip.PanelAttacker.KillerHighlight._x; |
28 | - | |
28 | + | movieClip.IDTextBG._width = movieClip.PanelVictim.VictimHighlight._width + 15; |
29 | - | FadeScreen ( killer, 1000, 100, 0x0009, { 121, 255, 77, 80 } ); |
29 | + | movieClip.IDTextBG._x = 15; |
30 | - | |
30 | + | |
31 | - | return Plugin_Handled; |
31 | + | function onLoaded() |
32 | - | |
32 | + | |
33 | nScaledHeight = Panel.Notice.DeathText1._height * _global.resizeManager.ScalingFactors[Lib.ResizeManager.SCALE_BIGGEST] * _global.GameInterface.GetConvarNumber("hud_scaling"); | |
34 | - | |
34 | + | nDepthOffset = 0; |
35 | - | |
35 | + | gameAPI.SetConfig(nNumberOfNotices * Panel.StatusPanel.Notice._height,nScrollInTime,nFadeOutTime,nNoticeLifetime,strCTColor,strTColor,nLocalPlayerLifetimeMod); |
36 | - | stock FadeScreen (clientIndex, duration=1000, hold=300, flags=0x0009, color[4]={0, 0, 0, 255}) { |
36 | + | gameAPI.OnReady(); |
37 | - | |
37 | + | Panel.Notice.DeathText1.PanelAttacker._visible = false; |
38 | - | new Handle:message = StartMessageOne("Fade", clientIndex, USERMSG_RELIABLE); |
38 | + | Panel.Notice.DeathText1.PanelVictim._visible = false; |
39 | - | PbSetInt(message, "duration", duration); |
39 | + | Panel.Notice.DeathText1.IDTextBG._visible = false; |
40 | - | PbSetInt(message, "hold_time", hold); |
40 | + | |
41 | - | PbSetInt(message, "flags", flags); |
41 | + | function onUnload(mc) |
42 | - | PbSetColor(message, "clr", color); |
42 | + | |
43 | - | EndMessage(); |
43 | + | _global.DeathNotificationMovie = null; |
44 | - | } |
44 | + | _global.resizeManager.RemoveListener(this); |
45 | return true; | |
46 | } | |
47 | function onResize(rm) | |
48 | { | |
49 | rm.ResetPositionByPixel(Panel,Lib.ResizeManager.SCALE_BIGGEST,Lib.ResizeManager.REFERENCE_SAFE_RIGHT,-10,Lib.ResizeManager.ALIGN_LEFT,Lib.ResizeManager.REFERENCE_SAFE_TOP,25,Lib.ResizeManager.ALIGN_TOP); | |
50 | } | |
51 | _global.DeathNotificationMovie = this; | |
52 | var nNumberOfNotices = 7; | |
53 | var nScrollInTime = 0.01; | |
54 | var nFadeOutTime = 1; | |
55 | var nNoticeLifetime = 5; | |
56 | var strCTColor = "#6f9ce6"; | |
57 | var strTColor = "#eabe54"; | |
58 | var nLocalPlayerLifetimeMod = 1.5; | |
59 | var nDepthOffset; | |
60 | _global.resizeManager.AddListener(this); | |
61 | stop(); |