Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stock banCheck(playerid) {
- new ip_player[16], ip_int[4];
- GetPlayerIp(playerid, ip_player, 16);
- sscanf(ip_player, "p<.>a<d>[4]", ip_int);
- new buf[350];
- format(buf, sizeof(buf), "SELECT b.name, b.IP, b.type, UNIX_TIMESTAMP(b.time_end), DATE_FORMAT(b.time_end, '%%h:%%i, %%d.%%m.%%Yr'), b.time_created, p.nick, b.reason FROM ban b JOIN players p ON b.admin = p.id WHERE (b.name = '%s' OR b.IP = '%s' OR b.IP = '%d.%d.*.*') AND (b.time_end > NOW() OR b.time_end IS NULL) AND b.active = 1 LIMIT 1;", PlayerName(playerid), ip_player, ip_int[0], ip_int[1]);
- mysql_query(buf);
- mysql_store_result();
- if (!mysql_num_rows()) {
- mysql_free_result();
- return 0;
- }
- new nick_banned[MAX_PLAYER_NAME], ip_banned[16], type, time_to_end, date_to_end[20], date_created[20], adminName[MAX_PLAYER_NAME], reason[128];
- mysql_fetch_row(buf, "|");
- sscanf(buf, "p<|>s[24]s[16]dds[20]s[20]s[24]s[128]", nick_banned, ip_banned, type, time_to_end, date_to_end, date_created, adminName, reason);
- mysql_free_result();
- if (type) {
- // tutaj zapytanie do whitelist
- format( buf, sizeof( buf ), "{FF0000}Jesteś zbanowany/a.\n\n{FFE5A1}Typ bana:\t\t{AC3E00}Host (%d.%d.*.*)\n{AC3E00}Administator:\t\t{AC3E00}%s\n{EAB171}Data zbanowania:\t{AC3E00}%s\n{EAB171}Powód:\t\t{AC3E00}%s\n{EAB171}IP:\t\t\t{AC3E00}%s\n\n{EAB171}Jeśli chcesz zostać odbanowany napisz wniosek na forum: P4Serv.pl", ip_int[0], ip_int[1], adminName, date_created, reason, ip_banned);
- ShowPlayerDialog( playerid, 1314, DIALOG_STYLE_MSGBOX, "{FF0000}BAN", buf, "Wyjdz", "" );
- return 1;
- } else {
- if (!time_to_end) {
- // perm
- SendClientMessage( playerid, -1, "PERM");
- printf("PERM: Nick: %s, Nick admina: %s, powod: %s", nick_banned, adminName, reason);
- return 1;
- } else {
- // czasowka
- printf("CZASOWY: Nick: %s, Nick admina: %s, powod: %s, koniec bana: %s", nick_banned, adminName, reason, date_to_end);
- SendClientMessage( playerid, -1, "CZASOWY");
- return 1;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment