-
-
Notifications
You must be signed in to change notification settings - Fork 464
Closed
Description
Help us help you
- I have checked that my issue doesn't exist yet. (not sure, i tried to find it but couldn't find it)
- I have tried my absolute best to reduce the problem-space and have provided the absolute smallest test-case possible.
- I can always reproduce the issue with the provided description below.
Environment
- Operating System version: Ubuntu 22.04.1
- Game/AppID (with version if applicable): Left 4 Dead 2 v2.2.2.6 / 550
- Current SourceMod version: 1.11.0.6919
- Current SourceMod snapshot: 1.11.0.6919
- Current Metamod: Source snapshot: 1.11.0-dev+1148
- I have updated SourceMod to the latest version and it still happens.
- I have updated SourceMod to the latest snapshot and it still happens.
- I have updated SourceMM to the latest snapshot and it still happens.
Description
When trying to prevent players to use entities with sdkhooks, SDKHook_Use doesn't prevent it when function return Plugin_Handled. But if we unload plugin and then load it again, plugin works fine (late load?).
Problematic Code (or Steps to Reproduce)
public void OnEntityCreated(int iEnt, const char[] szClsName) {
if (strcmp(szClsName, "prop_minigun") == 0 || strcmp(szClsName, "prop_minigun_l4d1") == 0 || strcmp(szClsName, "prop_mounted_machine_gun") == 0)
SDKHook(iEnt, SDKHook_Use, OnUseMinigun);
}
Action OnUseMinigun(int iEnt, int iActivator, int iCaller, UseType uType, float fValue) {
if (iCaller <= 0) return Plugin_Continue;
if (iCaller > MaxClients) return Plugin_Continue;
if (!IsClientInGame(iCaller)) return Plugin_Continue;
if (GetClientTeam(iCaller) != 2) return Plugin_Continue;
if (uType != Use_Toggle) return Plugin_Continue;
...
return Plugin_Handled; << it works but anyway it allows players to use entity
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels