15.02.2013, 20:43
I got an anti weapon hacks that bans:
It sets pBanned to 1, and updated `bans` table.
how do I check when the player connects if he is banned?
Код:
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; }
how do I check when the player connects if he is banned?