AXV09

Untitled

May 12th, 2013
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1.  
  2. stock banCheck(playerid) {
  3.  
  4. new ip_player[16], ip_int[4];
  5.  
  6. GetPlayerIp(playerid, ip_player, 16);
  7. sscanf(ip_player, "p<.>a<d>[4]", ip_int);
  8.  
  9. new buf[350];
  10. 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]);
  11. mysql_query(buf);
  12. mysql_store_result();
  13. if (!mysql_num_rows()) {
  14. mysql_free_result();
  15. return 0;
  16. }
  17.  
  18. 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];
  19. mysql_fetch_row(buf, "|");
  20. 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);
  21. mysql_free_result();
  22.  
  23. if (type) {
  24. // tutaj zapytanie do whitelist
  25.  
  26. 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);
  27. ShowPlayerDialog( playerid, 1314, DIALOG_STYLE_MSGBOX, "{FF0000}BAN", buf, "Wyjdz", "" );
  28. return 1;
  29. } else {
  30. if (!time_to_end) {
  31. // perm
  32. SendClientMessage( playerid, -1, "PERM");
  33. printf("PERM: Nick: %s, Nick admina: %s, powod: %s", nick_banned, adminName, reason);
  34. return 1;
  35. } else {
  36. // czasowka
  37. printf("CZASOWY: Nick: %s, Nick admina: %s, powod: %s, koniec bana: %s", nick_banned, adminName, reason, date_to_end);
  38. SendClientMessage( playerid, -1, "CZASOWY");
  39. return 1;
  40. }
  41. }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment