View Single Post
404UserNotFound
BANNED
Join Date: Dec 2011
Old 02-26-2013 , 21:51   Re: [TF2] Unassigned Player Kicker (v1.1)
Reply With Quote #5

Quote:
Originally Posted by Dr. McKay View Post
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);

Thank you very much for this info, I'm currently using the current iteration of this plugin on my server, so I guess I'll have to remove it for the time being and fix it up.

I've fixed the latter two issues, but the first one is a tad confusing for me. How exactly am I meant to implement GetClientOfUserId or GetClientFromSerial?

Last edited by 404UserNotFound; 02-26-2013 at 21:54.
404UserNotFound is offline