Raised This Month: $51 Target: $400
 12% 

Problem with the mysql ban scripting


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Stefanx
Member
Join Date: Feb 2018
Location: Romania
Old 12-14-2019 , 07:43   Problem with the mysql ban scripting
Reply With Quote #1

Hi, i use ban mysql threaded plugin and when i ban a player show this: https://prnt.sc/qaqorq and him reconnect show like this https://prnt.sc/qaqpe7
this is the database https://prnt.sc/qaqrp7

Can you help me to show like in first photo when him reconnect to the server

Code:
public T_AuthCheck(Handle:owner, Handle:hndl, const String:error[], any:data) {
	new client;
 	decl ban_length;	
	decl String:steam_id[32];
	decl String:steam_id_admin[32];
 	decl String:ban_reason[100];
 	decl String:banned_by[100];	
 	decl String:date[32];
 	decl ban_remaining;
 	decl String:source[65];
	decl String:query[255];
		
	if ((client = GetClientOfUserId(data)) == 0) {
		return;
	}
	
	GetClientAuthId(client, AuthId_Engine, steam_id, 32);
	//GetClientName(admin, source, sizeof(source));

	new buffer_len = strlen(steam_id) * 2 + 1
	new String:v_steam_id[buffer_len]
	SQL_EscapeString(hDatabase, steam_id, v_steam_id, buffer_len)
	 
	if (hndl == INVALID_HANDLE) {
		LogError("[MYBans] Query failed! %s", error);
		KickClient(client, "Error: Reattempt connection");
	}
	
	FormatTime(date, sizeof(date), "%R - %D ");

	
	if(SQL_FetchRow(hndl)) {
	
		
		ban_length = SQL_FetchInt(hndl,0);
		SQL_FetchString(hndl,1,ban_reason,sizeof(ban_reason));
	
		if (ban_length == 0) 
		{
			KickClient(client,"Ai Primit ban\nDurata Ban: Permanent\nMotiv: %s\nNume Admin: %s\nSteamID Admin: %s\nSteamID-ul tau: %s\nData si ora: %s\n StefanX1 on Steam", ban_reason, banned_by, steam_id_admin, steam_id, date);
			return;
		}

		ban_remaining = SQL_FetchInt(hndl,2);
	

		if (ban_remaining <= ban_length) 
		{

			KickClient(client,"Ai Primit ban\nDurata Ban: %d\nMotiv: %s\nNume Admin: %s\nSteamID Admin: %s\nSteamID-ul tau: %s\nData si ora: %s\n StefanX1 on Steam", ban_remaining, ban_reason, banned_by, steam_id_admin, steam_id, date);
		
		} else {

			Format(query, sizeof(query), "DELETE FROM my_bans WHERE steam_id='%s'", v_steam_id);
			SQL_TQuery(hDatabase, T_MYUnBan, query);
			LogMessage("[MYBans] User %s has been unbanned by elapse of time.", v_steam_id);
		}

	}
}
Stefanx is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:41.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode