MySQL Offline Ban
#1

ISSUE: The command sends successfully, but the target in question does not get banned. How can I fix this, and why does this not work?

I am new to MySQL in sa-mp.

Код:
new query[65], tempip[16];

	mysql_format(gSQL, query, sizeof query, "SELECT * FROM `Users` WHERE `Name` = '%e'", target);
	if(mysql_tquery(gSQL, query, "OnAccountExist", "i", playerid))
	{
		cache_get_value_name(0, "LastIP", tempip, 16);
		new str[144], expiretime = (gettime() + (((time * 24) * 60) * 60));
		if(time > 0) format(str, sizeof str, "* %s %s has offline banned %s for \"%s\" till %s.", gStaff[pInfo[playerid][AdminLvl]], pName[playerid], target, reason, ReturnDate(expiretime));
		else format(str, sizeof str, "* %s %s has permanently offline banned %s for \"%s\".", gStaff[pInfo[playerid][AdminLvl]], pName[playerid], target, reason);
		SendClientMessageToAll(COLOR_PINK, str);
		mysql_format(gSQL, query, sizeof query, "INSERT INTO `Bans` (`ExpireDate`, `IP`, `Name`, `Reason`, `BanBy`) VALUES (%d, '%e', '%e', '%e', '%e')", expiretime, tempip, target, reason, pName[playerid]);
		mysql_tquery(gSQL, query);
	}
	else
	{
		SendClientMessage(playerid, COLOR_RED, "ERROR: "COL_GREY"That account doesn't exist.");	
	}
Reply


Messages In This Thread
MySQL Offline Ban - by Aerotactics - 03.08.2018, 19:35
Re: MySQL Offline Ban - by DBZdabIt3Bro7 - 03.08.2018, 20:01
Re: MySQL Offline Ban - by Calisthenics - 03.08.2018, 20:21
Re: MySQL Offline Ban - by Aerotactics - 04.08.2018, 18:39
Re: MySQL Offline Ban - by silvan - 04.08.2018, 20:33
Re: MySQL Offline Ban - by Banditul18 - 04.08.2018, 21:39
Re: MySQL Offline Ban - by GTLS - 05.08.2018, 16:01
Re: MySQL Offline Ban - by Kane - 05.08.2018, 16:33

Forum Jump:


Users browsing this thread: 2 Guest(s)