Raised This Month: $32 Target: $400
 8% 

Unban without message ?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
StrikerM
BANNED
Join Date: Nov 2019
Old 04-04-2021 , 09:25   Unban without message ?
Reply With Quote #1

Hello.

I created a ban system that unbans players after theyr time has past, everything is in database mysql.

But the only problem that i have is if in structure Player 1 is id 1 in db and has 5 minutes left and Player 2 is id 2 in db and has 1 minute left if his time will past the server wont give the message about Player 2 that got unbanned because he is id 2 in db and not 1, but when Player 1 is getting unbanned the server will give a message about him that got unbanned, and if i put them both in the same time to get unban server will show only 1 player got unbanned but in db they both got unbanned.

Bad english sorry, this is my script, don't judge me about the code, help if you can, thanks.

Code:
public UnbanSystem()
{
	new string[25];
	format(string, charsmax(string), "SELECT * FROM `bans`"), SQL_ThreadQuery(Handler, "UnbanContinue", string);
	return PLUGIN_HANDLED;
}
public UnbanContinue(FailState, Handle:Query, Error[], Errcode, Data[], DataSize)
{
	if(SQL_NumResults(Query) > 0)
	{
		new pName[32], UnbanTime[32];
		for(new i; i < 10; i++)
		{
			SQL_ReadResult(Query, 1, pName[i], 32), UnbanTime[i] = SQL_ReadResult(Query, 5);

			new string[55];
			format(string, charsmax(string), "DELETE FROM `bans` WHERE `UnbanTime` = '0'"), SQL_ThreadQuery(Handler, "IgnoreHandle", string);
			if(UnbanTime[i] == 0)
			{
				SCM(0, GREEN, "%s %s got unbanned.", TAG, pName[i]);
				return PLUGIN_HANDLED;
			}
		}
	}
	return PLUGIN_HANDLED;
}

Last edited by StrikerM; 04-04-2021 at 09:31.
StrikerM 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 02:46.


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