Raised This Month: $32 Target: $400
 8% 

[L4D2] Auto Hold key when ProgressBar running


Post New Thread Reply   
 
Thread Tools Display Modes
Author
hoangzp
Junior Member
Join Date: Sep 2017
Plugin ID:
7946
Plugin Version:
1.4
Plugin Category:
General Purpose
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Plugin will help the player holding the key when kit defib revive..., then they can chat or do something
    Old 02-03-2022 , 04:56   [L4D2] Auto Hold key when ProgressBar running
    Reply With Quote #1

    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.
    Attached Files
    File Type: sp Get Plugin or Get Source (Hzp_Lastkeyprocessholder.sp - 241 views - 4.7 KB)

    Last edited by hoangzp; 05-08-2022 at 00:28. Reason: Fix hold shove action when heal by teammate
    hoangzp is offline
    Silvers
    SourceMod Plugin Approver
    Join Date: Aug 2010
    Location: SpaceX
    Old 02-03-2022 , 05:08   Re: [L4d2] Hold key when ProgressBar running
    Reply With Quote #2

    - 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.
    __________________

    Last edited by Silvers; 02-03-2022 at 05:12.
    Silvers is offline
    hoangzp
    Junior Member
    Join Date: Sep 2017
    Old 02-03-2022 , 05:29   Re: [L4d2] Hold key when ProgressBar running
    Reply With Quote #3

    Quote:
    Originally Posted by Silvers View Post
    - 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.
    hoangzp is offline
    L4D2Noob
    AlliedModders Donor
    Join Date: Mar 2020
    Location: Moscow
    Old 02-03-2022 , 17:32   Re: [L4d2] Auto Hold key when ProgressBar running
    Reply With Quote #4

    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 is offline
    Send a message via ICQ to L4D2Noob Send a message via Skype™ to L4D2Noob
    L4D2Noob
    AlliedModders Donor
    Join Date: Mar 2020
    Location: Moscow
    Old 02-03-2022 , 17:56   Re: [L4d2] Auto Hold key when ProgressBar running
    Reply With Quote #5

    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.
    __________________
    L4D2Noob is offline
    Send a message via ICQ to L4D2Noob Send a message via Skype™ to L4D2Noob
    hoangzp
    Junior Member
    Join Date: Sep 2017
    Old 02-03-2022 , 20:25   Re: [L4d2] Auto Hold key when ProgressBar running
    Reply With Quote #6

    Quote:
    Originally Posted by L4D2Noob View Post
    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

    Last edited by hoangzp; 02-03-2022 at 21:27.
    hoangzp is offline
    L4D2Noob
    AlliedModders Donor
    Join Date: Mar 2020
    Location: Moscow
    Old 02-04-2022 , 03:27   Re: [L4d2] Auto Hold key when ProgressBar running
    Reply With Quote #7

    Quote:
    Originally Posted by hoangzp View Post
    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.
    __________________
    L4D2Noob is offline
    Send a message via ICQ to L4D2Noob Send a message via Skype™ to L4D2Noob
    hoangzp
    Junior Member
    Join Date: Sep 2017
    Old 02-04-2022 , 04:00   Re: [L4D2] Auto Hold key when ProgressBar running
    Reply With Quote #8

    Quote:
    Originally Posted by L4D2Noob View Post
    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.

    Last edited by hoangzp; 02-11-2022 at 08:51.
    hoangzp is offline
    Reply


    Thread Tools
    Display Modes

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 01:24.


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