View Single Post
potatoz
AlliedModders Donor
Join Date: Nov 2016
Old 08-18-2018 , 20:03   Re: [CS:GO] Help with keyvalue-based ctban plugin
Reply With Quote #17

Quote:
Originally Posted by Crasher_3637 View Post
One thing that I've noticed is that you keep passing the client as the data through your timers. Maybe that's why you're having clients who get other clients' bans.

You need to pass GetClientUserId(client) instead since User IDs are unique to each client. If you're only passing "client" then you could have instances where 1 player leaves and is immediately replaced by another, thus getting the ban duration of the one that just left.

Example:

PHP Code:
CreateTimer(1.0tTimerCallbackGetClientUserId(client), TIMER_FLAG_NO_MAPCHANGE);

public 
Action tTimerCallback(Handle timerany userid)
{
     
int client GetClientOfUserId(userid);
     
// Start adding your code here...

Aside from the SQL plugin i will def make a update to the keyvalue one and just drop both of the .sp-files here for anyone in future need. I'll take your post in to consideration when updating the keyvalue-based plugin for sure, first thing i'll do in the morning!
__________________
potatoz is offline