View Single Post
StrikerM
Member
Join Date: Nov 2019
Old 04-04-2021 , 13:37   Re: Unban without message ?
Reply With Quote #9

Quote:
Originally Posted by jimaway View Post
add SQL_NextRow to the for loop. i edited my last post
Everything works fine, you are amazing thanks.

Now i got a new problem creating the unban cmd, if i try to unban any steam id if the data base is cleared it say's 'that steamid dosen't exist in our data base' but if i want to unban a wrong steamid when i have a player banned it unbans that guy, lol.

Code:
public cmd_unban(id)
{
	new TargetSteamID[25];
	read_argv(1, TargetSteamID, sizeof(TargetSteamID)-1);

	Data[0] = id;
	new string[25];
	format(string, charsmax(string), "SELECT * FROM `bans` WHERE `SteamID` = '%s'", TargetSteamID), SQL_ThreadQuery(Handler, "UnbanCMD", string, Data, 3);
	return PLUGIN_HANDLED;
}

public UnbanCMD(FailState, Handle:Query, Error[], Errcode, Data[], DataSize)
{
	new pName[32], SteamID[25], sqlid, id = Data[0];
	if(SQL_NumResults(Query) > 0)
	{
		sqlid = SQL_ReadResult(Query, 0), SQL_ReadResult(Query, 1, pName[id], 32), SQL_ReadResult(Query, 3, SteamID[id], 24);
		SCM(0, GREEN, "%s You unbaned %s - SQLID: %d - Steamid: %s.", TAG, pName[id], sqlid, SteamID[id]);

		new string[55];
		format(string, charsmax(string), "DELETE FROM `bans` WHERE `SteamID` = '%s' AND `ID` = '%d'", SteamID[id], sqlid), SQL_ThreadQuery(Handler, "IgnoreHandle", string);
	}
	else SCM(0, GREEN, "%s That steamid dosen't exist in our data base.", TAG);
	return PLUGIN_HANDLED;
}

Last edited by StrikerM; 04-04-2021 at 13:54.
StrikerM is offline