SHARE
TWEET

Untitled

a guest Sep 21st, 2019 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. YCMD:unban(playerid, params[], help) {
  2.     if(PlayerInfo[playerid][pAdmin] >= 3) {
  3.         new id[30],escape[30],str1[256],string[128],sendername[30],qstr[256];
  4.         if(sscanf(params, "s[30]", id)) return SendClientMessage(playerid, 0xB8DBFFFF, "Usage: {FFFFFF}/unban [name]");
  5.         mysql_real_escape_string(id, escape);
  6.         format(qstr,sizeof(qstr),"SELECT * FROM bans WHERE `PlayerName`='%s' AND `Active`='1'",escape);
  7.         new Cache: banuri = mysql_query(SQL,qstr);
  8.         if(cache_get_row_count() > 0)
  9.         {
  10.             GetPlayerName(playerid, sendername, sizeof(sendername));
  11.             format(string,sizeof(string),"AdmCmd: %s has unbanned user %s.",sendername,escape);
  12.             SendAdminMessage(0xDBA458FF, string,1);
  13.             mysql_format(SQL,str1,sizeof(str1),"UPDATE bans SET `Active`='0' WHERE `PlayerName`='%s'",escape);
  14.             mysql_tquery(SQL,str1,"","");
  15.         }
  16.         else SendClientMessage(playerid, -1, "Invalid player.");
  17.         cache_delete(banuri);
  18.     }
  19.     return 1;
  20. }
  21. YCMD:unbanip(playerid, params[], help) {
  22.     if(PlayerInfo[playerid][pAdmin] >= 5) {
  23.         new ip[16],escape[16],str1[256],string[256],sendername[30],qstr[256];
  24.         if(sscanf(params, "s[16]", ip)) return SendClientMessage(playerid, 0xB8DBFFFF, "Usage: {FFFFFF}/unbanip [ip]");
  25.         mysql_real_escape_string(ip, escape);
  26.         format(qstr,sizeof(qstr),"SELECT * FROM bans WHERE `IP`='%s' AND `Active`='1'",escape);
  27.         new Cache: banuri = mysql_query(SQL,qstr);
  28.         if(cache_get_row_count() > 0)
  29.         {
  30.             GetPlayerName(playerid, sendername, sizeof(sendername));
  31.             format(string,sizeof(string),"AdmCmd: %s has unbanned IP %s.",sendername,escape);
  32.             SendAdminMessage(0xDBA458FF, string,1);
  33.             mysql_format(SQL,str1,sizeof(str1),"UPDATE bans SET `Active`='0' WHERE `IP`='%s'",escape);
  34.             mysql_tquery(SQL,str1,"","");
  35.         }
  36.         else SendClientMessage(playerid, COLOR_LIGHTRED, "This IP is not banned.");
  37.         cache_delete(banuri);
  38.     }
  39.     return 1;
  40. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top