AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [L4D2] Auto Hold key when ProgressBar running (https://forums.alliedmods.net/showthread.php?t=336193)

hoangzp 02-03-2022 04:56

[L4D2] Auto Hold key when ProgressBar running
 
7 Attachment(s)
The plugin help play hold the key when do something active Process bar, dont need to hold to the end.
You can release this action by press any move button.

Silvers 02-03-2022 05:08

Re: [L4d2] Hold key when ProgressBar running
 
- SMX not required. Delete.
- "bool CanPlayerswitchkey[MAXPLAYERS+1] = true;" is the wrong way to do this.. instead you would write " = { true, ... };" to fill every array index. Then you can delete the stuff in "OnPluginStart" since that's just a duplicate.
- Same thing: "Handle Timerkey[MAXPLAYERS + 1] = INVALID_HANDLE;" you don't need to do this, it's already set to "null" aka "INVALID_HANDLE".
- You should check "holderkey[client] != 0" and the other simple checks regards to "buttons == X" first before the other stuff in that if statement, like you check != 0 in the else statement.
- Your "IsClientIncapacitated" has duplicated "client > 0 && client <= MaxClients".
- Your timers should push through the clients UserID instead of client index, and validate within the timer callback by getting the client index from UserID.
- Instead of the following, you can just use "delete Timerkey[client]" which does the same thing:
PHP Code:

    KillTimer(Timerkey[client]);
    
Timerkey[client] = INVALID_HANDLE

Otherwise nice idea, thanks.

hoangzp 02-03-2022 05:29

Re: [L4d2] Hold key when ProgressBar running
 
Quote:

Originally Posted by Silvers (Post 2770379)
- SMX not required. Delete.
- "bool CanPlayerswitchkey[MAXPLAYERS+1] = true;" is the wrong way to do this.. instead you would write " = { true, ... };" to fill every array index. Then you can delete the stuff in "OnPluginStart" since that's just a duplicate.
- Same thing: "Handle Timerkey[MAXPLAYERS + 1] = INVALID_HANDLE;" you don't need to do this, it's already set to "null" aka "INVALID_HANDLE".
- You should check "holderkey[client] != 0" and the other simple checks regards to "buttons == X" first before the other stuff in that if statement, like you check != 0 in the else statement.
- Your "IsClientIncapacitated" has duplicated "client > 0 && client <= MaxClients".
- Your timers should push through the clients UserID instead of client index, and validate within the timer callback by getting the client index from UserID.
- Instead of the following, you can just use "delete Timerkey[client]" which does the same thing:
PHP Code:

    KillTimer(Timerkey[client]);
    
Timerkey[client] = INVALID_HANDLE

Otherwise nice idea, thanks.

Tks for your support, i am beginning at zero coder, then maybe need sometime.

L4D2Noob 02-03-2022 17:32

Re: [L4d2] Auto Hold key when ProgressBar running
 
I have an assumption that it is precisely because of this plugin that when I press the Tab button to open the Tab Board, I have automatic shooting without pressing the left mouse button.

https://www.youtube.com/watch?v=CbRU...=RYANCOOLROUND

In simple words, I press Tab, my machine gun shoots (And in some moments there is no sound).

I hope I'm wrong and it's just a coincidence. But the problem began to notice just after installing the plugin.

L4D2Noob 02-03-2022 17:56

Re: [L4d2] Auto Hold key when ProgressBar running
 
Yes, it's definitely because of this plugin. While using the plugin, you will encounter the following problem with holding the Tab and Ctrl keys.

https://www.youtube.com/watch?v=URSB...=RYANCOOLROUND

Once I uninstalled the plugin everything worked fine.

hoangzp 02-03-2022 20:25

Re: [L4d2] Auto Hold key when ProgressBar running
 
Quote:

Originally Posted by L4D2Noob (Post 2770458)
Yes, it's definitely because of this plugin. While using the plugin, you will encounter the following problem with holding the Tab and Ctrl keys.

https://www.youtube.com/watch?v=URSB...=RYANCOOLROUND

Once I uninstalled the plugin everything worked fine.

i haven't that problem - here is my testting video i tried to hold tab and ctrl.But i updated the code,try to download again the plugin
https://youtu.be/20oH1Bu2Zk0

L4D2Noob 02-04-2022 03:27

Re: [L4d2] Auto Hold key when ProgressBar running
 
Quote:

Originally Posted by hoangzp (Post 2770467)
i haven't that problem - here is my testting video i tried to hold tab and ctrl.

It seems that the problem described above does not appear with this version. But again, I checked once. So you need to check again, and again. In general, you understand.
P.S.: At the same time, I also checked the first version of the plugin again to make sure that the problem from the video was due to the plugin. And yes, it was because of him.

hoangzp 02-04-2022 04:00

Re: [L4D2] Auto Hold key when ProgressBar running
 
Quote:

Originally Posted by L4D2Noob (Post 2770482)
It seems that the problem described above does not appear with this version. But again, I checked once. So you need to check again, and again. In general, you understand.
P.S.: At the same time, I also checked the first version of the plugin again to make sure that the problem from the video was due to the plugin. And yes, it was because of him.

Thanks, try to update the lastest version, and make the reply if you have any problem.


All times are GMT -4. The time now is 13:12.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.