Banning through MySQL and checking if player is banned
#1

I got an anti weapon hacks that bans:

Код:
public WeaponHackBan(playerid)
{
	new str[256], string[256], gName[256], query[256], IP[100];
	FreezePlayer(playerid, 1);
	GetWeaponName(GetPlayerWeapon(playerid),gName,sizeof(gName));
	GetPlayerIp(playerid, IP, sizeof(IP));
	format(str, sizeof(str), "AdmCmd: %s was banned by SYSTEM, reason: Weapon Hacks, Spawned %s.", GetName(playerid), gName);
	PlayerInfo[playerid][pBanned] = 1;
	format(string, sizeof(string), "<Weapon Hacks-Spawned %s>", gName);
	format(query, sizeof(query), "INSERT INTO `bans` (name, reason, playerIP) VALUES ('%s', '%s', '%s')", GetName(playerid),string,IP);
	mysql_function_query(dbHandle, query, true, "", "");
	KickWithMSG(playerid, str);
	return 1;
}
It sets pBanned to 1, and updated `bans` table.
how do I check when the player connects if he is banned?
Reply


Messages In This Thread
Banning through MySQL and checking if player is banned - by PaulDinam - 15.02.2013, 20:43
Re: Banning through MySQL and checking if player is banned - by [TC]XxJuggaloxX - 15.02.2013, 21:03
Re: Banning through MySQL and checking if player is banned - by PaulDinam - 15.02.2013, 21:45

Forum Jump:


Users browsing this thread: 2 Guest(s)