9
9
10
10
# define PLUGIN " Unreal Demo Plugin"
11
11
# define AUTHOR " karaulov"
12
- # define VERSION " 1.62 "
12
+ # define VERSION " 1.63 "
13
13
14
14
// IF NEED REDUCE TRAFFIC USAGE UNCOMMENT THIS LINE
15
15
// ЕСЛИ НЕОБХОДИМО БОЛЬШЕ ДЕТЕКТОВ (НО ТАК ЖЕ БОЛЬШЕ ТРАФИКА) ЗАКОММЕНТИРУЙТЕ ЭТУ СТРОКУ
16
16
# define SMALL_TRAFFIC
17
17
18
18
new g_iDemoHelperInitStage[33 ] = {0 ,...};
19
19
new g_iFrameNum[33 ] = {0 ,...};
20
+ new g_iJumpCount[33 ] = {0 ,...};
20
21
new g_bNeedResend[33 ] = {false ,...};
21
22
22
23
new Float: g_flLastEventTime[33 ] = {0 .0 ,...};
@@ -32,7 +33,12 @@ public plugin_init()
32
33
{
33
34
register_plugin (PLUGIN, VERSION, AUTHOR);
34
35
register_cvar (" unreal_demoplug" , VERSION, FCVAR_SERVER | FCVAR_SPONLY | FCVAR_UNLOGGED);
35
- register_clcmd (" fullupdate" , " UnrealDemoHelpInitialize" );
36
+
37
+ #if REAPI_VERSION < 524309
38
+ RegisterHookChain (RH_SV_AllowPhysent, " UnrealDemoHelpInitialize" );
39
+ #else
40
+ RegisterHookChain (RH_ExecuteServerStringCmd, " UnrealDemoHelpInitialize" );
41
+ #endif
36
42
37
43
RegisterHookChain (RG_PM_Move, " PM_Move" , .post = false );
38
44
RegisterHookChain (RG_CBasePlayer_Jump, " HC_CBasePlayer_Jump_Pre" , .post = false );
@@ -61,6 +67,7 @@ public client_disconnected(id)
61
67
g_flLastSendTime[id] = - 1 .0 ;
62
68
g_flStartCmdTime[id] = - 1 .0 ;
63
69
g_iFrameNum[id] = 0 ;
70
+ g_iJumpCount[id] = 0 ;
64
71
g_iDemoHelperInitStage[id] = 0 ;
65
72
g_flDelay1Msec[id] = - 1 .0 ;
66
73
g_flDelay2Time[id] = - 1 .0 ;
@@ -92,11 +99,6 @@ public HC_CBasePlayer_Jump_Pre(id)
92
99
{
93
100
new iFlags = get_entvar (id,var_flags);
94
101
95
- if (g_iDemoHelperInitStage[id] != - 1 )
96
- {
97
- return HC_CONTINUE;
98
- }
99
-
100
102
if (iFlags & FL_WATERJUMP)
101
103
{
102
104
return HC_CONTINUE;
@@ -123,9 +125,11 @@ public HC_CBasePlayer_Jump_Pre(id)
123
125
}
124
126
125
127
if (get_entvar (id, var_oldbuttons) & IN_JUMP || get_entvar (id, var_button) & IN_JUMP)
126
- WriteDemoInfo (id, " UDS/JMP/2" );
128
+ WriteDemoInfo (id, " UDS/JMP/2/ %i " , g_iJumpCount[id] );
127
129
else
128
- WriteDemoInfo (id, " UDS/JMP/1" );
130
+ WriteDemoInfo (id, " UDS/JMP/1/%i " , g_iJumpCount[id]);
131
+
132
+ g_iJumpCount[id]++ ;
129
133
130
134
return HC_CONTINUE;
131
135
}
@@ -180,25 +184,30 @@ public PM_Move(const id)
180
184
return HC_CONTINUE;
181
185
}
182
186
183
- public UnrealDemoHelpInitialize (id)
187
+ public UnrealDemoHelpInitialize (const cmd[], source, id)
184
188
{
185
- if (is_user_connected (id) )
189
+ if (id > 0 && id <= MaxClients )
186
190
{
187
- if (task_exists (id))
188
- {
189
- g_bNeedResend[id] = true ;
190
- }
191
- else
191
+ new fullcmd[256 ];
192
+ read_argv (0 , fullcmd, charsmax (fullcmd));
193
+ if (equal (fullcmd," fullupdate" ))
192
194
{
193
- g_flLastEventTime[id] = 0 .0 ;
194
- g_flLastSendTime[id] = 0 .0 ;
195
- g_iFrameNum[id] = 0 ;
196
- g_iDemoHelperInitStage[id] = 0 ;
197
-
198
- remove_task (id);
199
- if (! is_user_hltv (id) && ! is_user_bot (id))
195
+ if (task_exists (id))
196
+ {
197
+ g_bNeedResend[id] = true ;
198
+ }
199
+ else
200
200
{
201
- set_task (1 .25 ," DemoHelperInitializeTask" ,id);
201
+ g_flLastEventTime[id] = 0 .0 ;
202
+ g_flLastSendTime[id] = 0 .0 ;
203
+ g_iFrameNum[id] = 0 ;
204
+ g_iDemoHelperInitStage[id] = 0 ;
205
+
206
+ remove_task (id);
207
+ if (! is_user_hltv (id) && ! is_user_bot (id))
208
+ {
209
+ set_task (1 .25 ," DemoHelperInitializeTask" ,id);
210
+ }
202
211
}
203
212
}
204
213
}
0 commit comments