View Single Post
Dr. McKay
Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
Join Date: Aug 2011
Location: Atlantis
Old 02-26-2013 , 19:40   Re: [TF2] Unassigned Player Kicker (v1.1)
Reply With Quote #3

Some issues:

On line 58, you create a (default) 10-minute timer and pass a client index as the timer's parameter. When using timers or asynchronous callbacks, you need to pass the client's user ID (GetClientUserId) or serial (GetClientSerial), and use GetClientOfUserId or GetClientFromSerial to get a client index out of it. By passing a client index, if the client disconnects before the timer elapses, someone else might take their slot and be improperly kicked.

Your else statement on line 83 is pointless.

Your IsValidTeam stock is unnecessarily complex. You can just check if the client's team == 0 and return false. Or, for minimum lines of code:

PHP Code:
bool:IsValidTeam(client) {
    return (
GetClientTeam(client) != 0);

__________________
Dr. McKay is offline