View Single Post
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