Advertisement
aokmikey

Untitled

Oct 3rd, 2016
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.33 KB | None | 0 0
  1.     def cmd_restore(self, data, client, cmd=None):
  2.         """\
  3.        !restore - restores players rank
  4.        """
  5.         cursor2 = self.console.storage.query("""SELECT id, client_id, set_time, rankxp, score, kills, deaths, headshots, rank, ip FROM stats WHERE client_id = %s LIMIT 1"""%(client.id))
  6.         input = self._adminPlugin.parseUserCmd(data)
  7.         if cursor2.rowcount == 0:
  8.             client.message("^7You have no stats to restore from!")
  9.             return True
  10.  
  11.         if not input:
  12.             while not cursor2.EOF:
  13.                 r2 = cursor2.getRow()
  14.                 if r2['ip'] != client.ip:
  15.                     client.message("^7Security check failed. Contact MiKeY or iMtroll on the forums to restore your rank.")
  16.                     return True
  17.                 else:
  18.                     client.message("^7Backup Restored: Date: %s, Backup ID: %s, Rank: %s, Score: %s" %( self.console.formatTime(r2['set_time']), r2['id'], r2['rank'],r2['score']))
  19.                     self.console.write('admin setstats:%s:%s.%s.%s.%s.%s.%s' % (client.cid,r2['rankxp'],r2['score'],r2['kills'],r2['deaths'],r2['headshots'],r2['rank'] ))
  20.                     return True
  21.                 cursor2.moveNext()
  22.         else:
  23.             client.message("An unknown error has occurred.")
  24.             return False
  25.  
  26.         cursor2.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement