|
2 | 2 | #pragma newdecls required |
3 | 3 |
|
4 | 4 | #include <sourcemod> |
5 | | -#include <sdktools> |
6 | | - |
7 | | -#define GAMEDATA_FILE "staggersolver" |
8 | | -#define SIGNATURE_NAME "IsStaggering" |
| 5 | +#include <left4dhooks> |
9 | 6 |
|
10 | 7 | public Plugin myinfo = |
11 | 8 | { |
12 | 9 | name = "Super Stagger Solver", |
13 | | - author = "CanadaRox, A1m (fix)", |
| 10 | + author = "CanadaRox, A1m (fix), Sir (rework)", |
14 | 11 | description = "Blocks all button presses during stumbles", |
15 | | - version = "1.1", |
| 12 | + version = "1.2", |
16 | 13 | }; |
17 | 14 |
|
18 | | -Handle g_hIsStaggering; |
19 | | - |
20 | | -public void OnPluginStart() |
21 | | -{ |
22 | | - Handle g_hGameConf = LoadGameConfigFile(GAMEDATA_FILE); |
23 | | - if (g_hGameConf == INVALID_HANDLE) { |
24 | | - SetFailState("[Stagger Solver] Could not load game config file '%s'.", GAMEDATA_FILE); |
25 | | - } |
26 | | - |
27 | | - StartPrepSDKCall(SDKCall_Player); |
28 | | - |
29 | | - if (!PrepSDKCall_SetFromConf(g_hGameConf, SDKConf_Signature, SIGNATURE_NAME)) { |
30 | | - SetFailState("[Stagger Solver] Could not find signature '%s' in gamedata.", SIGNATURE_NAME); |
31 | | - } |
32 | | - |
33 | | - PrepSDKCall_SetReturnInfo(SDKType_PlainOldData, SDKPass_Plain); |
34 | | - g_hIsStaggering = EndPrepSDKCall(); |
35 | | - |
36 | | - if (g_hIsStaggering == INVALID_HANDLE) { |
37 | | - SetFailState("[Stagger Solver] Failed to load signature '%s'", SIGNATURE_NAME); |
38 | | - } |
39 | | - |
40 | | - delete g_hGameConf; |
41 | | -} |
42 | | - |
43 | 15 | public Action OnPlayerRunCmd(int client, int &buttons) |
44 | 16 | { |
45 | | - if (IsClientInGame(client) && IsPlayerAlive(client) && SDKCall(g_hIsStaggering, client)) { |
| 17 | + if (IsClientInGame(client) |
| 18 | + && IsPlayerAlive(client) |
| 19 | + && L4D_IsPlayerStaggering(client)) |
| 20 | + { |
46 | 21 | /* |
47 | | - * if you shoved the infected player with the butt while moving on the ladder, |
48 | | - * he will not be able to move until he is killed |
| 22 | + * If you shove an SI that's on the ladder, the player won't be able to move at all until killed. |
| 23 | + * This is why we only apply this method when the SI is not on a ladder. |
49 | 24 | */ |
50 | 25 | if (GetEntityMoveType(client) != MOVETYPE_LADDER) { |
51 | 26 | buttons = 0; |
|
0 commit comments