Quote:
Originally Posted by Dr. McKay
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?